1+ name : Single test run
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ dolfinx_tag :
7+ required : true
8+ type : string
9+
10+ jobs :
11+ test-code :
12+ runs-on : ubuntu-24.04
13+ # The container tag is now dynamic based on the input passed by the caller
14+ container : ghcr.io/fenics/dolfinx/dolfinx:${{ inputs.dolfinx_tag }}
15+
16+ steps :
17+ - uses : actions/checkout@v6
18+
19+ - name : Update pip
20+ run : python3 -m pip install --upgrade pip
21+
22+ - name : Install build requirements
23+ run : python3 -m pip install -r build-requirements.txt
24+
25+ # Note: We assume the caller workflow has already uploaded these artifacts
26+ - name : Download legacy data
27+ uses : actions/download-artifact@v7
28+ with :
29+ name : legacy_mpich
30+ path : ./legacy
31+
32+ - name : Download legacy data
33+ uses : actions/download-artifact@v7
34+ with :
35+ name : legacy_checkpoint_mpich
36+ path : ./legacy_checkpoint
37+
38+ - name : Install package
39+ run : |
40+ HDF5_MPI=ON HDF5_PKGCONFIG_NAME="hdf5" python3 -m pip install h5py --no-build-isolation --no-binary=h5py
41+ python3 -m pip install .[test]
42+
43+ - name : Run tests
44+ run : coverage run --rcfile=.coveragerc -m pytest -xvs ./tests/
45+
46+ - name : Run tests in parallel
47+ run : mpirun -n 4 coverage run --rcfile=.coveragerc -m mpi4py -m pytest -xvs ./tests/
48+
49+ - name : Combine coverage reports
50+ run : |
51+ coverage combine
52+ coverage report -m
53+ coverage html
54+
55+ # Use the tag in the artifact name so parallel runs don't overwrite each other
56+ - name : Upload coverage report
57+ uses : actions/upload-artifact@v6
58+ with :
59+ name : code-coverage-report-${{ inputs.dolfinx_tag }}
60+ path : htmlcov
61+ if-no-files-found : error
0 commit comments