name: CI
on:
push:
branches: [ main, feat/**, fix/** ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
test:
runs-on: windows-latest
continue-on-error: ${{ matrix.rust == 'beta' || matrix.rust == 'nightly' }}
strategy:
fail-fast: false
matrix:
rust: [ stable, "1.90.0", beta, nightly ]
features: ["", "introspection", "net", "introspection,net"]
env:
RUST_BACKTRACE: 1
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@v5
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
save-if: true
- name: Install Rust (stable)
if: ${{ matrix.rust == 'stable' }}
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Install Rust (MSRV)
if: ${{ matrix.rust == '1.90.0' }}
uses: dtolnay/rust-toolchain@1.90.0
with:
components: clippy
- name: Install Rust (beta)
if: ${{ matrix.rust == 'beta' }}
uses: dtolnay/rust-toolchain@beta
with:
components: clippy
- name: Install Rust (nightly)
if: ${{ matrix.rust == 'nightly' }}
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- name: Show toolchain
run: rustc -Vv && cargo -V
- name: Format check (workspace)
if: ${{ matrix.rust == 'stable' && matrix.features == '' }}
run: cargo fmt --all -- --check
- name: Test (${{ matrix.features }} | ${{ matrix.rust }})
shell: bash
run: |
if [[ "${{ matrix.features }}" == "" ]]; then
cargo test --all-targets
else
cargo test --all-targets --features "${{ matrix.features }}"
fi
- name: Dependency Duplicates (cargo tree -d)
if: ${{ matrix.rust == 'stable' }}
shell: bash
run: |
if [[ "${{ matrix.features }}" == "" ]]; then
cargo tree -d || true
else
cargo tree -d --features "${{ matrix.features }}" || true
fi
- name: Clippy (${{ matrix.features }} | ${{ matrix.rust }})
shell: bash
run: |
if [[ "${{ matrix.features }}" == "" ]]; then
cargo clippy --all-targets -- -D warnings
else
cargo clippy --all-targets --features "${{ matrix.features }}" -- -D warnings
fi