ci: Bump actions/cache from 4.1.2 to 4.2.0 #466
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
permissions: read-all | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_test: | |
strategy: | |
matrix: | |
target: | |
- name: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- name: aarch64-unknown-linux-gnu | |
os: ubuntu-latest | |
- name: aarch64-apple-darwin | |
os: macos-latest | |
runs-on: ${{ matrix.target.os }} | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Get stable rust version | |
id: rust-version | |
run: echo RUST_VERSION=$(cargo +stable --version | cut -d ' ' -f 2) >> "$GITHUB_OUTPUT" | |
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu | |
target/ | |
key: ${{ matrix.target.name }}-cargo-${{ steps.rust-version.outputs.RUST_VERSION }}-${{ hashFiles('**/Cargo.lock') }} | |
- name: Add target | |
run: rustup target add ${{ matrix.target.name }} | |
- name: Build | |
run: cargo build --verbose --target ${{ matrix.target.name }} | |
if: matrix.target.name != 'aarch64-unknown-linux-gnu' | |
- name: Format | |
run: > | |
cargo +nightly --version || ( | |
rustup toolchain install nightly && | |
rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt | |
) && | |
cargo +nightly fmt --check | |
if: matrix.target.name == 'x86_64-unknown-linux-gnu' | |
- name: Run tests | |
run: cargo test --target ${{ matrix.target.name }} | |
if: matrix.target.name != 'aarch64-unknown-linux-gnu' | |
- name: Clippy | |
run: cargo clippy --target ${{ matrix.target.name }} -- -D warnings |