Skip to content

Commit

Permalink
Build tutorials from g-adopt/tutorials repository
Browse files Browse the repository at this point in the history
  • Loading branch information
angus-g committed Feb 12, 2024
1 parent 3e1cef7 commit 18ca37d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,43 @@ permissions:
id-token: write

jobs:
render:
runs-on: self-hosted
container:
image: firedrakeproject/firedrake:latest
options: --shm-size 2g

env:
OMP_NUM_THREADS: 1

steps:
- uses: actions/checkout@v4
with:
repository: g-adopt/tutorials
path: tutorials
- 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 nbconvert
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
python3 -m pytest --nbval tutorials/01-*.ipynb
- name: Convert notebooks
run: |
python3 -m jupyter nbconvert --to notebook --execute --output-dir=rendered tutorials/01-*.ipynb
- uses: actions/upload-artifact@v4
with:
name: notebooks
path: rendered

build:
runs-on: ubuntu-latest
steps:
Expand All @@ -23,6 +60,10 @@ jobs:
- name: Install Python dependencies
run: |
pip install -r requirements.txt
- uses: actions/download-artifact@v4
with:
name: notebooks
path: docs/tutorials
- name: Build site
run: |
mkdocs build --clean
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ nav:
- Documentation: documentation.md
- Tutorials:
- tutorials.md
- Helmholtz: tutorials/01-spd-helmholtz.nbconvert.ipynb
- Helmholtz: tutorials/01-spd-helmholtz.ipynb
- Benchmarks: benchmarks.md
- Team: team.md
- Funding: funding.md
Expand Down

0 comments on commit 18ca37d

Please sign in to comment.