Skip to content

Commit b52770a

Browse files
EliShteinmanclaude
andcommitted
fix(ci): cache data/examples.json with examples/ + correct hash key
Two related bugs found in the first matrix-parallel run: 1. `make components` (build/make.py) writes to data/examples.json, not into examples/. My cache path was only `examples`, so on cache hit data/examples.json was missing — Hugo failed in the jupyter-example shortcode with: ERROR jupyter-example: Example 'landing' not found for language 'Python' in examples.json. Run 'python3 build/local_examples.py' to generate data. 2. Cache key used data/components_local/index.json, but `make components` (without --stack flag) reads the default data/components/index.json. Wrong file would have meant the cache never invalidated when the component stack changed. Fix: include both paths in cache and key off the correct stack file: path: | examples data/examples.json key: components-${{ runner.os }}-${{ hashFiles('Makefile', 'build/**', 'data/components/index.json') }} Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e333b83 commit b52770a

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/airgap-build.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,14 @@ jobs:
248248
python3 -m venv ./venv
249249
./venv/bin/pip install --quiet -r requirements.txt
250250
251-
- name: Restore examples
251+
- name: Restore examples + data/examples.json
252252
id: cache-examples
253253
uses: actions/cache@v4
254254
with:
255-
path: examples
256-
key: components-${{ runner.os }}-${{ hashFiles('Makefile', 'build/**', 'data/components_local/index.json') }}
255+
path: |
256+
examples
257+
data/examples.json
258+
key: components-${{ runner.os }}-${{ hashFiles('Makefile', 'build/**', 'data/components/index.json') }}
257259

258260
- name: make components (cache miss)
259261
if: steps.cache-examples.outputs.cache-hit != 'true'
@@ -410,12 +412,14 @@ jobs:
410412
python3 -m venv ./venv
411413
./venv/bin/pip install --quiet -r requirements.txt
412414
413-
- name: Restore examples
415+
- name: Restore examples + data/examples.json
414416
id: cache-examples
415417
uses: actions/cache@v4
416418
with:
417-
path: examples
418-
key: components-${{ runner.os }}-${{ hashFiles('Makefile', 'build/**', 'data/components_local/index.json') }}
419+
path: |
420+
examples
421+
data/examples.json
422+
key: components-${{ runner.os }}-${{ hashFiles('Makefile', 'build/**', 'data/components/index.json') }}
419423

420424
- name: make components (cache miss)
421425
if: steps.cache-examples.outputs.cache-hit != 'true'

0 commit comments

Comments
 (0)