-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (57 loc) · 1.87 KB
/
run-tutorials.yml
File metadata and controls
67 lines (57 loc) · 1.87 KB
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
name: Run Tutorials
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
run-tutorials:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout tutorials repo
uses: actions/checkout@v4
- name: Clone MEmilio repository
run: git clone --depth 1 https://github.com/SciCompMod/memilio.git memilio
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python
run: uv python install 3.12
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build
- name: Install memilio-simulation and Python packages
run: |
uv init
# Install memilio-simulation from the cloned repo (C++ extension, needs cmake/ninja)
uv add --dev ./memilio/pycode/memilio-simulation
# Install tutorial dependencies
uv add marimo matplotlib pandas numpy pyabc[pyarrow] bayesflow tensorflow nbformat
- name: Run tutorials and export to HTML
run: |
mkdir -p html_output
failed=""
for notebook in tutorial*.py; do
name=$(basename "${notebook%.py}")
echo "::group::Running $notebook"
if uv run marimo export html "$notebook" -o "html_output/${name}.html"; then
echo "OK: $notebook"
else
echo "::error::FAILED: $notebook"
failed="$failed $notebook"
fi
echo "::endgroup::"
done
if [ -n "$failed" ]; then
echo "The following notebooks failed:$failed"
exit 1
fi
- name: Upload HTML artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: tutorial-html
path: html_output/
retention-days: 30