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:
Graham McIntire 2026-02-10 08:55:25 -06:00
parent da7d7fcba0
commit ded4aba536
No known key found for this signature in database

View file

@ -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