From 258e88d5f93eb6a9aa780ab0bdeea7bed508df91 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 29 Mar 2021 11:24:16 +1300 Subject: [PATCH] CI: Bump to Rust 1.51 and update workflow --- .github/workflows/ci.yml | 92 +++++++++++++++++++++++++++------------- 1 file changed, 62 insertions(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52bfdb0..ce744db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,33 +3,6 @@ name: CI checks on: [push, pull_request] jobs: - lint: - name: Lint - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.44.0 - override: true - - name: Install build dependencies - run: sudo apt install libpcsclite-dev - - # Ensure all code has been formatted with rustfmt - - run: rustup component add rustfmt - - name: Check formatting - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check --color always - - - run: rustup component add clippy - - name: Clippy check - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - test: name: Test on ${{ matrix.name }} runs-on: ${{ matrix.os }} @@ -52,7 +25,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: 1.44.0 + toolchain: 1.51.0 override: true - name: Install build dependencies run: sudo apt install ${{ matrix.build_deps }} @@ -72,12 +45,55 @@ jobs: command: test args: --verbose + clippy: + name: Clippy (1.51.0) + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: 1.51.0 + components: clippy + override: true + - name: Install build dependencies + run: sudo apt install libpcsclite-dev + - name: Run clippy + uses: actions-rs/clippy-check@v1 + with: + name: Clippy (1.51.0) + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features --all-targets -- -D warnings + + clippy-nightly: + name: Clippy (nightly) + timeout-minutes: 30 + runs-on: ubuntu-latest + continue-on-error: true + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + components: clippy + override: true + - name: Install build dependencies + run: sudo apt install libpcsclite-dev + - name: Run Clippy (nightly) + uses: actions-rs/clippy-check@v1 + continue-on-error: true + with: + name: Clippy (nightly) + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features --all-targets + codecov: name: Code coverage runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + # Use stable for this to ensure that cargo-tarpaulin can be built. - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -94,14 +110,14 @@ jobs: token: ${{secrets.CODECOV_TOKEN}} doc-links: - name: Nightly lint + name: Intra-doc links runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly + toolchain: 1.51.0 override: true - name: Install build dependencies run: sudo apt install libpcsclite-dev @@ -117,3 +133,19 @@ jobs: with: command: doc args: --document-private-items + + fmt: + name: Rustfmt + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: 1.51.0 + override: true + - run: rustup component add rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check