Add stickydisk caching for cargo git deps and Rust toolchain
- Cache ~/.cargo/git for git-sourced dependencies - Cache ~/.rustup to avoid re-downloading toolchain each run - Move format check before cargo check (fail fast on formatting)
This commit is contained in:
parent
da7d7fcba0
commit
ded4aba536
1 changed files with 15 additions and 3 deletions
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
|
|
@ -44,6 +44,18 @@ jobs:
|
||||||
key: ${{ github.repository }}-cargo-registry
|
key: ${{ github.repository }}-cargo-registry
|
||||||
path: ~/.cargo/registry
|
path: ~/.cargo/registry
|
||||||
|
|
||||||
|
- name: Mount Cargo git
|
||||||
|
uses: useblacksmith/stickydisk@v1
|
||||||
|
with:
|
||||||
|
key: ${{ github.repository }}-cargo-git
|
||||||
|
path: ~/.cargo/git
|
||||||
|
|
||||||
|
- name: Mount Rust toolchain
|
||||||
|
uses: useblacksmith/stickydisk@v1
|
||||||
|
with:
|
||||||
|
key: ${{ github.repository }}-rustup
|
||||||
|
path: ~/.rustup
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
|
|
@ -56,12 +68,12 @@ jobs:
|
||||||
packages: protobuf-compiler lld libsnmp-dev
|
packages: protobuf-compiler lld libsnmp-dev
|
||||||
version: 1.0
|
version: 1.0
|
||||||
|
|
||||||
- name: Check
|
|
||||||
run: cargo check --release
|
|
||||||
|
|
||||||
- name: Format check
|
- name: Format check
|
||||||
run: cargo fmt -- --check
|
run: cargo fmt -- --check
|
||||||
|
|
||||||
|
- name: Check
|
||||||
|
run: cargo check --release
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: cargo test
|
run: cargo test
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue