name: CI
permissions:
contents: read
pull-requests: write
on:
push:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: test
strategy:
matrix:
toolchain:
- stable
os:
- windows-latest
- macos-latest
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- run: rustup update
- uses: Swatinem/rust-cache@v2
- run: rustup target add ${{ matrix.target }}
- name: Run only musl
if: matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'
run: sudo apt update && sudo apt install -y musl-dev
- run: cargo build --target ${{ matrix.target }} --no-default-features --verbose
- run: cargo build --target ${{ matrix.target }} --verbose
- run: cargo test --target ${{ matrix.target }} --verbose
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: rustup update stable && rustup default stable && rustup component add rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all --check --verbose
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: rustup update stable && rustup default stable && rustup component add clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy -- -D warnings
cargo_deny:
name: cargo_deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: rustup update stable && rustup default stable && cargo install cargo-deny
- uses: Swatinem/rust-cache@v2
- run: cargo deny -L error check