Pin versions for compatibility with dolfinx v0.6.0 #1102
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: RBniCSx CI | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: "0 5 * * *" | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
test: | |
if: >- | |
( | |
( | |
github.event_name == 'schedule' | |
&& github.repository == 'RBniCS/RBniCSx' | |
) || ( | |
github.event_name != 'schedule' | |
&& !( | |
contains(github.event.head_commit.message, '[ci skip]') | |
|| contains(github.event.head_commit.message, '[skip ci]') | |
) | |
) | |
) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- backend: dolfinx-real | |
container: ghcr.io/fenics/dolfinx/dolfinx:v0.6.0-r1 | |
setup_container: | | |
. /usr/local/bin/dolfinx-real-mode | |
echo "PETSC_ARCH=$PETSC_ARCH" >> $GITHUB_ENV | |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV | |
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV | |
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV | |
- backend: dolfinx-complex | |
container: ghcr.io/fenics/dolfinx/dolfinx:v0.6.0-r1 | |
setup_container: | | |
. /usr/local/bin/dolfinx-complex-mode | |
echo "PETSC_ARCH=$PETSC_ARCH" >> $GITHUB_ENV | |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV | |
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV | |
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV | |
fail-fast: false | |
container: | |
image: ${{ matrix.container }} | |
options: --user root | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: dolfinx-v0.6.0 | |
- name: Setup container | |
run: ${{ matrix.setup_container }} | |
- name: Install RBniCSx | |
run: | | |
python3 -m pip install .[docs,lint,tests,tutorials] | |
python3 -c "import rbnicsx._cpp" | |
shell: bash | |
- name: Run documentation generation | |
run: | | |
cd docs && make html | |
- name: Run unit tests (serial) | |
run: | | |
COVERAGE_UNIT_OMIT="" | |
PYTEST_UNIT_OPTIONS="" | |
COVERAGE_FILE=.coverage_unit_serial python3 -m coverage run --source=rbnicsx --omit="${COVERAGE_UNIT_OMIT}" -m pytest ${PYTEST_UNIT_OPTIONS} tests/unit | |
- name: Run unit tests (parallel) | |
run: | | |
COVERAGE_UNIT_OMIT="" | |
PYTEST_UNIT_OPTIONS="" | |
COVERAGE_FILE=.coverage_unit_parallel mpirun -n 2 python3 -m coverage run --source=rbnicsx --parallel-mode --omit="${COVERAGE_UNIT_OMIT}" -m pytest ${PYTEST_UNIT_OPTIONS} tests/unit | |
- name: Combine coverage reports | |
run: | | |
python3 -m coverage combine .coverage* | |
python3 -m coverage report --fail-under=100 --show-missing --skip-covered | |
- name: Import modules at least once, so that tutorials duration is not affected by module setup | |
run: | | |
python3 -m pytest --durations=0 --durations-min=1.0 tutorials/.imports.ipynb | |
- name: Run tutorials (serial) | |
run: | | |
python3 -m pytest --tag-collapse --durations=0 --durations-min=1.0 tutorials | |
- name: Run tutorials (parallel) | |
run: | | |
python3 -m pytest --tag-collapse --np=2 --durations=0 --durations-min=1.0 tutorials | |
- name: Upload tutorials logs as an artifact in case of failure | |
if: failure() || cancelled() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: "tutorials-logs-${{ matrix.backend }}" | |
path: | | |
tutorials/**/.ipynb_pytest/**/*.log* |