| 1 | name: Checks |
| 2 | on: |
| 3 | push: |
| 4 | branches: |
| 5 | - master |
| 6 | pull_request: |
| 7 | |
| 8 | jobs: |
| 9 | go-checks: |
| 10 | name: Go checks |
| 11 | runs-on: ubuntu-latest |
| 12 | steps: |
| 13 | - uses: actions/checkout@v4 |
| 14 | |
| 15 | - uses: actions/setup-go@v5 |
| 16 | with: |
| 17 | go-version: stable |
| 18 | |
| 19 | - name: Check go.mod |
| 20 | run: | |
| 21 | go mod tidy |
| 22 | git diff --exit-code -- go.mod |
| 23 | git diff --exit-code -- go.sum |
| 24 | |
| 25 | - name: Run gofmt |
| 26 | run: | |
| 27 | find . -type f -name '*.go' -not -path './fixtures/*' -exec gofmt -w {} + |
| 28 | git diff --exit-code |
| 29 | |
| 30 | tests: |
| 31 | name: Tests |
| 32 | strategy: |
| 33 | fail-fast: false |
| 34 | matrix: |
| 35 | go-version: |
| 36 | - oldstable |
| 37 | - stable |
| 38 | os: |
| 39 | - ubuntu-latest |
| 40 | - windows-latest |
| 41 | runs-on: ${{ matrix.os }} |
| 42 | steps: |
| 43 | - uses: actions/checkout@v4 |
| 44 | |
| 45 | - uses: actions/setup-go@v5 |
| 46 | with: |
| 47 | go-version: ${{ matrix.go-version }} |
| 48 | |
| 49 | - name: Run tests |
| 50 | run: go test -race -shuffle=on ./... |