name: Tests
on:
push:
branches: [ master, '[0-9]+.[0-9]+' ]
pull_request:
branches: [ master, '[0-9]+.[0-9]+' ]
jobs:
test:
name: Test
strategy:
matrix:
include:
- os: ubuntu-latest
toolchain: nightly
variant: docs
features: "--features nightly-diagnostics"
- os: macos-latest
toolchain: beta
- os: windows-latest
toolchain: stable
- os: ubuntu-latest
toolchain: "1.70.0"
targets: "--lib --tests"
variant: MSRV
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v5
- name: MSRV
if: ${{ matrix.variant == 'MSRV' }}
run: cp Cargo.lock.msrv Cargo.lock
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Build docs
if: ${{ matrix.variant == 'docs' }}
run: cargo doc ${{ matrix.features }} --all --no-deps
- name: Test impl-tools-lib
run: cargo test --manifest-path lib/Cargo.toml ${{ matrix.targets }}
- name: Test impl-tools
run: cargo test ${{ matrix.features }} ${{ matrix.targets }}
- name: Test test-cfg
working-directory: tests/test-cfg
run: |
cargo test
cargo test --features feature1
workspace:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt,clippy
- name: rustfmt
run: cargo fmt --all -- --check
- name: clippy
run: cargo clippy --workspace -- -D warnings