build.yml

 1name: build
 2on: [push, pull_request]
 3
 4permissions:
 5  contents: read
 6
 7concurrency:
 8  group: build-${{ github.event.pull_request.number || github.ref }}
 9  cancel-in-progress: true
10
11jobs:
12  build:
13    strategy:
14      matrix:
15        os: [ubuntu-latest, macos-latest, windows-latest]
16    runs-on: ${{ matrix.os }}
17    steps:
18      - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
19        with:
20          persist-credentials: false
21      - uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
22        with:
23          go-version-file: go.mod
24      - run: go mod tidy
25      - run: git diff --exit-code
26      - run: go build -race ./...
27      - run: go test -race -failfast ./...