From 08560c28d84dc1a7f5ae2475af6925138866557a Mon Sep 17 00:00:00 2001 From: Patrick Fernie Date: Sat, 9 Nov 2024 12:42:54 -0500 Subject: [PATCH] ci: split ci check step `build` into `build` + `test`. Add `msrv` job --- .github/workflows/ci.yml | 69 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b896f7..c25d5b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,11 +10,49 @@ env: CARGO_TERM_COLOR: always jobs: + ci-pass: + name: CI is green + runs-on: ubuntu-latest + needs: + - msrv + - build + - test + steps: + - run: exit 0 + + msrv: + name: MSRV + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Get MSRV package metadata + id: metadata + run: cargo metadata --no-deps --format-version 1 | jq -r '"msrv=" + .packages[0].rust_version' >> $GITHUB_OUTPUT + + - name: Install rust (${{ steps.metadata.outputs.msrv }}) + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ steps.metadata.outputs.msrv }} + + - name: Pin time and idna_adapter versions + run: | + cargo update + cargo update -p time --precise 0.3.20 + cargo update -p idna_adapter --precise 1.1.0 + + - uses: Swatinem/rust-cache@v2 + + - name: Check + run: cargo check + build: name: ${{ matrix.name }} runs-on: ${{ matrix.os || 'ubuntu-latest' }} - + strategy: matrix: name: @@ -25,20 +63,43 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - + - name: Install rust uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.rust || 'stable' }} profile: minimal override: true - + - name: Build uses: actions-rs/cargo@v1 with: command: build args: --verbose --all-features - + + test: + name: ${{ matrix.name }} + + runs-on: ${{ matrix.os || 'ubuntu-latest' }} + + strategy: + matrix: + name: + - linux / stable + include: + - name: linux / stable + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust || 'stable' }} + profile: minimal + override: true + - name: Run tests uses: actions-rs/cargo@v1 with: