build.yml 718 B

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