name: tests

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

jobs:

  build:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
        go-version: [1.17.x]
        include:
          - go-version: 1.16.x
            os: ubuntu-latest

    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v2

    - name: Set up Go
      uses: actions/setup-go@v2
      with:
        go-version: ${{ matrix.go-version }}

    - name: Build
      run: go build -v ./...

    - name: Test
      shell: bash
      run: 'internal/test.sh'
