-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (90 loc) · 2.74 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
89
90
91
92
93
94
95
96
97
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/g-adopt
path: tutorials
- name: Make previous version of Mesa available
run: |
sed 's/noble/mantic/g' /etc/apt/sources.list.d/ubuntu.sources | sudo tee /etc/apt/sources.list.d/mantic.sources > /dev/null
sudo apt update
sudo apt remove -y libx11-6
sudo apt -t mantic install -y --allow-downgrades libglx-mesa0=23.2.1-1ubuntu3.1 libglapi-mesa=23.2.1-1ubuntu3.1 libgl1-mesa-dri=23.2.1-1ubuntu3.1 libx11-6=2:1.8.6-1ubuntu1
- name: Install dependencies
run: |
sudo apt install -y xvfb gmsh
. /home/firedrake/firedrake/bin/activate
python3 -m pip install nbval nbconvert jupytext
python3 -m pip install tutorials/[demos]
python3 -m ipykernel install --name firedrake --user
- name: Convert notebooks
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
make -j -C tutorials convert_demos
rm -rf rendered && mkdir rendered
find tutorials/demos -name '*.ipynb' -exec cp "{}" rendered \;
cp tutorials/demos/.pages rendered
cp tutorials/demos/.diagram.mermaid rendered
env:
GADOPT_LOGLEVEL: WARN
- uses: actions/upload-artifact@v4
continue-on-error: true
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
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
steps:
- uses: actions/deploy-pages@v4