From 8750248cd9c0a77213b63d72dde751f28c832a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Gaspard?= Date: Tue, 7 Nov 2023 12:01:17 +0000 Subject: [PATCH] Reuse CI cache for MacOS too This will hopefully make CI cache actually be reused by MacOS, which before that was always restarting from scratch and thus ended up being the last one to complete. Splitting linux and linux-nightly caches should hopefully help a bit with CI times too, but this will most likely be much less impactful. --- .github/workflows/ci.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd4292b549c..d0493719175 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 with: prefix-key: "0" # change this to invalidate CI cache - shared-key: "cargo_nextest" + shared-key: "cargo_nextest-linux" save-if: "false" # use the cache from nextest, but don’t double-save - run: cargo build --locked --profile quick-release -p neard --bin neard - uses: actions/upload-artifact@v3 @@ -35,12 +35,15 @@ jobs: matrix: include: - name: Linux + id: linux os: ubuntu-22.04-16core flags: "" - name: Linux Nightly + id: linux_nightly os: ubuntu-22.04-16core flags: "--features nightly,test_features" - name: MacOS + id: macos os: macos-latest-xlarge # FIXME: some of these tests don't work very well on MacOS at the moment. Should fix # them at earliest convenience :) @@ -61,6 +64,7 @@ jobs: - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 with: prefix-key: "0" # change this to invalidate CI cache + shared-key: "cargo_nextest-${{ matrix.id }}" - run: cargo nextest run --locked --workspace -p '*' --cargo-profile quick-release --profile ci ${{ matrix.flags }} env: RUST_BACKTRACE: short @@ -135,7 +139,7 @@ jobs: - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 with: prefix-key: "0" # change this to invalidate CI cache - shared-key: "cargo_nextest" + shared-key: "cargo_nextest-linux_nightly" save-if: "false" # use the cache from nextest, but don’t double-save - run: pip3 install --user -r pytest/requirements.txt # This is the only job that uses `--features nightly` so we build this in-line instead of a @@ -212,7 +216,7 @@ jobs: - uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 with: prefix-key: "0" # change this to invalidate CI cache - shared-key: "cargo_nextest" + shared-key: "cargo_nextest-linux" save-if: "false" # use the cache from nextest, but don’t double-save - run: ./chain/jsonrpc/build_errors_schema.sh - run: git diff --quiet ./chain/jsonrpc/res/rpc_errors_schema.json || exit 1