name: tests

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

jobs:

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

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

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

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

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