name: Tests

on:
  push:
    branches:
    - master
  pull_request:
    branches:
    - master

jobs:
  test:
    strategy:
      matrix:
        # Minimum supported version (1.13) and the latest two
        go-version: [1.13, 1.17, 1.18]
        platform: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.platform }}

    steps:
    - name: Install Go
      uses: actions/setup-go@v3
      with:
        go-version: ${{ matrix.go-version }}

    - name: Checkout code
      uses: actions/checkout@v3

    - name: Check formatting
      if: matrix.go-version == '1.18' && matrix.platform == 'ubuntu-latest'
      run: diff -u <(echo -n) <(go fmt $(go list ./...))

    - name: Check module vendoring
      if: matrix.go-version == '1.18' && matrix.platform == 'ubuntu-latest'
      run: |
        go mod tidy
        go mod vendor
        git diff --exit-code || exit 1

    - name: Run unit tests
      run: go test -race -v ./...

name: Tests

on:
  push:
    branches:
    - master
  pull_request:
    branches:
    - master

jobs:
  test:
    strategy:
      matrix:
        # Minimum supported version (1.13) and the latest two
        go-version: [1.13, 1.18, 1.19]
        platform: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.platform }}

    steps:
    - name: Install Go
      uses: actions/setup-go@v3
      with:
        go-version: ${{ matrix.go-version }}

    - name: Checkout code
      uses: actions/checkout@v3

    - name: Check formatting
      if: matrix.go-version == '1.19' && matrix.platform == 'ubuntu-latest'
      run: diff -u <(echo -n) <(go fmt $(go list ./...))

    - name: Check module vendoring
      if: matrix.go-version == '1.19' && matrix.platform == 'ubuntu-latest'
      run: |
        go mod tidy
        go mod vendor
        git diff --exit-code || exit 1

    - name: Run unit tests
      run: go test -race -v ./...

Update CI to Go 1.19
Update CI to Go 1.19
