name: CI
on: [push, pull_request]
jobs:
  test:
    strategy:
      matrix:
        go-version: [1.17.x, 1.18.x]
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Install Go
        uses: actions/setup-go@v2
        with:
          go-version: ${{ matrix.go-version }}
      - name: Checkout code
        uses: actions/checkout@v3
      - name: Test
        run: go test -race ./...
      - name: Build
        run: go build
  lint:
    runs-on: ubuntu-latest
    steps:
      - name: Install Go
        uses: actions/setup-go@v2
        with:
          go-version: 1.18.x
      - name: Checkout
        uses: actions/checkout@v3
      - name: Lint
        uses: golangci/golangci-lint-action@v3
        with:
          version: latest
