File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Run Tutorials
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+ workflow_dispatch :
9+
10+ jobs :
11+ run-tutorials :
12+ runs-on : ubuntu-latest
13+ timeout-minutes : 30
14+
15+ steps :
16+ - name : Checkout tutorials repo
17+ uses : actions/checkout@v4
18+
19+ - name : Clone MEmilio repository
20+ run : git clone --depth 1 https://github.com/SciCompMod/memilio.git memilio
21+
22+ - name : Install uv
23+ uses : astral-sh/setup-uv@v4
24+
25+ - name : Set up Python
26+ run : uv python install 3.12
27+
28+ - name : Install system dependencies
29+ run : |
30+ sudo apt-get update
31+ sudo apt-get install -y cmake ninja-build
32+
33+ - name : Install memilio-simulation and Python packages
34+ run : |
35+ uv venv
36+ # Install memilio-simulation from the cloned repo (C++ extension, needs cmake/ninja)
37+ uv add --dev ./memilio/pycode/memilio-simulation
38+ # Install tutorial dependencies
39+ uv add marimo matplotlib pandas numpy pyabc[pyarrow] bayesflow tensorflow nbformat
40+
41+ - name : Run tutorials and export to HTML
42+ run : |
43+ mkdir -p html_output
44+ failed=""
45+ for notebook in tutorial*.py; do
46+ name=$(basename "${notebook%.py}")
47+ echo "::group::Running $notebook"
48+ if uv run marimo export html "$notebook" -o "html_output/${name}.html"; then
49+ echo "OK: $notebook"
50+ else
51+ echo "::error::FAILED: $notebook"
52+ failed="$failed $notebook"
53+ fi
54+ echo "::endgroup::"
55+ done
56+ if [ -n "$failed" ]; then
57+ echo "The following notebooks failed:$failed"
58+ exit 1
59+ fi
60+
61+ - name : Upload HTML artifacts
62+ if : success()
63+ uses : actions/upload-artifact@v4
64+ with :
65+ name : tutorial-html
66+ path : html_output/
67+ retention-days : 30
You can’t perform that action at this time.
0 commit comments