使用GitHub Actions时,当使用Rust的cargo
构建时,我无法从使用先前构建生成的缓存艺件中看到明显的改进。
我怀疑在以下代码中有些遗漏,可能是什么问题呢?
编辑:这里是日志,如果您想查看它们!
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cargo Cache
uses: actions/cache@v1
with:
path: ~/.cargo
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
${{ runner.os }}-cargo
- name: Cargo Target Cache
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.toml') }}
${{ runner.os }}-cargo-target
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose --all --features "strict"
- name: Run tests
run: cargo test --verbose --all --features "strict"