refactor: simplify nusb compilation guards #140
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CI on Pull Requests | |
on: | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
commitlint: | |
name: Lint Commit Messages | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: wagoid/commitlint-github-action@v5 | |
doc: | |
name: Build Doc | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -D warnings | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: nightly | |
components: rustfmt | |
- name: run cargo doc | |
run: cargo doc | |
formatting: | |
name: Code Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
components: rustfmt | |
- name: running rustfmt | |
run: | | |
files=$(find . -name '*.rs') | |
IFS=$'\n'; for file in $files; do | |
rustfmt --check "$file" | |
done | |
build: | |
name: Build the project | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -D warnings | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: Build the project with rusb support | |
run: cargo build --no-default-features --features rusb | |
- name: Build the project with nusb support | |
run: cargo build --no-default-features --features nusb | |
- name: Build the examples | |
run: cargo build --examples | |
test: | |
name: Test Suite | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -D warnings | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
- name: run cargo test | |
run: cargo test | |
coverage: | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
container: | |
image: docker.io/xd009642/tarpaulin:0.31.0 | |
options: --security-opt seccomp=unconfined | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Verify code coverage | |
run: | | |
cargo tarpaulin --verbose --timeout 120 |