Skip to content

Commit 55d5b47

Browse files
authored
Update notebooks.yml
1 parent 0bf23b6 commit 55d5b47

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

.github/workflows/notebooks.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,23 @@ jobs:
5252
numpy pandas tqdm plotly==5.18.0 corner ripser persim \
5353
nbconvert nbclient ipykernel nest_asyncio
5454
55-
- name: Clear Python cache
56-
run: rm -rf __pycache__ */__pycache__ */*/__pycache__
55+
- name: Cache heavy data
56+
uses: actions/cache@v4
57+
with:
58+
path: |
59+
data/ecdata
60+
data/raw
61+
data/processed
62+
examples/exports
63+
key: notebook-cache-${{ hashFiles('data/**', 'examples/**') }}
64+
restore-keys: notebook-cache-
5765

5866
- name: Execute Notebooks Sequentially + Commit After Each
5967
run: |
68+
69+
# Set correct working directory inside container
70+
cd /__w/S.T.A.R.-Program/S.T.A.R.-Program
71+
6072
mkdir -p examples/exports results
6173
6274
echo "=== Starting sequential notebook execution ==="
@@ -70,7 +82,7 @@ jobs:
7082
echo "========================================"
7183
7284
# Execute notebook
73-
timeout 120000s sage -python -m jupyter nbconvert \
85+
sage -python -m jupyter nbconvert \
7486
--to notebook \
7587
--execute "$nb" \
7688
--output "$output" \
@@ -79,7 +91,7 @@ jobs:
7991
echo " $nb failed or timed out — continuing"
8092
8193
# Memory clear
82-
echo "Clearing memory before next notebook..."
94+
echo "Clearing memory..."
8395
sage -python -c "
8496
import gc
8597
gc.collect()
@@ -98,16 +110,12 @@ jobs:
98110
else
99111
git commit -m "ci: update executed notebook ${base} [skip ci]" || true
100112
git push || echo "Push skipped (may need permissions)"
101-
echo " Committed $base"
113+
echo "Committed $base"
102114
fi
103115
done
104116
105117
echo "=== All notebooks processed ==="
106118
107-
env:
108-
JUPYTER_ENABLE_LAB: "yes"
109-
PYTHONUNBUFFERED: "1"
110-
111119
- name: Upload Artifacts
112120
uses: actions/upload-artifact@v4
113121
with:

0 commit comments

Comments
 (0)