Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nicopap committed Dec 6, 2023
1 parent 2fa5078 commit b142488
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Continous Integration

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
CARGO_TERM_COLORS: always

jobs:
clippy_fmt_docs_check:
name: Check clippy lints, formatting and docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- name: Check formatting
run: cargo fmt --all -- --check

- name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev

- name: Check clippy with no default features
run: cargo clippy --no-default-features --workspace -- --deny clippy::all

- name: Check clippy
run: cargo clippy --workspace -- --deny clippy::all

- name: Check docs
run: cargo doc --workspace --no-deps
env:
RUSTDOCFLAGS: "-D warnings"

- name: Run tests
run: cargo test --workspace
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ run:
cargo run --example all_attributes

pre-hook:
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps
cargo clippy --workspace $(CLIPPY_ARGS)
cargo fmt --all -- --check
cargo clippy --workspace --no-default-features
cargo test -j12
cargo clippy --workspace --no-default-features $(CLIPPY_ARGS)
cargo clippy --workspace $(CLIPPY_ARGS)
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps
cargo test --workspace -j12

0 comments on commit b142488

Please sign in to comment.