1515 - main
1616 workflow_dispatch :
1717
18+ # Cancel superseded runs: a new commit on a pull request makes the
19+ # previous run's result irrelevant. Pushes to 'main' and 'release' are
20+ # left to finish, since they populate caches and publish artefacts.
21+ concurrency :
22+ group : ${{ github.workflow }}-${{ github.ref }}
23+ cancel-in-progress : ${{ github.event_name == 'pull_request' }}
24+
1825jobs :
1926
2027 lint :
3340 run : cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV
3441
3542 - name : Install linting tools
36- run : pip install clang-format gersemi mypy ruff
43+ run : pip install --group python/pyproject.toml:lint
3744 - name : ruff .py files in C++ code
3845 run : |
3946 cd cpp/
5663 find . -type f \( -name "*.cpp" -o -name "*.h" \) | xargs clang-format --dry-run --Werror
5764 - name : gersemi
5865 run : gersemi --check .
59- - name : mypy checks (no installed)
60- run : |
61- cd python/
62- MYPY_FLAGS="--ignore-missing-imports --disable-error-code no-any-unimported --disable-error-code unused-ignore --disable-error-code attr-defined --disable-error-code name-defined --disable-error-code no-any-return"
63- mypy $MYPY_FLAGS dolfinx
64- mypy $MYPY_FLAGS demo
65- mypy $MYPY_FLAGS test
6666
6767
6868 ccpp-build :
9696 - name : Install Python build dependencies
9797 working-directory : python
9898 run : |
99- pip install scikit-build-core setuptools
100- python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install
99+ pip install --group pyproject.toml:build setuptools
101100
102101 - name : Install UFL
103102 run : |
@@ -151,28 +150,19 @@ jobs:
151150
152151 - name : Build Python interface
153152 run : >
154- pip install 'python/[test,mypy ]'
153+ pip install --group python/pyproject.toml:test 'python/[demo ]'
155154 --check-build-dependencies
156155 --no-build-isolation
157156 --config-settings=cmake.build-type="Developer"
158157
159158 - name : Check Python configuration
160159 run : python -c "from mpi4py import MPI; import dolfinx; assert not dolfinx.has_petsc; assert not dolfinx.has_petsc4py; assert dolfinx.has_superlu_dist"
161160
162- - name : Install gmsh and pyvista ( and dependencies)
161+ - name : Install system dependencies for gmsh and pyvista
163162 run : |
164163 sudo apt-get install libglu1-mesa libgl1 libxrender1 libxcursor1 libxft2 libxinerama1
165164 sudo apt-get install libegl1
166- pip install gmsh pyvista
167165
168- - name : mypy checks (no petsc4py)
169- run : |
170- DISABLE_FLAGS="--disable-error-code import-not-found --disable-error-code no-any-unimported"
171- mypy --config-file python/pyproject.toml -p dolfinx --exclude 'petsc\.py|io/utils\.py' $DISABLE_FLAGS
172- cd python/
173- DISABLE_FLAGS="$DISABLE_FLAGS --disable-error-code attr-defined --disable-error-code name-defined --disable-error-code unused-ignore"
174- mypy demo $DISABLE_FLAGS
175- mypy test $DISABLE_FLAGS
176166
177167 - name : Run demos (Python, serial)
178168 run : |
@@ -191,22 +181,16 @@ jobs:
191181 needs : [lint]
192182 strategy :
193183 matrix :
194- petsc_arch : [linux-gnu-real32-32, linux-gnu-real64-32, linux-gnu-complex64-32, linux-gnu-complex128-32, linux-gnu-real64-64, linux-gnu-complex128-64]
195- docker_image : ["ghcr.io/fenics/test-env:current-openmpi"]
196- include :
197- - docker_image : " ghcr.io/fenics/test-env:current-mpich"
198- petsc_arch : linux-gnu-real64-32
199- - docker_image : " ghcr.io/fenics/test-env:current-mpich"
200- petsc_arch : linux-gnu-complex128-32
201- container : ${{ matrix.docker_image }}
184+ petsc_arch : [linux-gnu-real64-32, linux-gnu-complex128-32, linux-gnu-real64-64]
185+ container : " ghcr.io/fenics/test-env:current"
202186 env :
203187 PETSC_ARCH : ${{ matrix.petsc_arch }}
204188 OMPI_ALLOW_RUN_AS_ROOT : 1
205189 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM : 1
206190 PRTE_MCA_rmaps_default_mapping_policy : :oversubscribe
207191 PYTEST_ADDOPTS : " -W error"
208192
209- name : Build and test (${{ matrix.petsc_arch }}, ${{ matrix.docker_image }} )
193+ name : Build and test (${{ matrix.petsc_arch }})
210194 steps :
211195 - uses : actions/checkout@v7
212196
@@ -216,8 +200,7 @@ jobs:
216200 - name : Install Python build dependencies
217201 working-directory : python
218202 run : |
219- pip install scikit-build-core
220- python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install
203+ pip install --group pyproject.toml:build
221204
222205 - name : Install UFL
223206 run : |
@@ -273,7 +256,7 @@ jobs:
273256
274257 - name : Build Python interface
275258 run : >
276- pip install ' python/[ test,mypy] '
259+ pip install --group python/pyproject.toml: test 'python/ '
277260 --check-build-dependencies
278261 --no-build-isolation
279262 --config-settings=cmake.build-type="Developer"
@@ -294,13 +277,6 @@ jobs:
294277 apt-get install libegl1 libxrender1
295278 pip install pyvista
296279
297- - name : mypy checks (with petsc4py)
298- run : |
299- mypy --config-file python/pyproject.toml -p dolfinx --exclude superlu_dist.py
300- cd python/
301- mypy demo
302- mypy test
303-
304280 - name : Run demos (Python, serial)
305281 run : |
306282 pip install pytest-xdist
@@ -316,7 +292,7 @@ jobs:
316292 build-and-publish-docs :
317293 runs-on : ubuntu-26.04
318294 needs : [lint]
319- container : " ghcr.io/fenics/test-env:current-openmpi "
295+ container : " ghcr.io/fenics/test-env:current"
320296 env :
321297 PETSC_ARCH : linux-gnu-real64-32
322298 OMPI_ALLOW_RUN_AS_ROOT : 1
@@ -333,8 +309,7 @@ jobs:
333309 - name : Install Python build dependencies
334310 working-directory : python
335311 run : |
336- pip install scikit-build-core setuptools
337- python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install
312+ pip install --group pyproject.toml:build setuptools
338313
339314 - name : Install FEniCS Python components
340315 run : |
@@ -350,7 +325,7 @@ jobs:
350325
351326 - name : Build Python interface
352327 run : >
353- pip install ' python/[ docs] '
328+ pip install --group python/pyproject.toml: docs 'python/ '
354329 --check-build-dependencies
355330 --no-build-isolation
356331
0 commit comments