Skip to content

Commit 939456a

Browse files
committed
CI: adding caching for notebooks
1 parent bd4b1d7 commit 939456a

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

.circleci/config.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,38 @@ jobs:
77
- image: cimg/python:3.12
88

99
steps:
10+
- attach_workspace:
11+
at: ~/
12+
1013
- checkout
1114

1215
- run:
1316
name: Install CI dependencies
1417
command: python -m pip install --upgrade tox
1518

19+
- restore_cache:
20+
keys:
21+
- jupyter
22+
1623
- run:
1724
name: Build HTML rendering of notebooks
1825
no_output_timeout: 30m
1926
command: |
2027
python -m tox -e py312-buildhtml
2128
29+
- save_cache:
30+
key: jupyter
31+
paths:
32+
- ~/_build/.jupyter_cache
33+
2234
- store_artifacts:
2335
path: _build/html
2436

37+
- persist_to_workspace:
38+
root: _build
39+
paths:
40+
- html
41+
2542
workflows:
2643
version: 2
2744
default:

conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# -- Project information -----------------------------------------------------
1616

1717
project = 'Caltech/IPAC--IRSA Demo Notebooks'
18-
copyright = '2022-2024, IRSA developers'
18+
copyright = '2022-2025, IRSA developers'
1919
author = 'IRSA developers'
2020

2121

@@ -44,6 +44,7 @@
4444
# MyST-NB configuration
4545
nb_execution_timeout = 1200
4646
nb_merge_streams = True
47+
nb_execution_mode = "cache"
4748

4849
nb_execution_excludepatterns = []
4950

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ commands =
5656
!buildhtml: bash -c 'if [[ $GITHUB_EVENT_NAME == pull_request && -z "$(grep force_run:all_tests ${GITHUB_EVENT_PATH})" ]]; then git fetch origin main --depth=1; git diff origin/main --name-only tutorials | grep .md; else find tutorials -name "*.md"; fi | grep -vf ignore_testing | xargs jupytext --to notebook '
5757

5858
!buildhtml: pytest --nbval-lax -vv --suppress-no-test-exit-code --durations=10 tutorials
59-
buildhtml: sphinx-build -b html . _build/html -D nb_execution_mode=auto -nWT --keep-going
59+
buildhtml: sphinx-build -b html . _build/html -nWT --keep-going
6060
# SED magic to remove the toctree captions from the rendered index page while keeping them in the sidebar TOC
6161
buildhtml: sed -E -i.bak '/caption-text/{N; s/.+caption-text.+\n<ul>/<ul>/; P;D;}' _build/html/index.html
6262
buildhtml: bash -c 'rm _build/html/index.html.bak'

0 commit comments

Comments
 (0)