From 8aeb9f3da772b0e15267ba17eca43c1d12c8a079 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 30 Jul 2024 05:54:36 +0000 Subject: [PATCH] CI: Test on both MSRV and latest stable --- .github/workflows/ci.yml | 45 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0366743..31d964f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,13 @@ name: CI checks -on: [push, pull_request] +on: + pull_request: + push: + branches: main jobs: - test: - name: Test on ${{ matrix.name }} + test-msrv: + name: Test MSRV on ${{ matrix.name }} runs-on: ${{ matrix.os }} strategy: matrix: @@ -35,6 +38,42 @@ jobs: - name: Verify working directory is clean run: git diff --exit-code + test-latest: + name: Test latest stable on ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + name: [linux, windows, macos] + include: + - name: linux + os: ubuntu-latest + build_deps: > + libpcsclite-dev + + - name: windows + os: windows-latest + + - name: macos + os: macos-latest + + steps: + - uses: actions/checkout@v4 + - name: Install build dependencies + run: sudo apt install ${{ matrix.build_deps }} + if: matrix.build_deps != '' + - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@stable + id: toolchain + - run: rustup override set ${{steps.toolchain.outputs.name}} + - name: Install test dependencies + run: cargo install rage + - name: Remove lockfile to build with latest dependencies + run: rm Cargo.lock + - name: Run tests + run: cargo test + - name: Verify working directory is clean (excluding lockfile) + run: git diff --exit-code ':!Cargo.lock' + codecov: name: Code coverage runs-on: ubuntu-latest