go.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Go
  2. on:
  3. push:
  4. branches: [ master,release-*,v2,feature/**,fix/** ]
  5. pull_request:
  6. branches: [ master,release-*,v2,feature/**,fix/** ]
  7. jobs:
  8. golangci:
  9. strategy:
  10. matrix:
  11. go-version: [ '1.18','1.19','1.20','1.21.4','1.22' ]
  12. name: golangci-lint
  13. runs-on: ubuntu-latest
  14. steps:
  15. - name: Setup Golang ${{ matrix.go-version }}
  16. uses: actions/setup-go@v5
  17. with:
  18. go-version: ${{ matrix.go-version }}
  19. - name: Checkout
  20. uses: actions/checkout@v4
  21. - name: golangci-lint
  22. uses: golangci/golangci-lint-action@v6
  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.58.2
  26. build:
  27. name: Test
  28. runs-on: ubuntu-latest
  29. services:
  30. redis:
  31. image: redis
  32. ports:
  33. - 6379:6379
  34. options: --entrypoint redis-server
  35. memcached:
  36. image: memcached
  37. ports:
  38. - 11211:11211
  39. # strategy set
  40. strategy:
  41. matrix:
  42. go: [ '1.18','1.19','1.20','1.21','1.22' ]
  43. steps:
  44. - uses: actions/checkout@v4
  45. - name: Set up Go 1.x
  46. uses: actions/setup-go@v5
  47. with:
  48. go-version: ${{ matrix.go }}
  49. id: go
  50. - name: Test
  51. run: go test -v -race ./...