@@ -15,21 +15,25 @@ jobs:
1515 strategy :
1616 fail-fast : false
1717 matrix :
18- os : [ ubuntu-latest ]
18+ os : [ ubuntu-24.04 ]
1919 python-version : [ 3.9, '3.10', '3.11', '3.12' ]
2020 isMerge :
2121 - ${{ github.event_name == 'push' && github.ref == 'refs/heads/devel' }}
2222 exclude :
2323 - { isMerge: false, python-version: '3.10' }
2424 - { isMerge: false, python-version: '3.11' }
2525 include :
26- - os : macos-latest
26+ - os : macos-14
2727 python-version : ' 3.10'
28- - os : macos-latest
28+ - os : macos-14
2929 python-version : ' 3.11'
3030
3131 name : ${{ matrix.os }} / Python ${{ matrix.python-version }}
3232
33+ env :
34+ PSYDAC_MESH_DIR : ${{ github.workspace }}/mesh
35+ OMP_NUM_THREADS : 2
36+
3337 steps :
3438 - uses : actions/checkout@v4
3539
4448 requirements_extra.txt
4549
4650 - name : Install non-Python dependencies on Ubuntu
47- if : matrix.os == 'ubuntu-latest '
51+ if : matrix.os == 'ubuntu-24.04 '
4852 uses : awalsh128/cache-apt-pkgs-action@latest
4953 with :
5054 packages : gfortran openmpi-bin libopenmpi-dev libhdf5-openmpi-dev
@@ -55,14 +59,14 @@ jobs:
5559 # Workaround is to 'reinstall' openmpi-bin, which doesn't actually perform
5660 # installation (since openmpi-bin already exists), but instead reruns
5761 # `update-alternatives` which fixes the symlinks to mpicc/mpif90.
58- - name : Set default MPI and HDF5 C compilers on Ubuntu
59- if : matrix.os == 'ubuntu-latest '
62+ - name : Reconfigure non-Python dependencies on Ubuntu
63+ if : matrix.os == 'ubuntu-24.04 '
6064 run : |
6165 sudo apt-get update
62- sudo apt-get install --reinstall openmpi-bin libhdf5-openmpi-dev
66+ sudo apt-get install --reinstall openmpi-bin libhdf5-openmpi-dev liblapack-dev libblas-dev
6367
6468 - name : Install non-Python dependencies on macOS
65- if : matrix.os == 'macos-latest '
69+ if : matrix.os == 'macos-14 '
6670 run : |
6771 brew install open-mpi
6872 brew install hdf5-mpi
8993
9094 - name : Determine directory of parallel HDF5 library
9195 run : |
92- if [[ "${{ matrix.os }}" == "ubuntu-latest " ]]; then
96+ if [[ "${{ matrix.os }}" == "ubuntu-24.04 " ]]; then
9397 HDF5_DIR=$(dpkg -L libhdf5-openmpi-dev | grep libhdf5.so | xargs dirname)
94- elif [[ "${{ matrix.os }}" == "macos-latest " ]]; then
98+ elif [[ "${{ matrix.os }}" == "macos-14 " ]]; then
9599 HDF5_DIR=$(brew list hdf5-mpi | grep "libhdf5.dylib" | xargs dirname | xargs dirname)
96100 fi
97101 echo $HDF5_DIR
@@ -104,12 +108,12 @@ jobs:
104108 cache-name : cache-PETSc
105109 with :
106110 path : " ./petsc"
107- key : cache -${{ matrix.os }}-${{ matrix.python-version }}
111+ key : petsc -${{ matrix.os }}-${{ matrix.python-version }}
108112
109113 - if : steps.cache-petsc.outputs.cache-hit != 'true'
110114 name : Download a specific release of PETSc
111115 run : |
112- git clone --depth 1 --branch v3.21.4 https://gitlab.com/petsc/petsc.git
116+ git clone --depth 1 --branch v3.22.2 https://gitlab.com/petsc/petsc.git
113117
114118 - if : steps.cache-petsc.outputs.cache-hit != 'true'
115119 name : Install PETSc with complex support
@@ -157,7 +161,7 @@ jobs:
157161
158162 - name : Install project
159163 run : |
160- python -m pip install .
164+ python -m pip install .[test]
161165 python -m pip freeze
162166
163167 - name : Test Pyccel optimization flags
@@ -169,35 +173,51 @@ jobs:
169173 mkdir pytest
170174 cp mpi_tester.py pytest
171175
172- - name : Run single-process tests with Pytest
176+ - name : Run coverage tests on macOS
177+ if : matrix.os == 'macos-14'
178+ working-directory : ./pytest
179+ run : >-
180+ python -m pytest -n auto
181+ --cov psydac
182+ --cov-config $GITHUB_WORKSPACE/pyproject.toml
183+ --cov-report xml
184+ --pyargs psydac -m "not parallel and not petsc"
185+
186+ - name : Run single-process tests with Pytest on Ubuntu
187+ if : matrix.os == 'ubuntu-24.04'
173188 working-directory : ./pytest
174189 run : |
175- export PSYDAC_MESH_DIR=$GITHUB_WORKSPACE/mesh
176- export OMP_NUM_THREADS=2
177190 python -m pytest -n auto --pyargs psydac -m "not parallel and not petsc"
178191
192+ - name : Upload coverage report to Codacy
193+ if : matrix.os == 'macos-14'
194+ uses : codacy/codacy-coverage-reporter-action@v1.3.0
195+ with :
196+ project-token : ${{ secrets.CODACY_PROJECT_TOKEN }}
197+ coverage-reports : ./pytest/coverage.xml
198+
199+ - name : Print detailed coverage results on macOS
200+ if : matrix.os == 'macos-14'
201+ working-directory : ./pytest
202+ run : |
203+ coverage report --ignore-errors --show-missing --sort=cover
204+
179205 - name : Run MPI tests with Pytest
180206 working-directory : ./pytest
181207 run : |
182- export PSYDAC_MESH_DIR=$GITHUB_WORKSPACE/mesh
183- export OMP_NUM_THREADS=2
184208 python mpi_tester.py --mpirun="mpiexec -n 4 ${MPI_OPTS}" --pyargs psydac -m "parallel and not petsc"
185209
186210 - name : Run single-process PETSc tests with Pytest
187211 working-directory : ./pytest
188212 run : |
189- export PSYDAC_MESH_DIR=$GITHUB_WORKSPACE/mesh
190- export OMP_NUM_THREADS=2
191213 python -m pytest -n auto --pyargs psydac -m "not parallel and petsc"
192214
193215 - name : Run MPI PETSc tests with Pytest
194216 working-directory : ./pytest
195217 run : |
196- export PSYDAC_MESH_DIR=$GITHUB_WORKSPACE/mesh
197- export OMP_NUM_THREADS=2
198218 python mpi_tester.py --mpirun="mpiexec -n 4 ${MPI_OPTS}" --pyargs psydac -m "parallel and petsc"
199219
200220 - name : Remove test directory
201- if : ${{ always() }}
221+ if : always()
202222 run : |
203223 rm -rf pytest
0 commit comments