| 1 | name: Test |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: |
| 6 | - main |
| 7 | pull_request: |
| 8 | branches: |
| 9 | - main |
| 10 | |
| 11 | concurrency: |
| 12 | group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}' |
| 13 | cancel-in-progress: true |
| 14 | |
| 15 | jobs: |
| 16 | lint: |
| 17 | runs-on: 'ubuntu-latest' |
| 18 | |
| 19 | steps: |
| 20 | - uses: 'actions/checkout@v4' |
| 21 | |
| 22 | - uses: 'actions/setup-go@v5' |
| 23 | with: |
| 24 | cache: false |
| 25 | go-version-file: 'go.mod' |
| 26 | |
| 27 | - uses: 'golangci/golangci-lint-action@v4' |
| 28 | with: |
| 29 | version: 'v1.57.2' |
| 30 | skip-cache: true |
| 31 | |
| 32 | test: |
| 33 | strategy: |
| 34 | matrix: |
| 35 | platform: |
| 36 | - 'macos-latest' |
| 37 | - 'ubuntu-latest' |
| 38 | - 'windows-latest' |
| 39 | fail-fast: false |
| 40 | |
| 41 | runs-on: '${{ matrix.platform }}' |
| 42 | |
| 43 | steps: |
| 44 | - uses: 'actions/checkout@v4' |
| 45 | |
| 46 | - uses: 'actions/setup-go@v5' |
| 47 | with: |
| 48 | cache: false |
| 49 | go-version-file: 'go.mod' |
| 50 | |
| 51 | - shell: 'bash' |
| 52 | run: |- |
| 53 | go test \ |
| 54 | -count=1 \ |
| 55 | -race \ |
| 56 | -shuffle=on \ |
| 57 | -timeout=5m \ |
| 58 | -vet=all \ |
| 59 | ./... |