80 lines
2.1 KiB
YAML
80 lines
2.1 KiB
YAML
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@v4
|
|
- name: Install build dependencies
|
|
run: sudo apt install ${{ matrix.build_deps }}
|
|
if: matrix.build_deps != ''
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
id: stable-toolchain
|
|
- name: Install test dependencies using latest stable Rust
|
|
run: cargo +${{steps.stable-toolchain.outputs.name}} install rage
|
|
- name: Run tests
|
|
run: cargo test
|
|
- name: Verify working directory is clean
|
|
run: git diff --exit-code
|
|
|
|
codecov:
|
|
name: Code coverage
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: xd009642/tarpaulin:develop-nightly
|
|
options: --security-opt seccomp=unconfined
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install build dependencies
|
|
run: apt update && apt install -y libpcsclite-dev
|
|
- name: Generate coverage report
|
|
run: >
|
|
cargo tarpaulin
|
|
--engine llvm
|
|
--timeout 180
|
|
--out xml
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v4.5.0
|
|
with:
|
|
fail_ci_if_error: true
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
doc-links:
|
|
name: Intra-doc links
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install build dependencies
|
|
run: sudo apt install libpcsclite-dev
|
|
- run: cargo fetch
|
|
# Requires #![deny(rustdoc::broken_intra_doc_links)] in crates.
|
|
- name: Check intra-doc links
|
|
run: cargo doc --document-private-items
|
|
|
|
fmt:
|
|
name: Rustfmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Check formatting
|
|
run: cargo fmt -- --check
|