name: Rust
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
if: ${{ !endsWith(github.head_ref, '-dhttp-identity') && !endsWith(github.ref_name, '-dhttp-identity') }}
strategy:
matrix:
target: [ubuntu, macos, windows]
fail-fast: false
runs-on: ${{ matrix.target }}-latest
steps:
- uses: actions/checkout@v4
- name: Install latest rust stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --workspace --verbose -- --test-threads=1
format:
if: ${{ !endsWith(github.head_ref, '-dhttp-identity') && !endsWith(github.ref_name, '-dhttp-identity') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install latest rust nightly toolchain and rustfmt
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
components: rustfmt
- name: Run rustfmt
run: cargo +nightly fmt --all -- --check
clippy:
if: ${{ !endsWith(github.head_ref, '-dhttp-identity') && !endsWith(github.ref_name, '-dhttp-identity') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install latest rust nightly toolchain with clippy
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
components: clippy
- name: Run clippy
run: cargo +nightly clippy --all-targets --all-features -- -Dwarnings
doc:
if: ${{ !endsWith(github.head_ref, '-dhttp-identity') && !endsWith(github.ref_name, '-dhttp-identity') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install latest rust nightly toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- name: Run doc
run: RUSTDOCFLAGS="-D warnings" cargo +nightly doc --no-deps
msrv:
if: ${{ !endsWith(github.head_ref, '-dhttp-identity') && !endsWith(github.ref_name, '-dhttp-identity') }}
strategy:
matrix:
target: [ubuntu, macos, windows]
fail-fast: false
runs-on: ${{ matrix.target }}-latest
steps:
- uses: actions/checkout@v4
- name: Install msrv toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.89.0
- name: Build with msrv
run: cargo build --workspace --release