go.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. name: Go
  2. on:
  3. push:
  4. branches: [ main ]
  5. pull_request:
  6. branches: [ main ]
  7. jobs:
  8. build:
  9. name: "Build for go v${{ matrix.go }}"
  10. runs-on: ubuntu-latest
  11. strategy:
  12. matrix:
  13. go:
  14. - "1.22"
  15. - "1.21"
  16. - "1.20"
  17. - "1.19"
  18. - "1.18"
  19. - "1.17"
  20. - "1.16"
  21. steps:
  22. - uses: actions/checkout@v4
  23. - name: Set up Go
  24. uses: actions/setup-go@v5
  25. with:
  26. go-version: ${{ matrix.go }}
  27. - name: Build
  28. run: go build -v ./...
  29. staticcheck:
  30. name: "Static check"
  31. runs-on: ubuntu-latest
  32. steps:
  33. - uses: actions/checkout@v4
  34. - name: Set up Go
  35. uses: actions/setup-go@v5
  36. with:
  37. go-version: "1.19"
  38. - name: staticcheck
  39. run: |
  40. go install honnef.co/go/tools/cmd/staticcheck@v0.4.7 &&
  41. $HOME/go/bin/staticcheck ./...
  42. - name: Revive Action
  43. uses: morphy2k/revive-action@v2.1.1
  44. with:
  45. config: .revive.toml
  46. test:
  47. runs-on: ubuntu-latest
  48. strategy:
  49. matrix:
  50. go:
  51. - "1.22"
  52. - "1.21"
  53. - "1.20"
  54. - "1.19"
  55. - "1.18"
  56. - "1.17"
  57. - "1.16"
  58. steps:
  59. - uses: actions/checkout@v2
  60. - name: Set up Go
  61. uses: actions/setup-go@v2
  62. with:
  63. go-version: ${{ matrix.go }}
  64. - name: Test
  65. run: go test -gcflags=all=-l ./...