name: CI

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

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install system dependencies
        run: sudo apt-get update && sudo apt-get install -y libasound2-dev pkg-config
      - name: Install Rust toolchain
        run: rustup show
      - name: Cache cargo
        uses: swatinem/rust-cache@v2
      - name: Check formatting
        run: cargo fmt --check
      - name: Lint
        run: cargo clippy --all-targets --all-features -- -D warnings
      - name: Build
        run: cargo build
      - name: Test
        run: cargo test
