Enable CI testing #13
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Testing | |
# Trigger the workflow on push or pull request, | |
# but only for the master branch | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
# Don't immediately kill all if one Python version fails | |
fail-fast: false | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11'] | |
env: | |
CC: mpicc | |
PETSC_DIR: ${{ github.workspace }}/petsc | |
PETSC_ARCH: default | |
PETSC_CONFIGURE_OPTIONS: --with-debugging=1 --with-shared-libraries=1 --with-c2html=0 --with-fortran-bindings=0 | |
RDMAV_FORK_SAFE: 1 | |
timeout-minutes: 60 | |
steps: | |
- name: Install system dependencies | |
shell: bash | |
run: | | |
sudo apt update | |
sudo apt install build-essential mpich libmpich-dev \ | |
libblas-dev liblapack-dev gfortran | |
- name: Set correct Python version | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Clone PETSc | |
uses: actions/checkout@v4 | |
with: | |
repository: firedrakeproject/petsc | |
path: ${{ env.PETSC_DIR }} | |
- name: Build and install PETSc | |
shell: bash | |
working-directory: ${{ env.PETSC_DIR }} | |
run: | | |
./configure ${PETSC_CONFIGURE_OPTIONS} | |
make | |
- name: Build and install petsc4py | |
# Remove this step when Firedrake PETSc branch is updated to support | |
# building petsc4py with Cython>=3.0 | |
shell: bash | |
working-directory: ${{ env.PETSC_DIR }}/src/binding/petsc4py | |
run: | | |
pip install --upgrade pip | |
pip install --upgrade wheel 'cython<3' numpy | |
pip install --no-deps . | |
- name: Checkout pyop3 | |
uses: actions/checkout@v4 | |
with: | |
path: pyop3 | |
- name: Install pyop3 and testing dependencies | |
shell: bash | |
working-directory: pyop3 | |
run: | | |
# Gross: | |
pip install toml | |
python scripts/requirements.py build | pip install -r /dev/stdin | |
pip install --no-build-isolation . | |
python scripts/requirements.py run | pip install -r /dev/stdin | |
pip install pytest pytest-cov pytest-timeout pytest-xdist pytest-timeout | |
- name: Run tests | |
shell: bash | |
working-directory: pyop3 | |
run: | | |
pytest \ | |
--durations=200 \ | |
--tb=native \ | |
--cov pyop3 \ | |
--timeout=480 \ | |
--timeout-method=thread \ | |
-o faulthandler_timeout=540 \ | |
-n 12 --dist worksteal \ | |
-v tests | |
timeout-minutes: 10 | |