-
Notifications
You must be signed in to change notification settings - Fork 78
58 lines (49 loc) · 1.38 KB
/
test-notebooks.yml
File metadata and controls
58 lines (49 loc) · 1.38 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
name: Test Notebooks
on:
push:
branches: [ master ]
pull_request:
branches: [ '*' ]
schedule:
- cron: "0 5 * * TUE"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
notebooks:
name: Test documentation notebooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install package and dependencies
run: |
python -m pip install uv
uv pip install --system -e ".[docs]"
- name: Execute notebooks
run: |
EXIT_CODE=0
for notebook in examples/*.ipynb; do
name=$(basename "$notebook")
# Skip notebooks that require credentials or special setup
case "$name" in
solve-on-oetc.ipynb|solve-on-remote.ipynb)
echo "Skipping $name (requires credentials or special setup)"
continue
;;
esac
echo "::group::Running $name"
if jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=600 "$notebook"; then
echo "✓ $name passed"
else
echo "::error::✗ $name failed"
EXIT_CODE=1
fi
echo "::endgroup::"
done
exit $EXIT_CODE