ci: make MSRV check deterministic #8
This file contains hidden or 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
| on: [push, pull_request] | |
| name: CI | |
| jobs: | |
| check: | |
| name: Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: cargo check --all-features --examples | |
| - run: cargo check --no-default-features | |
| test: | |
| name: Test Suite | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build with default features | |
| run: cargo build | |
| - name: Test | |
| run: cargo test --all-features | |
| - name: Test feature compatibility | |
| if: runner.os == 'Linux' | |
| run: | | |
| cargo test --no-default-features | |
| cargo test --features serde | |
| cargo test --features use_serde | |
| msrv: | |
| name: MSRV Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Vendor dependencies | |
| run: | | |
| mkdir -p .cargo | |
| cargo generate-lockfile | |
| cargo vendor --locked vendor > .cargo/config.toml | |
| - uses: dtolnay/rust-toolchain@1.62.0 | |
| - run: cargo check --locked --offline --all-features | |
| codecov: | |
| name: Code Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-tarpaulin | |
| run: cargo install cargo-tarpaulin | |
| - name: Run cargo-tarpaulin | |
| run: cargo tarpaulin --all-features --out xml | |
| - name: Upload to codecov.io | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Archive code coverage results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: code-coverage-report | |
| path: cobertura.xml | |
| fmt: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - run: cargo fmt --all -- --check | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - run: cargo clippy --all-features --all-targets -- -D warnings | |
| docs: | |
| name: Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: RUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps | |
| semver: | |
| name: Semver | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: obi1kenobi/cargo-semver-checks-action@v2 |