mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-27 17:57:06 +00:00
CI: CRW sample files are saved once, not once per pull request
crw.yml saved the same 78 MB of sample files once per pull request (17 copies today, 1.3 GB of the 10 GB cache budget); pull requests now restore the branch entry and never save.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user