name: Rust

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - name: Install alsa and udev
      run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
      if: runner.os == 'linux'
    - uses: actions/checkout@v3
    - name: Build
      run: cargo build --verbose --all-features
    - name: Run tests
      run: cargo test --verbose --all-features
