go.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: Go
  2. on:
  3. push:
  4. branches: [ master,release-*,v2,feature/** ]
  5. pull_request:
  6. branches: [ master,release-*,v2,feature/** ]
  7. jobs:
  8. golangci:
  9. strategy:
  10. matrix:
  11. go-version: [ '1.16','1.17','1.18','1.19','1.20','1.21' ]
  12. name: golangci-lint
  13. runs-on: ubuntu-latest
  14. steps:
  15. - name: Setup Golang ${{ matrix.go-version }}
  16. uses: actions/setup-go@v4
  17. with:
  18. go-version: ${{ matrix.go-version }}
  19. - name: Checkout
  20. uses: actions/checkout@v3
  21. - name: golangci-lint
  22. uses: golangci/golangci-lint-action@v3
  23. with:
  24. # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
  25. version: v1.52.2
  26. build:
  27. name: Test
  28. runs-on: ubuntu-latest
  29. services:
  30. memcached:
  31. image: memcached
  32. ports:
  33. - 11211:11211
  34. # strategy set
  35. strategy:
  36. matrix:
  37. go: [ '1.16','1.17','1.18','1.19','1.20','1.21' ]
  38. steps:
  39. - uses: actions/checkout@v3
  40. - name: Set up Go 1.x
  41. uses: actions/setup-go@v4
  42. with:
  43. go-version: ${{ matrix.go }}
  44. id: go
  45. - name: Test
  46. run: go test -v -race ./...