CICD: print MSRV to logs #86
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
| name: ci | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| get-msrv: | |
| name: Get declared MSRV from Cargo.toml | |
| runs-on: ubuntu-latest | |
| outputs: | |
| msrv: ${{ steps.get_msrv.outputs.msrv }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - name: Get MSRV | |
| id: get_msrv | |
| run: | | |
| cargo metadata --format-version 1 \ | |
| | jq --raw-output '.packages[] | select(.name == "documented") | "msrv=" + .rust_version' \ | |
| | tee --append "$GITHUB_OUTPUT" | |
| check: | |
| name: Run checks | |
| runs-on: ubuntu-latest | |
| needs: get-msrv | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| rust: | |
| - ${{ needs.get-msrv.outputs.msrv }} | |
| - stable | |
| - nightly | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| components: clippy, rustfmt | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Run clippy | |
| run: | | |
| cargo clippy --workspace -- -D warnings | |
| cargo clippy --workspace --no-default-features -- -D warnings | |
| - name: Run tests | |
| run: | | |
| cargo test --workspace | |
| cargo test --workspace --no-default-features |