From accf141919b01e61347600cc37d8ed4e2c8d98f1 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 28 Dec 2024 23:20:38 +1000 Subject: [PATCH] CI: Fix caching (#1334) * CI: Fix caching Create lockfile before invoking rust-cache to make sure it is invalidated when new versions of dependencies have released * Fix main.yml --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3705a80b..ef7fb53a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -133,6 +133,7 @@ jobs: - name: setup dev environment uses: ilammy/msvc-dev-cmd@v1 if: startsWith(matrix.build, 'windows-clang') + - run: cargo update - uses: Swatinem/rust-cache@v2 - run: cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} - run: cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --release @@ -170,6 +171,7 @@ jobs: rustup component add rust-src --toolchain ${{ matrix.rust }} rustup default ${{ matrix.rust }} shell: bash + - run: cargo update - uses: Swatinem/rust-cache@v2 - run: cargo test -Z build-std=std ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} - run: cargo test -Z build-std=std ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --release @@ -187,6 +189,7 @@ jobs: run: | rustup target add ${{ matrix.target }} shell: bash + - run: cargo update - uses: Swatinem/rust-cache@v2 - run: cargo test --no-run --target ${{ matrix.target }} - run: cargo test --no-run --target ${{ matrix.target }} --release @@ -227,6 +230,7 @@ jobs: echo "WASI_SDK_PATH=$WASI_SDK_PATH" >> "$GITHUB_ENV" echo "CC=$CC" >> "$GITHUB_ENV" + - run: cargo update - uses: Swatinem/rust-cache@v2 with: env-vars: "WASI_TOOLCHAIN_VERSION" @@ -248,6 +252,7 @@ jobs: sudo dpkg -i cuda-keyring_1.0-1_all.deb sudo apt-get update sudo apt-get -y install cuda-minimal-build-11-8 + - run: cargo update - uses: Swatinem/rust-cache@v2 - name: Test 'cudart' feature shell: bash