From 51d914777a06a92dd9c2bab44ece640098d02c5a Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Wed, 19 Aug 2026 22:00:19 +0200 Subject: [PATCH] ci: fix cache-key collisions and skip duplicate release-commit test run The test job and build-linux shared one cargo cache key; the test job's debug artifacts claimed it first and actions/cache skips saving on an exact-key hit, so Linux release builds compiled cold every time (~31min vs ~9min for the correctly-keyed Windows job). Same collision between android-check and build-android. Give the release jobs their own keys. Also skip build-and-test.yml for chore(release) commits: the tag push triggers build-release.yml on the same commit, which runs the identical test suite, and the two ~1h workflows contended for the single runner slot. --- .gitea/workflows/build-and-test.yml | 6 ++++++ .gitea/workflows/build-release.yml | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/build-and-test.yml b/.gitea/workflows/build-and-test.yml index 7e2876b7..d249607b 100644 --- a/.gitea/workflows/build-and-test.yml +++ b/.gitea/workflows/build-and-test.yml @@ -16,6 +16,12 @@ on: jobs: test: name: Run Tests + # A release push triggers build-release.yml on the tag, which runs this exact + # test suite itself — and on a single-slot runner the two ~1h workflows would + # otherwise serialize/contend. Skip the duplicate for chore(release) commits. + # (head_commit is absent on pull_request/workflow_dispatch; startsWith(null,…) + # is false there, so those events still run.) + if: "!startsWith(github.event.head_commit.message, 'chore(release)')" runs-on: linux/amd64 container: image: gitea.tourolle.paris/dtourolle/jellytau-builder:latest diff --git a/.gitea/workflows/build-release.yml b/.gitea/workflows/build-release.yml index 5cde4636..4daf2e13 100644 --- a/.gitea/workflows/build-release.yml +++ b/.gitea/workflows/build-release.yml @@ -88,6 +88,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + # ⚠️ Key must NOT collide with the test job's `cargo-host` key: the test + # job runs first and saves debug/clippy artifacts under its key, and + # actions/cache skips saving on an exact-key hit — so a shared key meant + # this job's *release* artifacts were never cached and every Linux release + # build compiled cold (~31min vs ~9min for the correctly-keyed Windows job). - name: Cache Rust dependencies uses: actions/cache@v3 with: @@ -95,9 +100,9 @@ jobs: ~/.cargo/registry ~/.cargo/git src-tauri/target - key: ${{ runner.os }}-cargo-host-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-linux-release-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo-host- + ${{ runner.os }}-cargo-linux-release- - name: Cache Node dependencies uses: actions/cache@v3 @@ -220,9 +225,13 @@ jobs: ~/.cargo/registry ~/.cargo/git src-tauri/target - key: ${{ runner.os }}-cargo-android-${{ hashFiles('**/Cargo.lock') }} + # `-release` suffix keeps this distinct from build-and-test.yml's + # android-check key, whose `cargo check` artifacts would otherwise + # claim the key first and block this job's release cache from ever + # being saved (same collision as the Linux job above). + key: ${{ runner.os }}-cargo-android-release-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo-android- + ${{ runner.os }}-cargo-android-release- - name: Cache Node dependencies uses: actions/cache@v3