Improvements for Cameron #11
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: Test stable release | |
on: | |
workflow_dispatch: | |
workflow_call: | |
pull_request: | |
branches: ["main"] | |
env: | |
HDF5_MPI: "ON" | |
HDF5_DIR: "/usr/local/" | |
DISPLAY: ":99.0" | |
DEB_PYTHON_INSTALL_LAYOUT: deb_system | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
container: ghcr.io/cianwilson/fenicsx_subduction:v0.8.0 | |
env: | |
PYVISTA_OFF_SCREEN: true | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Initialize | |
run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
python3 -c "from pyvista import start_xvfb; start_xvfb(0.1)" | |
- name: Check scripts are up to date | |
working-directory: notebooks | |
run: | | |
jupyter nbconvert --NbConvertApp.export_format=script --ClearOutputPreprocessor.enabled=True Poisson1D.ipynb | |
jupyter nbconvert --NbConvertApp.export_format=script --ClearOutputPreprocessor.enabled=True Poisson2D.ipynb | |
jupyter nbconvert --NbConvertApp.export_format=script --ClearOutputPreprocessor.enabled=True Poisson2DSolutions.ipynb | |
jupyter nbconvert --NbConvertApp.export_format=script --ClearOutputPreprocessor.enabled=True SubductionBenchmark.ipynb | |
jupyter nbconvert --NbConvertApp.export_format=script --ClearOutputPreprocessor.enabled=True SubductionBenchmarkSolutions.ipynb | |
git diff --name-only --exit-code || { retcode=$?; echo "Python scripts not up to date with notebook files. Please update."; exit $retcode; } | |
- name: Check notebooks are clean | |
working-directory: notebooks | |
run: | | |
jupyter nbconvert --clear-output --inplace Poisson1D.ipynb | |
jupyter nbconvert --clear-output --inplace Poisson2D.ipynb | |
jupyter nbconvert --clear-output --inplace Poisson2DSolutions.ipynb | |
jupyter nbconvert --clear-output --inplace SubductionBenchmark.ipynb | |
jupyter nbconvert --clear-output --inplace SubductionBenchmarkSolutions.ipynb | |
git diff --name-only --exit-code || { retcode=$?; echo "Jupyter notebooks are not clear. Please clear output."; exit $retcode; } | |
- name: Test background | |
working-directory: notebooks | |
run: | | |
mpirun -n 2 python3 Poisson1D.py | |
mpirun -n 2 python3 Poisson2DSolutions.py | |