Debian Codegraph @

.github/workflows/check_formatting.yml

raw
1 name: Check formatting
2
3 on:
4 workflow_call:
5 inputs:
6 tag:
7 description: "Tag of DOLFINx docker image"
8 default: "nightly"
9 required: true
10 type: string
11 workflow_dispatch:
12 inputs:
13 tag:
14 description: "Tag of DOLFINx docker image"
15 default: "nightly"
16 required: true
17 type: string
18
19 pull_request:
20 branches:
21 - main
22 schedule:
23 - cron: "0 8 * * *"
24
25 env:
26 DEB_PYTHON_INSTALL_LAYOUT: deb_system
27 DEFAULT_TAG: nightly
28
29 jobs:
30 get_image_tag:
31 runs-on: ubuntu-latest
32 outputs:
33 image: ${{ steps.docker_tag.outputs.image }}
34 steps:
35 - id: docker_tag
36 run: echo "image=${{ inputs.tag || env.DEFAULT_TAG }}" >> $GITHUB_OUTPUT
37
38 build:
39 needs: get_image_tag
40 runs-on: ubuntu-22.04
41 container: ghcr.io/fenics/dolfinx/dolfinx:${{ needs.get_image_tag.outputs.image }}
42 steps:
43 - uses: actions/checkout@v5
44
45 - name: Update pip
46 run: python3 -m pip install --break-system-packages --upgrade pip setuptools
47
48 - name: Install code
49 run: python3 -m pip install --break-system-packages .[dev]
50
51 - name: Check code formatting with ruff
52 run: |
53 ruff check .
54 ruff format --check .
55
56 - name: Mypy check
57 run: python3 -m mypy -v