test.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: test
  2. on:
  3. pull_request:
  4. branches:
  5. - "*"
  6. push:
  7. branches:
  8. - "*"
  9. jobs:
  10. test:
  11. runs-on: ubuntu-latest
  12. strategy:
  13. fail-fast: false
  14. matrix:
  15. go_version:
  16. - '1.22'
  17. - '1.23'
  18. - '1.24'
  19. - tip
  20. name: Test with ${{ matrix.go_version }}
  21. steps:
  22. - uses: actions/checkout@v2
  23. - name: Install Go ${{ matrix.go_version }}
  24. if: ${{ matrix.go_version != 'tip' }}
  25. uses: actions/setup-go@master
  26. with:
  27. go-version: ${{ matrix.go_version }}
  28. check-latest: true
  29. - name: Install Go ${{ matrix.go_version }}
  30. if: ${{ matrix.go_version == 'tip' }}
  31. run: |
  32. go install golang.org/dl/gotip@latest
  33. `go env GOPATH`/bin/gotip download
  34. - name: Vet and test no tip
  35. if: ${{ matrix.go_version != 'tip' }}
  36. run: |
  37. go version
  38. go vet ./...
  39. go test ./...
  40. - name: Vet and test gotip
  41. if: ${{ matrix.go_version == 'tip' }}
  42. run: |
  43. `go env GOPATH`/bin/gotip version
  44. `go env GOPATH`/bin/gotip vet ./...
  45. `go env GOPATH`/bin/gotip test ./...
  46. golangci:
  47. name: Linting
  48. runs-on: ubuntu-latest
  49. steps:
  50. - uses: actions/checkout@v2
  51. - uses: actions/setup-go@master
  52. with:
  53. go-version: '1.24'
  54. check-latest: true
  55. - name: golangci-lint
  56. uses: golangci/golangci-lint-action@v2
  57. with:
  58. version: latest
  59. skip-go-installation: true
  60. args: "--config .golangci.yml"