Skip to content

Commit 8eb56e5

Browse files
authored
Merge branch 'main' into feat/release-ready-signal
2 parents 86b39dc + b57b7ef commit 8eb56e5

3 files changed

Lines changed: 44 additions & 2 deletions

File tree

.github/workflows/chaos.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ on:
3838

3939
concurrency:
4040
group: ${{ github.workflow }}-${{ github.ref }}
41-
cancel-in-progress: true
41+
# Cancel only superseded PR runs. Never cancel a push to main (warms the shared
42+
# rust-cache) or a `v*` tag push (the release-gate 3-OS run). Matches ci.yml /
43+
# coverage.yml.
44+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
4245

4346
env:
4447
CARGO_TERM_COLOR: always
@@ -70,6 +73,12 @@ jobs:
7073
sudo apt-get install -y libwebkit2gtk-4.1-dev libxdo-dev libssl-dev \
7174
libayatana-appindicator3-dev librsvg2-dev libsoup-3.0-dev javascriptcoregtk-4.1
7275
- uses: Swatinem/rust-cache@v2
76+
with:
77+
# Same dependency cache as ci.yml's rust-test (per-OS). chaos builds a
78+
# subset of the workspace, so it reuses the rust-test-warmed cache.
79+
shared-key: "workspace"
80+
# Restore-only on PRs; only main (and not `v*` tags) writes the cache.
81+
save-if: ${{ github.ref == 'refs/heads/main' }}
7382
# run-all capability-gates every scenario: on a stock non-elevated runner
7483
# the admin / real-Drive rows SKIP (recorded, never red); the rest run
7584
# against the headless core + InMemoryRemoteStore.
@@ -98,6 +107,9 @@ jobs:
98107
sudo apt-get install -y libwebkit2gtk-4.1-dev libxdo-dev libssl-dev \
99108
libayatana-appindicator3-dev librsvg2-dev libsoup-3.0-dev javascriptcoregtk-4.1
100109
- uses: Swatinem/rust-cache@v2
110+
with:
111+
shared-key: "workspace"
112+
save-if: ${{ github.ref == 'refs/heads/main' }}
101113
- name: chaos run-all (fault-injection)
102114
run: cargo run -p driven-chaos -- run-all --fault-injection
103115

@@ -131,6 +143,12 @@ jobs:
131143
sudo apt-get update
132144
sudo apt-get install -y libssl-dev
133145
- uses: Swatinem/rust-cache@v2
146+
with:
147+
# Builds driven-drive's test target - a subset of the workspace - so it
148+
# restores the same per-OS `workspace` cache. This job only runs on `v*`
149+
# tags (save-if false there), so it is purely restore-only.
150+
shared-key: "workspace"
151+
save-if: ${{ github.ref == 'refs/heads/main' }}
134152
# Real Drive round-trip against a throwaway UUID folder under the dest
135153
# folder. Gate-skips cleanly (Ok, never red) when the creds are absent.
136154
- name: real-drive e2e (google_e2e)

.github/workflows/ci.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ on:
88

99
concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}
11-
cancel-in-progress: true
11+
# Only cancel a SUPERSEDED PR run (newer commit on the same PR). NEVER cancel a
12+
# push-to-main run: main is the ONLY branch that writes the shared rust-cache
13+
# (see save-if below), so a cancelled main run leaves the cache cold/stale and
14+
# every later PR pays a full rebuild. Matches coverage.yml's reasoning.
15+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1216

1317
env:
1418
CARGO_TERM_COLOR: always
@@ -46,6 +50,18 @@ jobs:
4650
sudo apt-get install -y libwebkit2gtk-4.1-dev libxdo-dev libssl-dev \
4751
libayatana-appindicator3-dev librsvg2-dev libsoup-3.0-dev javascriptcoregtk-4.1
4852
- uses: Swatinem/rust-cache@v2
53+
with:
54+
# Share ONE dependency cache (per-OS) across the jobs that compile the
55+
# workspace in the normal dev profile: this rust-test job plus the two
56+
# chaos jobs. `--workspace --all-targets` here is the superset build, so
57+
# whichever runs first on main warms a cache the others reuse, instead of
58+
# each job hoarding its own ~0.8 GiB copy.
59+
shared-key: "workspace"
60+
# Only `main` writes caches; PRs are restore-only. A PR-event cache is
61+
# scoped to that PR's ref and can't be read by main or other PRs, so
62+
# saving it just burns the repo cache budget and evicts the reusable
63+
# main caches. PRs still RESTORE the main cache normally.
64+
save-if: ${{ github.ref == 'refs/heads/main' }}
4965
- name: cargo build (compile-only)
5066
run: cargo build --workspace --all-targets
5167
- name: cargo clippy
@@ -113,6 +129,8 @@ jobs:
113129
- uses: Swatinem/rust-cache@v2
114130
with:
115131
prefix-key: "v1-rust"
132+
# Restore-only on PRs; only main warms this cache (see rust-test above).
133+
save-if: ${{ github.ref == 'refs/heads/main' }}
116134
- name: pnpm install
117135
working-directory: ui
118136
run: pnpm install --frozen-lockfile

.github/workflows/coverage.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ jobs:
6464
with: { components: llvm-tools-preview }
6565
- uses: taiki-e/install-action@v2
6666
with: { tool: cargo-llvm-cov }
67+
# This is an instrumented (coverage) build with its own RUSTFLAGS, so it
68+
# gets its own cache key and deliberately does NOT share the `workspace`
69+
# key. Restore-only on PRs; only main writes it (main coverage runs never
70+
# cancel, so the cache stays warm).
6771
- uses: Swatinem/rust-cache@v2
72+
with:
73+
save-if: ${{ github.ref == 'refs/heads/main' }}
6874

6975
- uses: pnpm/action-setup@v4
7076
with: { version: 10 }

0 commit comments

Comments
 (0)