name: Node CI

on: [push]

jobs:
  build:
    name: Test Node.js ${{ matrix.node-version }} on ${{ matrix.os }}

    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        node-version: [8.x, 10.x, 12.x]

    runs-on: ${{ matrix.os }}

    steps:
    - uses: actions/checkout@v2

    - name: Install libasound2-dev
      run: sudo apt-get install -y libasound2-dev
      if: matrix.os == 'ubuntu-latest'

    - name: Add msbuild to PATH
      uses: microsoft/setup-msbuild@v1
      if: matrix.os == 'windows-latest'

    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node-version }}

    - name: Install Dependencies
      run: npm install

    - name: Run tests
      run: npm test
