diff --git a/.gitea/workflows/build-and-test.yml b/.gitea/workflows/build-and-test.yml index 2645848d..996fee72 100644 --- a/.gitea/workflows/build-and-test.yml +++ b/.gitea/workflows/build-and-test.yml @@ -13,6 +13,10 @@ on: - '**/*.md' workflow_dispatch: +env: + # Incremental state is never reused between CI runs -- pure disk cost. + CARGO_INCREMENTAL: 0 + jobs: test: name: Run Tests @@ -33,13 +37,22 @@ jobs: - name: Cache Rust dependencies uses: actions/cache@v3 with: + # Registry only -- never src-tauri/target. That directory is ~16 GB and + # was cached under five separate keys, which filled the runner's 74 GB + # disk at ~1.15 GB/day (23 GB in 20 days, measured Aug 2026). + # registry/src is omitted too: cargo re-extracts it for free from + # registry/cache (155 MB of .crate tarballs vs 1.1 GB extracted). path: | - ~/.cargo/registry - ~/.cargo/git - src-tauri/target - key: ${{ runner.os }}-cargo-host-${{ hashFiles('**/Cargo.lock') }} + ~/.cargo/registry/index + ~/.cargo/registry/cache + ~/.cargo/git/db + # One shared key across every job. The old per-job keys existed to stop + # debug/release target artifacts clobbering each other; with target no + # longer cached, registry contents are target-independent, so all jobs + # want the same crates. First job to finish saves; the rest restore. + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo-host- + ${{ runner.os }}-cargo-registry- - name: Cache Node dependencies uses: actions/cache@v3 @@ -129,13 +142,22 @@ jobs: - name: Cache Rust dependencies uses: actions/cache@v3 with: + # Registry only -- never src-tauri/target. That directory is ~16 GB and + # was cached under five separate keys, which filled the runner's 74 GB + # disk at ~1.15 GB/day (23 GB in 20 days, measured Aug 2026). + # registry/src is omitted too: cargo re-extracts it for free from + # registry/cache (155 MB of .crate tarballs vs 1.1 GB extracted). path: | - ~/.cargo/registry - ~/.cargo/git - src-tauri/target - key: ${{ runner.os }}-cargo-android-${{ hashFiles('**/Cargo.lock') }} + ~/.cargo/registry/index + ~/.cargo/registry/cache + ~/.cargo/git/db + # One shared key across every job. The old per-job keys existed to stop + # debug/release target artifacts clobbering each other; with target no + # longer cached, registry contents are target-independent, so all jobs + # want the same crates. First job to finish saves; the rest restore. + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo-android- + ${{ runner.os }}-cargo-registry- - name: Cache Node dependencies uses: actions/cache@v3 diff --git a/.gitea/workflows/build-release.yml b/.gitea/workflows/build-release.yml index 151b4910..ab306152 100644 --- a/.gitea/workflows/build-release.yml +++ b/.gitea/workflows/build-release.yml @@ -13,6 +13,8 @@ on: env: RUST_BACKTRACE: 1 CARGO_TERM_COLOR: always + # Incremental state is never reused between CI runs -- pure disk cost. + CARGO_INCREMENTAL: 0 jobs: test: @@ -27,13 +29,22 @@ jobs: - name: Cache Rust dependencies uses: actions/cache@v3 with: + # Registry only -- never src-tauri/target. That directory is ~16 GB and + # was cached under five separate keys, which filled the runner's 74 GB + # disk at ~1.15 GB/day (23 GB in 20 days, measured Aug 2026). + # registry/src is omitted too: cargo re-extracts it for free from + # registry/cache (155 MB of .crate tarballs vs 1.1 GB extracted). path: | - ~/.cargo/registry - ~/.cargo/git - src-tauri/target - key: ${{ runner.os }}-cargo-host-${{ hashFiles('**/Cargo.lock') }} + ~/.cargo/registry/index + ~/.cargo/registry/cache + ~/.cargo/git/db + # One shared key across every job. The old per-job keys existed to stop + # debug/release target artifacts clobbering each other; with target no + # longer cached, registry contents are target-independent, so all jobs + # want the same crates. First job to finish saves; the rest restore. + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo-host- + ${{ runner.os }}-cargo-registry- - name: Cache Node dependencies uses: actions/cache@v3 @@ -88,21 +99,25 @@ 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: + # Registry only -- never src-tauri/target. That directory is ~16 GB and + # was cached under five separate keys, which filled the runner's 74 GB + # disk at ~1.15 GB/day (23 GB in 20 days, measured Aug 2026). + # registry/src is omitted too: cargo re-extracts it for free from + # registry/cache (155 MB of .crate tarballs vs 1.1 GB extracted). path: | - ~/.cargo/registry - ~/.cargo/git - src-tauri/target - key: ${{ runner.os }}-cargo-linux-release-${{ hashFiles('**/Cargo.lock') }} + ~/.cargo/registry/index + ~/.cargo/registry/cache + ~/.cargo/git/db + # One shared key across every job. The old per-job keys existed to stop + # debug/release target artifacts clobbering each other; with target no + # longer cached, registry contents are target-independent, so all jobs + # want the same crates. First job to finish saves; the rest restore. + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo-linux-release- + ${{ runner.os }}-cargo-registry- - name: Cache Node dependencies uses: actions/cache@v3 @@ -160,7 +175,7 @@ jobs: with: name: jellytau-linux path: dist/linux/ - retention-days: 30 + retention-days: 7 build-windows: name: Build Windows @@ -178,14 +193,31 @@ jobs: - name: Cache Rust dependencies uses: actions/cache@v3 with: + # Registry only -- never src-tauri/target. That directory is ~16 GB and + # was cached under five separate keys, which filled the runner's 74 GB + # disk at ~1.15 GB/day (23 GB in 20 days, measured Aug 2026). + # registry/src is omitted too: cargo re-extracts it for free from + # registry/cache (155 MB of .crate tarballs vs 1.1 GB extracted). path: | - ~/.cargo/registry - ~/.cargo/git - ~/.cache/cargo-xwin - src-tauri/target - key: ${{ runner.os }}-cargo-windows-${{ hashFiles('**/Cargo.lock') }} + ~/.cargo/registry/index + ~/.cargo/registry/cache + ~/.cargo/git/db + # One shared key across every job. The old per-job keys existed to stop + # debug/release target artifacts clobbering each other; with target no + # longer cached, registry contents are target-independent, so all jobs + # want the same crates. First job to finish saves; the rest restore. + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo-windows- + ${{ runner.os }}-cargo-registry- + + - name: Cache Windows CRT/SDK (cargo-xwin) + uses: actions/cache@v3 + with: + path: ~/.cache/cargo-xwin + # Contents track the xwin version baked into the builder image, not our + # lockfile -- keying this on Cargo.lock re-downloaded the whole SDK on + # every release bump. Bump the suffix by hand if the image's xwin moves. + key: ${{ runner.os }}-cargo-xwin-v1 - name: Cache Node dependencies uses: actions/cache@v3 @@ -216,7 +248,7 @@ jobs: with: name: jellytau-windows path: dist/windows/ - retention-days: 30 + retention-days: 7 build-android: name: Build Android @@ -235,17 +267,22 @@ jobs: - name: Cache Rust dependencies uses: actions/cache@v3 with: + # Registry only -- never src-tauri/target. That directory is ~16 GB and + # was cached under five separate keys, which filled the runner's 74 GB + # disk at ~1.15 GB/day (23 GB in 20 days, measured Aug 2026). + # registry/src is omitted too: cargo re-extracts it for free from + # registry/cache (155 MB of .crate tarballs vs 1.1 GB extracted). path: | - ~/.cargo/registry - ~/.cargo/git - src-tauri/target - # `-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') }} + ~/.cargo/registry/index + ~/.cargo/registry/cache + ~/.cargo/git/db + # One shared key across every job. The old per-job keys existed to stop + # debug/release target artifacts clobbering each other; with target no + # longer cached, registry contents are target-independent, so all jobs + # want the same crates. First job to finish saves; the rest restore. + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo-android-release- + ${{ runner.os }}-cargo-registry- - name: Cache Node dependencies uses: actions/cache@v3 @@ -309,7 +346,7 @@ jobs: with: name: jellytau-android path: dist/android/ - retention-days: 30 + retention-days: 7 create-release: name: Create Release