name: rust
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
linux:
name: validate (Strix)
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: [self-hosted, linux, x64, drep-linux]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c with:
toolchain: stable
components: rustfmt, clippy
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6
- name: Format
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --all-targets --all-features
- name: Test
run: cargo test --all-targets --all-features
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c with:
toolchain: 1.88.0
- name: MSRV
run: cargo +1.88.0 check
test-macos:
name: test (Mac mini)
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: [self-hosted, macos, arm64, drep-macos]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c with:
toolchain: stable
components: clippy
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6
- run: cargo test --all-targets --all-features