name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install alsa (sound driver)
run: sudo apt-get update && sudo apt-get install libasound2-dev
- name: update rustc
run: rustup update
- name: Build
run: cargo build --verbose --all-targets
- name: Run tests
run: cargo test --verbose
- run: rustup component add rustfmt
- name: check rustfmt
run: cargo fmt -- --check --color always
- run: rustup component add clippy
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
- name: generate and verify rustdoc
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --document-private-items --workspace --all-features