Only lint on stable Rust in CI #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: [push, pull_request] | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
combo: [ | |
{ rust: stable, flags: --all-features }, | |
{ rust: 1.70.0, flags: --all-features }, | |
{ rust: stable, flags: --features=default }, | |
{ rust: 1.46.0, flags: --features=default }, | |
{ rust: stable, flags: --no-default-features }, | |
{ rust: 1.46.0, flags: --no-default-features }, | |
] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: ${{ matrix.combo.rust }} | |
- name: Build | |
run: cargo build --all-targets ${{ matrix.combo.flags }} | |
- name: Test | |
run: cargo test ${{ matrix.combo.flags }} | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
- name: Run rustfmt | |
run: cargo fmt --all -- --check | |
- name: Run clippy | |
run: cargo clippy --all-targets --all-features -- -D warnings |