Skip to content

Commit

Permalink
update actions cache and enable key restore
Browse files Browse the repository at this point in the history
Fix paths for windows
  • Loading branch information
DaMandal0rian committed Oct 4, 2023
1 parent 2cd8d55 commit dd0e327
Showing 1 changed file with 32 additions and 12 deletions.
44 changes: 32 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,16 @@ jobs:

- name: Configure cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # @v3.3.2
env:
cache-name: cargo-fmt
with:
path: |
~/.cargo/registry
~/.cargo/git
${{ runner.os == 'Windows' && format('{0}/.cargo/registry', env.USERPROFILE) || '~/.cargo/registry' }}
${{ runner.os == 'Windows' && format('{0}/.cargo/git', env.USERPROFILE) || '~/.cargo/git' }}
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-${{ env.cache-name }}-
${{ runner.os }}-cargo-
- name: cargo fmt
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # @v1.0.1
Expand Down Expand Up @@ -99,12 +104,17 @@ jobs:
continue-on-error: true

- name: Configure cache
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # @v3.0.11
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # @v3.3.2
env:
cache-name: cargo-clippy
with:
path: |
~/.cargo/registry
~/.cargo/git
${{ matrix.os == 'Windows' && format('{0}/.cargo/registry', env.USERPROFILE) || '~/.cargo/registry' }}
${{ matrix.os == 'Windows' && format('{0}/.cargo/git', env.USERPROFILE) || '~/.cargo/git' }}
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ matrix.os }}-cargo-${{ env.cache-name }}-
${{ matrix.os }}-cargo-
- name: cargo clippy
uses: actions-rs/clippy-check@b5b5f21f4797c02da247df37026fcd0a5024aa4d # @v1.0.7
Expand All @@ -124,12 +134,17 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure cache
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # @v3.0.11
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # @v3.3.2
env:
cache-name: cargo-docs
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
${{ runner.os == 'Windows' && format('{0}/.cargo/registry', env.USERPROFILE) || '~/.cargo/registry' }}
${{ runner.os == 'Windows' && format('{0}/.cargo/git', env.USERPROFILE) || '~/.cargo/git' }}
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-${{ env.cache-name }}-
${{ runner.os }}-cargo-
- name: Check Documentation
run: cargo doc --locked --all --no-deps --lib
Expand Down Expand Up @@ -183,12 +198,17 @@ jobs:
tool: cargo-nextest

- name: Configure cache
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # @v3.0.11
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # @v3.3.2
env:
cache-name: cargo-test
with:
path: |
~/.cargo/registry
~/.cargo/git
${{ matrix.os == 'Windows' && format('{0}/.cargo/registry', env.USERPROFILE) || '~/.cargo/registry' }}
${{ matrix.os == 'Windows' && format('{0}/.cargo/git', env.USERPROFILE) || '~/.cargo/git' }}
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ matrix.os }}-cargo-${{ env.cache-name }}-
${{ matrix.os }}-cargo-
- name: cargo nextest run --locked
uses: actions-rs/cargo@ae10961054e4aa8b4aa7dffede299aaf087aa33b # @v1.0.1
Expand Down

0 comments on commit dd0e327

Please sign in to comment.