Modify tutorials for rendering on gadopt.org #48
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 and deploy notebooks | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Test and deploy notebooks | |
runs-on: self-hosted | |
container: | |
image: firedrakeproject/firedrake:latest | |
options: --shm-size 2g | |
env: | |
OMP_NUM_THREADS: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y libgl1-mesa-glx xvfb | |
. /home/firedrake/firedrake/bin/activate | |
python3 -m pip install nbval pyvista | |
python3 -m pip install gadopt[optimisation] | |
- name: Run test | |
run: | | |
. /home/firedrake/firedrake/bin/activate | |
export DISPLAY=:99 | |
export PYVISTA_OFF_SCREEN=true | |
Xvfb $DISPLAY -screen 0 1024x768x24 > /dev/null 2>&1 & | |
sleep 3 | |
pytest --nbval 01-*.ipynb | |
- name: Build Jupyter Book | |
run: | | |
. /home/firedrake/firedrake/bin/activate | |
python3 -m pip install jupyter-book | |
for f in 01-*.ipynb; do ln -s ../$f docs; done | |
ln -s ../stokes-control.msh docs | |
export DISPLAY=:99 | |
export PYVISTA_OFF_SCREEN=true | |
Xvfb $DISPLAY -screen 0 1024x768x24 > /dev/null 2>&1 & | |
sleep 3 | |
jupyter-book build docs | |
- name: Archive built book | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tutorials-html | |
path: docs/_build/html |