name: CI checks on: [push, pull_request] jobs: test: name: Test 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@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: cargo fetch uses: actions-rs/cargo@v1 with: command: fetch - name: Build tests uses: actions-rs/cargo@v1 with: command: build args: --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 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: Generate coverage report uses: actions-rs/tarpaulin@v0.1 with: args: --release --timeout 180 --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. - name: Check intra-doc links uses: actions-rs/cargo@v1 with: command: doc args: --document-private-items fmt: name: Rustfmt timeout-minutes: 30 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