Lint and test with serde in ci #194
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: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test-and-lint: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
# - beta | |
# - nightly | |
# keep this fixed to the version in rust-toolchain.toml, README.md and below | |
- nightly-2022-11-03 | |
# - 1.31.0 # find out MSRV | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update toolchain | |
run: | | |
rustup default ${{ matrix.toolchain }} | |
rustup override set ${{ matrix.toolchain }} | |
rustup component add clippy | |
- name: Show toolchain info | |
run: | | |
cargo --version --verbose | |
rustc --version | |
cargo clippy --version | |
- name: Lint stable | |
if: ${{ matrix.toolchain == 'stable' }} | |
run: | | |
cargo clippy --workspace --features serde -- -D warnings | |
- name: Lint nightly | |
if: ${{ matrix.toolchain == 'nightly-2022-11-03' }} | |
run: | | |
cargo clippy --workspace --features nightly serde -- -D warnings | |
- name: Test stable | |
if: ${{ matrix.toolchain == 'stable' }} | |
run: | | |
cargo test --workspace --features serde | |
- name: Test nightly | |
if: ${{ matrix.toolchain == 'nightly-2022-11-03' }} | |
run: | | |
cargo test --workspace --features nightly serde |