diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc768ab..7430cb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,118 +23,42 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - override: true - name: Install build dependencies run: sudo apt install ${{ matrix.build_deps }} if: matrix.build_deps != '' - name: Install test dependencies run: cargo install rage - - name: cargo fetch - uses: actions-rs/cargo@v1 - with: - command: fetch + - run: cargo fetch - name: Build tests - uses: actions-rs/cargo@v1 - with: - command: build - args: --verbose --tests + run: cargo build --verbose --tests - name: Run tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --verbose - - clippy: - name: Clippy (1.60.0) - timeout-minutes: 30 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.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.60.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@v3 - - 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 + run: cargo test --verbose codecov: name: Code coverage runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - # Use stable for this to ensure that cargo-tarpaulin can be built. - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - name: Install build dependencies run: sudo apt install libpcsclite-dev + - name: Install coverage dependencies + run: cargo install cargo-tarpaulin - name: Generate coverage report - uses: actions-rs/tarpaulin@v0.1 - with: - args: --release --timeout 180 --out Xml + run: cargo tarpaulin --engine llvm --all-features --release --timeout 600 --out Xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v3.1.1 - with: - token: ${{secrets.CODECOV_TOKEN}} doc-links: name: Intra-doc links runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - override: true - name: Install build dependencies run: sudo apt install libpcsclite-dev - - name: cargo fetch - uses: actions-rs/cargo@v1 - with: - command: fetch - - # Ensure intra-documentation links all resolve correctly - # Requires #![deny(intra_doc_link_resolution_failure)] in crates. + - run: cargo fetch + # Requires #![deny(rustdoc::broken_intra_doc_links)] in crates. - name: Check intra-doc links - uses: actions-rs/cargo@v1 - with: - command: doc - args: --document-private-items + run: cargo doc --document-private-items fmt: name: Rustfmt @@ -142,13 +66,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.60.0 - components: rustfmt - override: true - name: Check formatting - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check + run: cargo fmt -- --check diff --git a/.github/workflows/lints-beta.yml b/.github/workflows/lints-beta.yml new file mode 100644 index 0000000..3129eca --- /dev/null +++ b/.github/workflows/lints-beta.yml @@ -0,0 +1,23 @@ +name: Beta lints + +# We only run these lints on trial-merges of PRs to reduce noise. +on: pull_request + +jobs: + clippy-beta: + name: Clippy (beta) + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@beta + id: toolchain + - run: rustup override set ${{steps.toolchain.outputs.name}} + - name: Install build dependencies + run: sudo apt install libpcsclite-dev + - name: Clippy (beta) + uses: actions-rs/clippy-check@v1 + with: + name: Clippy (beta) + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features --all-targets -- -W clippy::all diff --git a/.github/workflows/lints-stable.yml b/.github/workflows/lints-stable.yml new file mode 100644 index 0000000..d8bf84a --- /dev/null +++ b/.github/workflows/lints-stable.yml @@ -0,0 +1,20 @@ +name: Stable lints + +# We only run these lints on trial-merges of PRs to reduce noise. +on: pull_request + +jobs: + clippy: + name: Clippy (MSRV) + timeout-minutes: 30 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install build dependencies + run: sudo apt install libpcsclite-dev + - name: Run clippy + uses: actions-rs/clippy-check@v1 + with: + name: Clippy (MSRV) + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features --all-targets -- -D warnings diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index 4d5fde5..0000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -1.60.0 diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..47fd09e --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.60.0" +components = ["clippy", "rustfmt"]