go.yml 722 B

12345678910111213141516171819202122232425262728293031323334353637
  1. name: Go
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. branches: [main]
  7. permissions:
  8. contents: read
  9. env:
  10. SUDO_PERMITTED: 1
  11. jobs:
  12. test:
  13. name: Test
  14. strategy:
  15. matrix:
  16. go-version: [1.16.x, 1.17.x, 1.18.x]
  17. runs-on: ubuntu-latest
  18. steps:
  19. - name: Set up Go 1.x
  20. uses: actions/setup-go@v3
  21. with:
  22. go-version: ${{ matrix.go-version }}
  23. - name: Check out repository
  24. uses: actions/checkout@v3
  25. - name: Install dependencies
  26. run: go get golang.org/x/tools/cmd/cover
  27. - name: Run tests
  28. run: ./test
  29. - name: Run linter
  30. uses: golangci/golangci-lint-action@v3
  31. with:
  32. version: v1.48.0
  33. args: -E=gofmt --timeout=30m0s