go.yml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # Maintained in https://github.com/coreos/repo-templates
  2. # Do not edit downstream.
  3. name: Go
  4. on:
  5. push:
  6. branches: [main]
  7. pull_request:
  8. branches: [main]
  9. permissions:
  10. contents: read
  11. # don't waste job slots on superseded code
  12. concurrency:
  13. group: ${{ github.workflow }}-${{ github.ref }}
  14. cancel-in-progress: true
  15. jobs:
  16. test:
  17. name: Test
  18. strategy:
  19. matrix:
  20. go-version: [1.16.x, 1.17.x, 1.18.x, 1.19.x, 1.20.x]
  21. runs-on: ubuntu-latest
  22. steps:
  23. - name: Set up Go 1.x
  24. uses: actions/setup-go@v4
  25. with:
  26. go-version: ${{ matrix.go-version }}
  27. - name: Check out repository
  28. uses: actions/checkout@v3
  29. - name: Install Go dependencies
  30. run: go get golang.org/x/tools/cmd/cover
  31. - name: Check modules
  32. run: go mod verify
  33. - name: Build
  34. run: ./build
  35. - name: Test
  36. run: SUDO_PERMITTED=1 ./test
  37. - name: Run linter
  38. uses: golangci/golangci-lint-action@v3
  39. with:
  40. version: v1.61.0
  41. args: -E=gofmt --timeout=30m0s