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 * * 1" # every Monday at 8:00 UTC
24
25
26 env:
27 DEB_PYTHON_INSTALL_LAYOUT: deb_system
28 DEFAULT_TAG: nightly
29
30 jobs:
31 get_image_tag:
32 runs-on: ubuntu-latest
33 outputs:
34 image: ${{ steps.docker_tag.outputs.image }}
35 steps:
36 - id: docker_tag
37 run: echo "image=${{ inputs.tag || env.DEFAULT_TAG }}" >> $GITHUB_OUTPUT
38
39 build:
40 needs: get_image_tag
41 runs-on: ubuntu-latest
42 container: ghcr.io/fenics/dolfinx/dolfinx:${{ needs.get_image_tag.outputs.image }}
43 steps:
44 - uses: actions/checkout@v7
45
46 - name: Update pip and install build deps
47 run: |
48 python3 -m pip install --upgrade pip setuptools
49 python3 -m pip install . --group dev --no-build-isolation
50
51 - name: Install code
52 run: python3 -m pip install . --no-build-isolation
53
54 - name: Check code formatting with ruff
55 run: |
56 ruff check .
57 ruff format --check .
58
59 - name: Mypy check
60 run: python3 -m mypy