-
Notifications
You must be signed in to change notification settings - Fork 5
74 lines (63 loc) · 2.11 KB
/
test.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
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@v3
- name: Load pyrol wheel from cache
uses: actions/cache/restore@v3
id: cache-pyrol
with:
path: /tmp/wheels
key: pyrol
- name: Build pyrol wheel
if: steps.cache-pyrol.outputs.cache-hit != 'true'
run: |
/home/firedrake/firedrake/bin/pip wheel git+https://github.com/angus-g/[email protected] -w /tmp/wheels
- name: Save pyrol to cache
if: steps.cache-pyrol.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: /tmp/wheels
key: pyrol
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y libgl1-mesa-glx xvfb
. /home/firedrake/firedrake/bin/activate
python3 -m pip install --no-index -f /tmp/wheels pyroltrilinos
python3 -m pip install nbval pyvista
python3 -m pip install git+https://github.com/g-adopt/g-adopt@gadopt-restructure
- 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 *.ipynb
- name: Build Jupyter Book
run: |
. /home/firedrake/firedrake/bin/activate
python3 -m pip install jupyter-book
for f in *.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