diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 50938004f7f9..0712012f025f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -675,6 +675,13 @@ jobs: - run: echo CARGO_BUILD_TARGET=${{ matrix.target }} >> $GITHUB_ENV if: matrix.target != '' + - name: Set up cargo cache + uses: Swatinem/rust-cache@94b28bf00e42c2b783e7dd289d30da129b46838b + with: + shared-key: "test-${{ matrix.cache_key }}" + save-if: ${{ github.ref == 'refs/heads/main' }} + if: endsWith(matrix.cache_key, '-wasmtime-cli') + # Fix an ICE for now in gcc when compiling zstd with debuginfo (??) - run: echo CFLAGS=-g0 >> $GITHUB_ENV if: matrix.target == 'x86_64-pc-windows-gnu' diff --git a/ci/build-test-matrix.js b/ci/build-test-matrix.js index 95db8b7f7f7f..ce0ffe7cd993 100644 --- a/ci/build-test-matrix.js +++ b/ci/build-test-matrix.js @@ -228,6 +228,7 @@ async function shard(configs) { config, { name: `${config.name} (${Array.from(bucket).join(', ')})`, + cache_key: `${config.name}-${Array.from(bucket).join('-').substring(0, 400)}`, // We run tests via `cargo test --workspace`, so exclude crates that // aren't in this bucket, rather than naming only the crates that are // in this bucket.