Skip to content

update cache action image #2

update cache action image

update cache action image #2

Workflow file for this run

name: Continuous Integration
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Pin Rust dirs to workspace (avoid cross-device rename)
run: |
echo "CARGO_HOME=$GITHUB_WORKSPACE/.cargo" >> $GITHUB_ENV
echo "RUSTUP_HOME=$GITHUB_WORKSPACE/.rustup" >> $GITHUB_ENV
echo "TMPDIR=$GITHUB_WORKSPACE/.tmp" >> $GITHUB_ENV
echo "RUSTUP_TMPDIR=$GITHUB_WORKSPACE/.tmp" >> $GITHUB_ENV
mkdir -p "$GITHUB_WORKSPACE/.cargo" "$GITHUB_WORKSPACE/.rustup" "$GITHUB_WORKSPACE/.tmp"
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@439cf607258077187679211f12aa6f19af4a0af7 # stable
with:
toolchain: stable
components: rustfmt, clippy
- name: Verify Cargo.lock is up to date
run: cargo check --locked
- name: Cache cargo registry
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
$CARGO_HOME/registry/index/
$CARGO_HOME/registry/cache/
$CARGO_HOME/git/db/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache cargo build
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: target/
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
- name: Run tests
run: cargo test --all-features --verbose
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Check formatting
run: cargo fmt --all -- --check