Skip to content

armgit / Pake

Public Imported from GitHub
0

Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.

ci: stop non-building jobs from owning the Rust cache and gate cargo test

Tw9384f74e212f19
diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml
index b2d54cfa..56f8bce8 100644
--- a/.github/actions/setup-env/action.yml
+++ b/.github/actions/setup-env/action.yml
@@ -10,6 +10,13 @@ inputs:
- rust: Rust only (toolchain + targets)
required: false
default: "build"
+ rust-cache-save:
+ description: |
+ Whether this job may save the shared Rust cache. Jobs that do not compile
+ the Tauri app must pass "false": the first save wins the key, and a
+ target without compiled artifacts would be restored as a full match.
+ required: false
+ default: "true"
outputs:
setup-complete:
@@ -146,21 +153,12 @@ runs:
echo $wixPath >> $env:GITHUB_PATH
}
- # Build optimizations (caching)
- - name: Setup sccache
- if: inputs.mode == 'build'
- uses: mozilla-actions/[email protected]
-
- - name: Enable sccache
- if: inputs.mode == 'build'
- shell: bash
- run: |
- echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
- echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
-
+ # Build optimizations (caching). No sccache: its per-crate cache entries hit
+ # GitHub's cache rate limit (HTTP 429) when a release starts 48 jobs at once.
- name: Setup Rust cache
if: inputs.mode == 'build'
uses: swatinem/rust-cache@v2
with:
workspaces: "src-tauri -> target"
- shared-key: "pake-${{ runner.os }}"
+ shared-key: "pake-build-${{ runner.os }}"
+ save-if: ${{ inputs.rust-cache-save == 'true' }}
diff --git a/.github/workflows/quality-and-test.yml b/.github/workflows/quality-and-test.yml
index ff25e156..9ce711ad 100644
--- a/.github/workflows/quality-and-test.yml
+++ b/.github/workflows/quality-and-test.yml
@@ -72,6 +72,7 @@ jobs:
uses: ./.github/actions/setup-env
with:
mode: build
+ rust-cache-save: false
- name: Install Rust components
shell: bash
@@ -90,6 +91,9 @@ jobs:
- name: Run Clippy lints
run: cargo hack --feature-powerset --exclude-features cli-build --no-dev-deps clippy # cspell:disable-line
+ - name: Run Rust unit tests
+ run: cargo test --lib
+
# Fast lane: runs on every PR and push. Skips the heavy real Tauri build
# (kept under tests/index.js) but still covers Vitest + integration suites
# so feedback stays under ~5 minutes per OS instead of 20+.
@@ -108,6 +112,7 @@ jobs:
uses: ./.github/actions/setup-env
with:
mode: build
+ rust-cache-save: false
- name: Build CLI
run: pnpm run cli:build