From ba51488be616b83895f3a6b3072bd494d713e5da Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Fri, 31 Oct 2025 16:20:17 +0100 Subject: [PATCH] Whoopsie --- .github/workflows/run_tests.yml | 56 ++++++++++++++-------- tooling/xtask/src/tasks/workflows/steps.rs | 17 ++++--- 2 files changed, 43 insertions(+), 30 deletions(-) diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 81e38d0b6c66f5dabc704a84b432806edb1cf664..7bfc5172bacca198c63b68ee2d64b02ef5f9a5ec 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -65,9 +65,11 @@ jobs: - name: steps::cache_rust_dependencies_namespace uses: namespacelabs/rust-cache@nscloud-cache-action with: - path: - - /home/runner/.cargo/bin/cargo-nextest - - /home/runner/.cargo/bin/cargo-about + save-if: ${{ github.ref == 'refs/heads/main' }} + cache: rust + path: |- + /home/runner/.cargo/bin/cargo-nextest + /home/runner/.cargo/bin/cargo-about - name: steps::checkout_repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: @@ -154,9 +156,11 @@ jobs: - name: steps::cache_rust_dependencies_namespace uses: namespacelabs/rust-cache@nscloud-cache-action with: - path: - - /home/runner/.cargo/bin/cargo-nextest - - /home/runner/.cargo/bin/cargo-about + save-if: ${{ github.ref == 'refs/heads/main' }} + cache: rust + path: |- + /home/runner/.cargo/bin/cargo-nextest + /home/runner/.cargo/bin/cargo-about - name: steps::setup_node uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 with: @@ -229,9 +233,11 @@ jobs: - name: steps::cache_rust_dependencies_namespace uses: namespacelabs/rust-cache@nscloud-cache-action with: - path: - - /home/runner/.cargo/bin/cargo-nextest - - /home/runner/.cargo/bin/cargo-about + save-if: ${{ github.ref == 'refs/heads/main' }} + cache: rust + path: |- + /home/runner/.cargo/bin/cargo-nextest + /home/runner/.cargo/bin/cargo-about - name: steps::setup_linux run: ./script/linux shell: bash -euxo pipefail {0} @@ -278,9 +284,11 @@ jobs: - name: steps::cache_rust_dependencies_namespace uses: namespacelabs/rust-cache@nscloud-cache-action with: - path: - - /home/runner/.cargo/bin/cargo-nextest - - /home/runner/.cargo/bin/cargo-about + save-if: ${{ github.ref == 'refs/heads/main' }} + cache: rust + path: |- + /home/runner/.cargo/bin/cargo-nextest + /home/runner/.cargo/bin/cargo-about - name: cargo build -p collab run: cargo build -p collab shell: bash -euxo pipefail {0} @@ -340,9 +348,11 @@ jobs: - name: steps::cache_rust_dependencies_namespace uses: namespacelabs/rust-cache@nscloud-cache-action with: - path: - - /home/runner/.cargo/bin/cargo-nextest - - /home/runner/.cargo/bin/cargo-about + save-if: ${{ github.ref == 'refs/heads/main' }} + cache: rust + path: |- + /home/runner/.cargo/bin/cargo-nextest + /home/runner/.cargo/bin/cargo-about - name: run_tests::check_dependencies::install_cargo_machete uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386 with: @@ -379,9 +389,11 @@ jobs: - name: steps::cache_rust_dependencies_namespace uses: namespacelabs/rust-cache@nscloud-cache-action with: - path: - - /home/runner/.cargo/bin/cargo-nextest - - /home/runner/.cargo/bin/cargo-about + save-if: ${{ github.ref == 'refs/heads/main' }} + cache: rust + path: |- + /home/runner/.cargo/bin/cargo-nextest + /home/runner/.cargo/bin/cargo-about - name: run_tests::check_docs::lychee_link_check uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 with: @@ -423,9 +435,11 @@ jobs: - name: steps::cache_rust_dependencies_namespace uses: namespacelabs/rust-cache@nscloud-cache-action with: - path: - - /home/runner/.cargo/bin/cargo-nextest - - /home/runner/.cargo/bin/cargo-about + save-if: ${{ github.ref == 'refs/heads/main' }} + cache: rust + path: |- + /home/runner/.cargo/bin/cargo-nextest + /home/runner/.cargo/bin/cargo-about - name: ./script/check-licenses run: ./script/check-licenses shell: bash -euxo pipefail {0} diff --git a/tooling/xtask/src/tasks/workflows/steps.rs b/tooling/xtask/src/tasks/workflows/steps.rs index 5feaeb0137882a715dc3dd0cab7bf69a286852bd..aa283a3aac8d5822b21885663757722d6894c012 100644 --- a/tooling/xtask/src/tasks/workflows/steps.rs +++ b/tooling/xtask/src/tasks/workflows/steps.rs @@ -113,20 +113,19 @@ pub(crate) fn clippy(platform: Platform) -> Step { } pub(crate) fn cache_rust_dependencies_namespace() -> Step { + let allowlisted_binaries: &str = &[ + "/home/runner/.cargo/bin/cargo-nextest", + "/home/runner/.cargo/bin/cargo-about", + ] + .join("\n"); named::uses( "namespacelabs", "rust-cache", "nscloud-cache-action", // v2 ) - .with(("save-if", "${{ github.ref == 'refs/heads/main' }}")) - .with(("cache", "rust")) - .with(( - "path", - [ - "/home/runner/.cargo/bin/cargo-nextest", - "/home/runner/.cargo/bin/cargo-about", - ], - )) + .add_with(("save-if", "${{ github.ref == 'refs/heads/main' }}")) + .add_with(("cache", "rust")) + .add_with(("path", allowlisted_binaries)) } fn setup_linux() -> Step {