diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bd50ec8e..e0c498bf 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -60,22 +60,23 @@ jobs: - uses: actions/checkout@v3 - run: rustup update - run: rustup target add ${{ matrix.sys.target }} - # TODO: Investigate cache bloat and re-enable. - # - uses: actions/cache@v3 - # with: - # path: | - # ~/.cargo/registry/index/ - # ~/.cargo/registry/cache/ - # ~/.cargo/git/db/ - # key: cargo-${{ hashFiles('**/Cargo.lock') }} - # restore-keys: cargo- - # - uses: actions/cache@v3 - # with: - # path: target/ - # key: target-${{ strategy.job-index }}-${{ github.sha }} - # restore-keys: | - # target-${{ strategy.job-index }} - # target- + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + key: cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: cargo- + - uses: actions/cache@v3 + with: + path: target/ + key: ${{ github.job }}-target-${{ strategy.job-index }}-${{ github.sha }} + restore-keys: | + ${{ github.job }}-target-${{ strategy.job-index }} + ${{ github.job }}-target- + - if: github.ref_protected + run: rm -fr target - run: cargo install --locked --version 0.5.15 cargo-hack - if: "github.ref_protected" run: echo 'CARGO_HACK_ARGS=--feature-powerset' >> $GITHUB_ENV