Skip to content

build

build #27

Workflow file for this run

name: build
on:
push:
branches:
- main
workflow_dispatch:
permissions:
pages: write
contents: read
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
ref: angus-g/website-deploy
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..05}-*.ipynb
- name: Convert notebooks
run: |
. /home/firedrake/firedrake/bin/activate
python3 -m jupyter nbconvert --to notebook --execute --output-dir=rendered tutorials/{01..05}-*.ipynb
- uses: actions/upload-artifact@v4
with:
name: notebooks
path: rendered
build:
runs-on: ubuntu-latest
needs: render
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
cache: pip
- name: Install Python dependencies
run: |
pip install -r requirements.txt
- name: Clone G-ADOPT for API documentation
uses: actions/checkout@v4
with:
repository: g-adopt/g-adopt
path: g-adopt
- uses: actions/download-artifact@v4
with:
name: notebooks
path: docs/tutorials
- name: Build site
run: |
mkdocs build --clean
- uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
steps:
- uses: actions/deploy-pages@v4