1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
name: Test and Build Rust
on:
push:
pull_request:
workflow_dispatch:
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- uses: actions/checkout@v6
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check --verbose
clippy:
name: Clippy ${{ matrix.toolchain }}
runs-on: ubuntu-latest
continue-on-error: ${{ (matrix.toolchain == 'beta') || (matrix.toolchain == 'nightly') }}
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- beta
- nightly
env:
RUSTFLAGS: --deny warnings
steps:
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
- uses: actions/checkout@v6
- uses: Swatinem/rust-cache@v2
- run: cargo fetch --locked
- run: cargo clippy --offline --all-features --all-targets
- run: cargo doc --offline --all-features --no-deps
msrv:
name: Check MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
- run: cargo hack --feature-powerset --no-dev-deps --rust-version check --workspace
features:
name: Features ${{ matrix.toolchain }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- beta
os:
- ubuntu-latest
- macos-latest
- windows-latest
env:
RUSTFLAGS: --allow unknown-lints --deny warnings
steps:
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- uses: taiki-e/install-action@cargo-hack
- uses: actions/checkout@v6
- uses: Swatinem/rust-cache@v2
- run: cargo fetch --locked
- name: Check all targets
run: cargo hack --keep-going --feature-powerset check --all-targets --offline
- name: Check without dev dependencies
run: cargo hack --keep-going --feature-powerset --no-dev-deps check --offline
test:
name: Test ${{ matrix.toolchain }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- beta
- nightly
os:
- ubuntu-latest
- macos-latest
- windows-latest
env:
RUSTFLAGS: --allow unknown-lints --deny warnings
steps:
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- uses: actions/checkout@v6
- uses: Swatinem/rust-cache@v2
- run: cargo fetch --locked
- run: cargo build --offline --all-features --all-targets
- run: cargo test --offline --all-features
|