From 5712ffa6cff3d7cc9b31d10fb35aad10ac747881 Mon Sep 17 00:00:00 2001 From: Igor Unanua Date: Mon, 2 Mar 2026 15:08:24 +0100 Subject: [PATCH 1/3] Use a shared cache --- .github/workflows/coverage.yml | 2 ++ .github/workflows/fuzz.yml | 2 ++ .github/workflows/lint.yml | 4 ++++ .github/workflows/miri.yml | 2 ++ .github/workflows/pr-metadata-docs-and-deps.yml | 4 ++++ .github/workflows/pr-title-semver-check.yml | 2 ++ .github/workflows/release-proposal-dispatch.yml | 2 ++ .github/workflows/test.yml | 8 ++++++++ .github/workflows/verify-proto-files.yml | 2 ++ 9 files changed, 28 insertions(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index c37c9c663d..fdea9aa0ba 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -37,6 +37,8 @@ jobs: with: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory + shared-key: shared-${{ runner.os }} + # save-if: ${{ github.ref == 'refs/heads/main' }} - name: Generate code coverage (including doc tests) run: | cargo llvm-cov --all-features --workspace --no-report nextest diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index a44010700f..c57b7e8121 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -26,6 +26,8 @@ jobs: with: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory + shared-key: shared-${{ runner.os }} + # save-if: ${{ github.ref == 'refs/heads/main' }} - run: | set -e # cargo bolero list outputs {"package":"package-name","test":"test-name"} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b33af83d94..614155b137 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,6 +29,8 @@ jobs: with: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory + shared-key: shared-${{ runner.os }} + # save-if: ${{ github.ref == 'refs/heads/main' }} - run: cargo fmt --all -- --check clippy: name: "clippy #${{ matrix.platform }} ${{ matrix.rust_version }}" @@ -48,6 +50,8 @@ jobs: with: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory + shared-key: shared-${{ runner.os }} + # save-if: ${{ github.ref == 'refs/heads/main' }} - name: Run clippy on ${{ matrix.platform }} ${{ matrix.rust_version }} shell: bash run: | diff --git a/.github/workflows/miri.yml b/.github/workflows/miri.yml index ddb8bdbe69..5138f0075f 100644 --- a/.github/workflows/miri.yml +++ b/.github/workflows/miri.yml @@ -28,6 +28,8 @@ jobs: with: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory + shared-key: shared-${{ runner.os }} + # save-if: ${{ github.ref == 'refs/heads/main' }} - run: MIRIFLAGS="-Zmiri-disable-isolation" cargo miri nextest run --partition count:${{ matrix.partition }}/5 # We need to disable isolation because # "unsupported operation: `clock_gettime` with `REALTIME` clocks not available when isolation is enabled" diff --git a/.github/workflows/pr-metadata-docs-and-deps.yml b/.github/workflows/pr-metadata-docs-and-deps.yml index 0406c8658c..da350ef094 100644 --- a/.github/workflows/pr-metadata-docs-and-deps.yml +++ b/.github/workflows/pr-metadata-docs-and-deps.yml @@ -103,6 +103,8 @@ jobs: - uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1 with: cache-targets: true + shared-key: shared-${{ runner.os }} + # save-if: ${{ github.ref == 'refs/heads/main' }} - uses: dtolnay/rust-toolchain@stable - name: Check missing docs id: missing-docs @@ -274,6 +276,8 @@ jobs: - uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1 with: cache-targets: true + shared-key: shared-${{ runner.os }} + # save-if: ${{ github.ref == 'refs/heads/main' }} - uses: dtolnay/rust-toolchain@stable - uses: taiki-e/cache-cargo-install-action@7447f04c51f2ba27ca35e7f1e28fab848c5b3ba7 # 2.3.1 with: diff --git a/.github/workflows/pr-title-semver-check.yml b/.github/workflows/pr-title-semver-check.yml index 288f9dbfd7..48303dac26 100644 --- a/.github/workflows/pr-title-semver-check.yml +++ b/.github/workflows/pr-title-semver-check.yml @@ -99,6 +99,8 @@ jobs: uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # 2.8.1 with: cache-targets: true + shared-key: shared-${{ runner.os }} + # save-if: ${{ github.ref == 'refs/heads/main' }} - name: Install dependencies run: | diff --git a/.github/workflows/release-proposal-dispatch.yml b/.github/workflows/release-proposal-dispatch.yml index f69e238aa8..9f56b2c3d3 100644 --- a/.github/workflows/release-proposal-dispatch.yml +++ b/.github/workflows/release-proposal-dispatch.yml @@ -142,6 +142,8 @@ jobs: - uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1 with: cache-targets: true + shared-key: shared-${{ runner.os }} + # save-if: ${{ github.ref == 'refs/heads/main' }} - uses: dtolnay/rust-toolchain@nightly with: toolchain: nightly-2026-02-08 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 258cefff39..fa3b153404 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,11 +46,15 @@ jobs: uses: taiki-e/install-action@2c41309d51ede152b6f2ee6bf3b71e6dc9a8b7df # 2.49.27 with: tool: nextest@0.9.96 + # shared-key = one cache per (OS, lockfile, toolchain) shared across workflows + # save-if: main = only save on default branch to avoid filling GH cache with PR runs - name: Cache [rust] uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # 2.8.1 with: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory + shared-key: shared-${{ runner.os }} + # save-if: ${{ github.ref == 'refs/heads/main' }} - name: "Remove nextest CI report" shell: bash run: rm -rf target/nextest/ci/junit.xml @@ -189,6 +193,8 @@ jobs: with: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory + shared-key: shared-${{ runner.os }} + # save-if: ${{ github.ref == 'refs/heads/main' }} - name: "Generate profiling FFI" shell: bash env: @@ -302,6 +308,8 @@ jobs: with: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory + shared-key: shared-${{ runner.os }} + # save-if: ${{ github.ref == 'refs/heads/main' }} - run: cargo install cross || true - run: cross build --workspace --target x86_64-unknown-linux-gnu --exclude builder - run: cross test --workspace --features libdd-crashtracker/generate-unit-test-files --target x86_64-unknown-linux-gnu --exclude builder -- --skip "::single_threaded_tests::" --skip "tracing_integration_tests::" diff --git a/.github/workflows/verify-proto-files.yml b/.github/workflows/verify-proto-files.yml index 0e7b570bdc..57933ce04d 100644 --- a/.github/workflows/verify-proto-files.yml +++ b/.github/workflows/verify-proto-files.yml @@ -52,6 +52,8 @@ jobs: with: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory + shared-key: shared-${{ runner.os }} + # save-if: ${{ github.ref == 'refs/heads/main' }} - name: diff pb.rs working-directory: libdd-trace-protobuf run: | From 9af709c610d9f42d5b5c970d441ba163ced83be1 Mon Sep 17 00:00:00 2001 From: Igor Unanua Date: Tue, 3 Mar 2026 16:49:10 +0100 Subject: [PATCH 2/3] save-if main --- .github/workflows/coverage.yml | 2 +- .github/workflows/fuzz.yml | 2 +- .github/workflows/lint.yml | 4 ++-- .github/workflows/miri.yml | 2 +- .github/workflows/pr-metadata-docs-and-deps.yml | 4 ++-- .github/workflows/pr-title-semver-check.yml | 2 +- .github/workflows/release-proposal-dispatch.yml | 2 +- .github/workflows/test.yml | 6 +++--- .github/workflows/verify-proto-files.yml | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index fdea9aa0ba..ec8a92f321 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -38,7 +38,7 @@ jobs: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory shared-key: shared-${{ runner.os }} - # save-if: ${{ github.ref == 'refs/heads/main' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Generate code coverage (including doc tests) run: | cargo llvm-cov --all-features --workspace --no-report nextest diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index c57b7e8121..40c323f6c4 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -27,7 +27,7 @@ jobs: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory shared-key: shared-${{ runner.os }} - # save-if: ${{ github.ref == 'refs/heads/main' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - run: | set -e # cargo bolero list outputs {"package":"package-name","test":"test-name"} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 614155b137..f72ac1c29f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -30,7 +30,7 @@ jobs: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory shared-key: shared-${{ runner.os }} - # save-if: ${{ github.ref == 'refs/heads/main' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - run: cargo fmt --all -- --check clippy: name: "clippy #${{ matrix.platform }} ${{ matrix.rust_version }}" @@ -51,7 +51,7 @@ jobs: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory shared-key: shared-${{ runner.os }} - # save-if: ${{ github.ref == 'refs/heads/main' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Run clippy on ${{ matrix.platform }} ${{ matrix.rust_version }} shell: bash run: | diff --git a/.github/workflows/miri.yml b/.github/workflows/miri.yml index 5138f0075f..0cd706b3b3 100644 --- a/.github/workflows/miri.yml +++ b/.github/workflows/miri.yml @@ -29,7 +29,7 @@ jobs: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory shared-key: shared-${{ runner.os }} - # save-if: ${{ github.ref == 'refs/heads/main' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - run: MIRIFLAGS="-Zmiri-disable-isolation" cargo miri nextest run --partition count:${{ matrix.partition }}/5 # We need to disable isolation because # "unsupported operation: `clock_gettime` with `REALTIME` clocks not available when isolation is enabled" diff --git a/.github/workflows/pr-metadata-docs-and-deps.yml b/.github/workflows/pr-metadata-docs-and-deps.yml index da350ef094..5b9ec53a65 100644 --- a/.github/workflows/pr-metadata-docs-and-deps.yml +++ b/.github/workflows/pr-metadata-docs-and-deps.yml @@ -104,7 +104,7 @@ jobs: with: cache-targets: true shared-key: shared-${{ runner.os }} - # save-if: ${{ github.ref == 'refs/heads/main' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - uses: dtolnay/rust-toolchain@stable - name: Check missing docs id: missing-docs @@ -277,7 +277,7 @@ jobs: with: cache-targets: true shared-key: shared-${{ runner.os }} - # save-if: ${{ github.ref == 'refs/heads/main' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - uses: dtolnay/rust-toolchain@stable - uses: taiki-e/cache-cargo-install-action@7447f04c51f2ba27ca35e7f1e28fab848c5b3ba7 # 2.3.1 with: diff --git a/.github/workflows/pr-title-semver-check.yml b/.github/workflows/pr-title-semver-check.yml index 48303dac26..a510027de4 100644 --- a/.github/workflows/pr-title-semver-check.yml +++ b/.github/workflows/pr-title-semver-check.yml @@ -100,7 +100,7 @@ jobs: with: cache-targets: true shared-key: shared-${{ runner.os }} - # save-if: ${{ github.ref == 'refs/heads/main' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - name: Install dependencies run: | diff --git a/.github/workflows/release-proposal-dispatch.yml b/.github/workflows/release-proposal-dispatch.yml index 9f56b2c3d3..8488b50b19 100644 --- a/.github/workflows/release-proposal-dispatch.yml +++ b/.github/workflows/release-proposal-dispatch.yml @@ -143,7 +143,7 @@ jobs: with: cache-targets: true shared-key: shared-${{ runner.os }} - # save-if: ${{ github.ref == 'refs/heads/main' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - uses: dtolnay/rust-toolchain@nightly with: toolchain: nightly-2026-02-08 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa3b153404..126878a5d7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,7 +54,7 @@ jobs: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory shared-key: shared-${{ runner.os }} - # save-if: ${{ github.ref == 'refs/heads/main' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - name: "Remove nextest CI report" shell: bash run: rm -rf target/nextest/ci/junit.xml @@ -194,7 +194,7 @@ jobs: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory shared-key: shared-${{ runner.os }} - # save-if: ${{ github.ref == 'refs/heads/main' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - name: "Generate profiling FFI" shell: bash env: @@ -309,7 +309,7 @@ jobs: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory shared-key: shared-${{ runner.os }} - # save-if: ${{ github.ref == 'refs/heads/main' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - run: cargo install cross || true - run: cross build --workspace --target x86_64-unknown-linux-gnu --exclude builder - run: cross test --workspace --features libdd-crashtracker/generate-unit-test-files --target x86_64-unknown-linux-gnu --exclude builder -- --skip "::single_threaded_tests::" --skip "tracing_integration_tests::" diff --git a/.github/workflows/verify-proto-files.yml b/.github/workflows/verify-proto-files.yml index 57933ce04d..9b6db0faad 100644 --- a/.github/workflows/verify-proto-files.yml +++ b/.github/workflows/verify-proto-files.yml @@ -53,7 +53,7 @@ jobs: cache-targets: true # cache build artifacts cache-bin: true # cache the ~/.cargo/bin directory shared-key: shared-${{ runner.os }} - # save-if: ${{ github.ref == 'refs/heads/main' }} + save-if: ${{ github.ref == 'refs/heads/main' }} - name: diff pb.rs working-directory: libdd-trace-protobuf run: | From e0703d7d6ec7b55487c6549b010024335b5afca0 Mon Sep 17 00:00:00 2001 From: Igor Unanua Date: Tue, 3 Mar 2026 17:05:51 +0100 Subject: [PATCH 3/3] remove comment --- .github/workflows/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 126878a5d7..45bcbc5e1b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,8 +46,6 @@ jobs: uses: taiki-e/install-action@2c41309d51ede152b6f2ee6bf3b71e6dc9a8b7df # 2.49.27 with: tool: nextest@0.9.96 - # shared-key = one cache per (OS, lockfile, toolchain) shared across workflows - # save-if: main = only save on default branch to avoid filling GH cache with PR runs - name: Cache [rust] uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # 2.8.1 with: