Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CI some more #130

Merged
merged 9 commits into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 35 additions & 33 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,89 +8,91 @@ on:

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings

jobs:
# Run unit tests.
# Run tests.
test:
name: Test Suite
name: Tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout sources
- name: Checkout repository
uses: actions/checkout@v4

- name: Install stable toolchain
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache target directory
uses: Leafwing-Studios/cargo-cache@v1

- name: Install Dependencies
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev

- name: Run cargo test
run: cargo test --all-targets
- name: Populate target directory from cache
uses: Leafwing-Studios/cargo-cache@v1

- name: Run tests
run: |
cargo test --workspace --all-targets --all-features
# Workaround for https://github.com/rust-lang/cargo/issues/6669
cargo test --workspace --doc

# Run clippy lints.
clippy_check:
name: Clippy
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout sources
- name: Checkout repository
uses: actions/checkout@v4

- name: Install stable toolchain
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Cache target directory
uses: Leafwing-Studios/cargo-cache@v1

- name: Install Dependencies
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev

- name: Run clippy
run: cargo clippy --all-targets -- -D warnings
- name: Populate target directory from cache
uses: Leafwing-Studios/cargo-cache@v1

- name: Run clippy lints
run: cargo clippy --workspace --all-targets --all-features -- --deny warnings

# Run cargo fmt --all -- --check
# Check formatting.
format:
name: Format
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout sources
- name: Checkout repository
uses: actions/checkout@v4

- name: Install stable toolchain
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Cache target directory
uses: Leafwing-Studios/cargo-cache@v1

- name: Run cargo fmt
run: cargo fmt --all -- --check

# Check documentation.
doc:
name: Doc
name: Docs
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout sources
- name: Checkout repository
uses: actions/checkout@v4

- name: Install stable toolchain
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache target directory
uses: Leafwing-Studios/cargo-cache@v1

- name: Install Dependencies
- name: Install dependencies
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev

- name: Run cargo doc
run: cargo doc --no-deps
- name: Populate target directory from cache
uses: Leafwing-Studios/cargo-cache@v1

- name: Check documentation
run: cargo doc --workspace --all-features --document-private-items --no-deps