-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e49b39
commit 1e0c688
Showing
1 changed file
with
100 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
RUSTFLAGS: --deny warnings | ||
RUSTDOCFLAGS: --deny warnings | ||
|
||
jobs: | ||
# Check formatting. | ||
format: | ||
name: Format | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rustfmt | ||
|
||
- name: Check formatting | ||
run: cargo fmt --all -- --check | ||
|
||
# Run Clippy lints. | ||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev | ||
|
||
- name: Populate target directory from cache | ||
uses: Leafwing-Studios/cargo-cache@v2 | ||
|
||
- name: Run Clippy lints | ||
run: | | ||
cargo clippy --workspace --all-features --all-targets -- --deny warnings | ||
# Check documentation. | ||
doc: | ||
name: Docs | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev | ||
|
||
- name: Populate target directory from cache | ||
uses: Leafwing-Studios/cargo-cache@v2 | ||
|
||
- name: Check documentation | ||
run: | | ||
cargo doc --workspace --all-features --document-private-items --no-deps | ||
# Run tests. | ||
test: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev | ||
|
||
- name: Populate target directory from cache | ||
uses: Leafwing-Studios/cargo-cache@v2 | ||
|
||
- name: Run tests | ||
run: | | ||
cargo test --workspace --all-features --all-targets | ||
# TODO: Workaround for https://github.com/rust-lang/cargo/issues/6669 | ||
cargo test --workspace --all-features --doc |