Skip to content

Commit a45f3f7

Browse files
committed
Cache transforms sandbox in CI
Restore the .transforms-sandbox directory from cache before postprocessing and save it afterwards. This avoids re-running pip/npm install from scratch on every workflow run when dependencies haven't changed. Uses a per-run key with a fallback restore key keyed to the OS, so a warm cache is always preferred over a cold start.
1 parent 3be2f7f commit a45f3f7

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

.github/workflows/validate-and-process.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,13 @@ jobs:
201201
202202
echo "Repositories cloned and mapped in $RANDOM_DIR — output saved to $MAPPINGS_YML"
203203
204+
- name: Restore transforms sandbox cache
205+
uses: actions/cache/restore@v4
206+
with:
207+
path: .transforms-sandbox
208+
key: transforms-sandbox-${{ runner.os }}-${{ github.run_id }}
209+
restore-keys: |
210+
transforms-sandbox-${{ runner.os }}-
204211
- name: Before postprocess
205212
if: ${{inputs.before_postprocess}}
206213
run: ${{inputs.before_postprocess}}
@@ -233,6 +240,12 @@ jobs:
233240
uses: EndBug/add-and-commit@v9
234241
with:
235242
message: Building blocks postprocessing
243+
- name: Save transforms sandbox cache
244+
if: ${{ !inputs.skip-build }}
245+
uses: actions/cache/save@v4
246+
with:
247+
path: .transforms-sandbox
248+
key: transforms-sandbox-${{ runner.os }}-${{ github.run_id }}
236249
- name: Remove build artifacts from pages
237250
run: |
238251
sudo find "${{ inputs.annotated_path }}" -name _visited_properties.tsv -delete || true

0 commit comments

Comments
 (0)