From 936c4e1a8317ff9e4322db1509f2beab6cade1c7 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 19 Mar 2023 22:00:02 -0400 Subject: [PATCH] ci: Enable caching Now that most jobs are on the stable channel, enabling caching should be more effective than it would have been on nightly. --- .github/workflows/rust.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 08abc7a54..e24f5970a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,6 +20,8 @@ jobs: - name: Checkout sources uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - name: Install qemu and OVMF run: | sudo apt-get update @@ -36,6 +38,8 @@ jobs: - name: Checkout sources uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - name: Install qemu and OVMF run: | sudo apt-get update @@ -52,6 +56,8 @@ jobs: - name: Checkout sources uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - name: Install qemu and OVMF run: | sudo apt-get update @@ -68,6 +74,8 @@ jobs: - name: Checkout sources uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - name: Run cargo test (without unstable) run: cargo xtask test @@ -78,6 +86,8 @@ jobs: - name: Checkout sources uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - name: Run cargo fmt run: | rustup component add rustfmt @@ -111,6 +121,8 @@ jobs: - name: Set MSRV toolchain run: cp .github/workflows/msrv_toolchain.toml rust-toolchain.toml + - uses: Swatinem/rust-cache@v2 + - name: Build run: cargo xtask test-latest-release @@ -124,6 +136,8 @@ jobs: - name: Checkout sources uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - name: Run VM tests run: cargo xtask run --target x86_64 --ci timeout-minutes: 6 @@ -143,6 +157,8 @@ jobs: - name: Set toolchain run: cp .github/workflows/msrv_toolchain.toml rust-toolchain.toml + - uses: Swatinem/rust-cache@v2 + - name: Build run: cargo xtask build @@ -158,6 +174,8 @@ jobs: - name: Set nightly toolchain so that `unstable` can be included run: cp .github/workflows/nightly_toolchain.toml rust-toolchain.toml + - uses: Swatinem/rust-cache@v2 + - name: Build run: cargo xtask build --feature-permutations @@ -176,6 +194,8 @@ jobs: - name: Enable nightly toolchain run: cp .github/workflows/nightly_toolchain.toml rust-toolchain.toml + - uses: Swatinem/rust-cache@v2 + - name: Run VM tests with the `unstable` feature run: cargo xtask run --target x86_64 --headless --ci --unstable timeout-minutes: 4