Skip to content

Commit 19fc4f7

Browse files
committed
1 parent 459ae30 commit 19fc4f7

File tree

4 files changed

+57
-47
lines changed

4 files changed

+57
-47
lines changed

.github/workflows/build.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: run notebooks
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- dev
8+
schedule:
9+
- cron: "30 2 * * 4" # every thursday on 2:30am UTC
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: ["3.11", "3.12", "3.13"]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Display Python version
28+
run: python -c "import sys; print(sys.version)"
29+
30+
- name: Install dependencies
31+
run: pip install jupyter nbconvert
32+
- run: pip install -r requirements.txt
33+
34+
- name: Find notebooks
35+
id: find-notebooks
36+
run: |
37+
find . -name "*.ipynb" > notebooks.txt
38+
cat notebooks.txt
39+
shell: bash
40+
41+
- name: Execute notebooks
42+
run: |
43+
cat notebooks.txt | while read -r notebook; do
44+
jupyter nbconvert --to notebook --ExecutePreprocessor.kernel_name=python3 --execute --inplace "$notebook"
45+
done
46+
continue-on-error: false
47+
shell: bash
48+
49+
- name: Check for errors
50+
run: |
51+
if grep "raise Exception(" *.ipynb; then
52+
echo "Error found in notebook(s)."
53+
exit 1
54+
else
55+
echo "No errors found in notebooks."
56+
fi
57+
shell: bash

.github/workflows/notebook_ci.yml

-42
This file was deleted.

ci/requirements_ci.txt

-5
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)