mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 15:27:16 +00:00
Improve cache steps in github actions
This commit is contained in:
parent
aae96236b2
commit
3e45cb26ab
2 changed files with 12 additions and 2 deletions
7
.github/workflows/benchmark.yml
vendored
7
.github/workflows/benchmark.yml
vendored
|
@ -15,10 +15,13 @@ jobs:
|
|||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: master
|
||||
- name: Ready cache
|
||||
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
|
||||
- name: Cache cargo
|
||||
uses: actions/cache@v1
|
||||
id: cache
|
||||
with:
|
||||
path: /home/runner/.cargo
|
||||
path: ~/.cargo
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||
- name: Bench base
|
||||
run: cargo bench -- -R bencher | tee output.txt
|
||||
|
@ -45,8 +48,10 @@ jobs:
|
|||
annotate-always: true
|
||||
- name: Install cargo-cache
|
||||
uses: actions-rs/install@v0.1
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
with:
|
||||
crate: cargo-cache
|
||||
use-tool-cache: true
|
||||
- name: Cleanup cache
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: cargo cache -a
|
||||
|
|
7
.github/workflows/linux.yml
vendored
7
.github/workflows/linux.yml
vendored
|
@ -16,10 +16,13 @@ jobs:
|
|||
toolchain: stable
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Ready cache
|
||||
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
|
||||
- name: Cache cargo
|
||||
uses: actions/cache@v1
|
||||
id: cache
|
||||
with:
|
||||
path: /home/runner/.cargo
|
||||
path: ~/.cargo
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
|
||||
- name: Test
|
||||
uses: actions-rs/cargo@v1
|
||||
|
@ -28,8 +31,10 @@ jobs:
|
|||
args: --release --features "yaml unstable"
|
||||
- name: Install cargo-cache
|
||||
uses: actions-rs/install@v0.1
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
with:
|
||||
crate: cargo-cache
|
||||
use-tool-cache: true
|
||||
- name: Cleanup cache
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: cargo cache -a
|
||||
|
|
Loading…
Add table
Reference in a new issue