-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (81 loc) · 2.2 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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