Pin versions for compatibility with dolfinx v0.4.1 #1097
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: dolfinx/dolfinx:v0.4.1 | |
setup_container: | | |
. /usr/local/bin/dolfinx-real-mode | |
python3 -m pip install --upgrade pip setuptools | |
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: dolfinx/dolfinx:v0.4.1 | |
setup_container: | | |
. /usr/local/bin/dolfinx-complex-mode | |
python3 -m pip install --upgrade pip setuptools | |
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.4.1 | |
- 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: Determine coverage and pytest options for unit tests | |
id: unit_options | |
run: | | |
COVERAGE_UNIT_OMIT="" | |
PYTEST_UNIT_OPTIONS="" | |
echo "::set-output name=coverage_omit::${COVERAGE_UNIT_OMIT}" | |
echo "::set-output name=pytest_options::${PYTEST_UNIT_OPTIONS}" | |
shell: bash | |
- name: Run unit tests (serial) | |
run: | | |
COVERAGE_UNIT_OMIT="${{ steps.unit_options.outputs.coverage_omit }}" | |
PYTEST_UNIT_OPTIONS="${{ steps.unit_options.outputs.pytest_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="${{ steps.unit_options.outputs.coverage_omit }}" | |
PYTEST_UNIT_OPTIONS="${{ steps.unit_options.outputs.pytest_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 | |
uses: actions/upload-artifact@v2 | |
with: | |
name: "tutorials-logs-${{ matrix.backend }}" | |
path: | | |
tutorials/**/.ipynb_pytest/**/*.log* |