| 1 |
on: [push, pull_request] |
| 2 |
name: Test |
| 3 |
jobs: |
| 4 |
test: |
| 5 |
strategy: |
| 6 |
matrix: |
| 7 |
go-version: [1.19.x, 1.20.x] |
| 8 |
os: [ubuntu-latest, macos-11, windows-latest] |
| 9 |
runs-on: ${{ matrix.os }} |
| 10 |
steps: |
| 11 |
- uses: actions/setup-go@v3 |
| 12 |
with: |
| 13 |
go-version: ${{ matrix.go-version }} |
| 14 |
- uses: actions/checkout@v3 |
| 15 |
- run: go test ./... |
| 16 |
- run: go test -race ./... |
| 17 |
|
| 18 |
# Static checks from this point forward. Only run on one Go version and on |
| 19 |
# Linux, since it's the fastest platform, and the tools behave the same. |
| 20 |
- if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.20.x' |
| 21 |
run: diff <(echo -n) <(gofmt -s -d .) |
| 22 |
- if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.20.x' |
| 23 |
run: go vet ./... |