name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
CARGO_TERM_COLOR: always
jobs:
build-and-test:
name: Test suite
runs-on: ubuntu-latest
steps:
- run: |
sudo apt-get update
sudo apt-get install pkg-config libx11-dev libwayland-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }}
- run: rustup update
- run: cargo build
- run: cargo fmt --check --all
- run: cargo clippy -- -D warnings
- run: cargo test --verbose