diff --git a/.github/workflows/crw.yml b/.github/workflows/crw.yml index 466b6c05d7..d971e3281b 100644 --- a/.github/workflows/crw.yml +++ b/.github/workflows/crw.yml @@ -52,13 +52,22 @@ jobs: - uses: step-security/dtolnay-rust-toolchain@v1.0.0 with: toolchain: stable - - name: Cache the CC0 sample files - uses: actions/cache@v6.1.0 + # Pull requests restore the entry main saved and never write their own: the same + # files saved once per pull request took a share of the 10 GB cache budget. + - name: Restore the CC0 sample files + id: samples + uses: actions/cache/restore@v6.1.0 with: path: ${{ runner.temp }}/crw-samples key: crw-samples-${{ hashFiles('crates/crw/tests/samples.json') }} - name: Fetch the pinned CC0 sample files (raw.pixls.us) run: python scripts/fetch-crw-samples.py "$RUNNER_TEMP/crw-samples" + - name: Save the CC0 sample files + if: github.event_name != 'pull_request' && steps.samples.outputs.cache-hit != 'true' + uses: actions/cache/save@v6.1.0 + with: + path: ${{ runner.temp }}/crw-samples + key: ${{ steps.samples.outputs.cache-primary-key }} - run: cargo test -p craft-crw --release --locked --test samples -- --nocapture env: CRAFT_CRW_SAMPLES: ${{ runner.temp }}/crw-samples diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index cfdac6be12..d87302bfe9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -35,8 +35,9 @@ jobs: # Pull requests run the Workspace gate's Linux legs only, and pushes to next cancel each other's # runs, so this starts one Workspace run on next a day that nothing cancels: next's macOS and - # Windows legs then run in full at least once a day. Main gets the same from workspace.yml's own - # scheduled runs. The only job here with `actions: write`; it checks out and runs nothing from + # Windows legs then run in full at least once a day, and its Linux leg builds from source and + # saves next's own workspace-crates cache entry, which pull requests into next restore. Main gets + # the same from workspace.yml's own scheduled runs. The only job here with `actions: write`; it checks out and runs nothing from # the repository. workspace-next: name: Workspace on next