name: Test

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

env:
  CARGO_TERM_COLOR: always

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - name: Installing needed Ubuntu dependencies
      run: |
        sudo apt-get update
        sudo apt-get install libasound2-dev
    - name: Install latest stable rust toolchain
      uses: actions-rs/toolchain@v1
      with:
        toolchain: stable
    - uses: actions/checkout@v3
    - name: Build
      run: cargo build --verbose
    - name: Run tests
      run: cargo test --verbose
