From 2948c2589dd9ef8391ae601d201c5b9cf7d353d3 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 9 Nov 2022 19:54:05 +0100 Subject: [PATCH] Cache target/ on non-Windows platforms --- .github/workflows/build.yml | 10 ++++++++++ .github/workflows/docs.yml | 10 ++++++++++ .github/workflows/test.yml | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7bfb4e70..fefea554 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,11 +42,21 @@ jobs: - uses: actions/cache@v2 with: # FIXME: Caching `target/` causes the Windows runner to blow up after some time + if: startsWith(matrix.os, 'windows') path: | ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ key: ${{ runner.name }}-${{ matrix.cross-target }} + - uses: actions/cache@v2 + with: + if: "!startsWith(matrix.os, 'windows')" + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.name }}-${{ matrix.cross-target }} - name: Set up Rust toolchain uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e367d0fb..d4afc200 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -28,11 +28,21 @@ jobs: - uses: actions/cache@v2 with: # FIXME: Caching `target/` causes the Windows runner to blow up after some time + if: startsWith(matrix.os, 'windows') path: | ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ key: ${{ runner.name }}-${{ matrix.cross-target }} + - uses: actions/cache@v2 + with: + if: "!startsWith(matrix.os, 'windows')" + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.name }}-${{ matrix.cross-target }} - name: Set up Rust toolchain uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef228cf3..cd00c121 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,11 +39,21 @@ jobs: - uses: actions/cache@v2 with: # FIXME: Caching `target/` causes the Windows runner to blow up after some time + if: startsWith(matrix.os, 'windows') path: | ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ key: ${{ runner.name }}-${{ matrix.cross-target }} + - uses: actions/cache@v2 + with: + if: "!startsWith(matrix.os, 'windows')" + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.name }}-${{ matrix.cross-target }} - name: Set up Rust toolchain uses: actions-rs/toolchain@v1