name: CI

on:
  push:
    branches:
      - '**'
  pull_request:
    branches:
      - '**'

jobs:
  test:
    name: Node.js v${{ matrix.nodejs }} (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    timeout-minutes: 5
    strategy:
      matrix:
        nodejs: [16]
        os: [ubuntu-latest, windows-latest, macos-latest]
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.nodejs }}

    - name: Install and link
      run: yarn install --frozen-lockfile && yarn build

    - name: Test
      run: yarn test