Skip to content

ci: bump actions/checkout from 4.2.1 to 4.2.2 #430

ci: bump actions/checkout from 4.2.1 to 4.2.2

ci: bump actions/checkout from 4.2.1 to 4.2.2 #430

Workflow file for this run

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@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
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