ci.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. name: Continuous integration
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. jobs:
  8. lint:
  9. name: Lint
  10. runs-on: ubuntu-latest
  11. env:
  12. GO111MODULE: "on"
  13. steps:
  14. - name: Set up Go 1.15
  15. uses: actions/setup-go@v1
  16. with:
  17. go-version: 1.15
  18. id: go
  19. - name: Checkout code into the Go module directory
  20. uses: actions/checkout@v2
  21. - name: Validate go-mod is up-to-date and license headers
  22. run: make validate
  23. - name: Validate imports
  24. run: make import-restrictions
  25. - name: Run golangci-lint
  26. run: |
  27. curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b . v1.30.0
  28. ./golangci-lint run --timeout 10m0s
  29. build:
  30. name: Build
  31. runs-on: ubuntu-latest
  32. env:
  33. GO111MODULE: "on"
  34. steps:
  35. - name: Set up Go 1.15
  36. uses: actions/setup-go@v1
  37. with:
  38. go-version: 1.15
  39. id: go
  40. - name: Checkout code into the Go module directory
  41. uses: actions/checkout@v2
  42. - uses: actions/cache@v2
  43. with:
  44. path: ~/go/pkg/mod
  45. key: go-${{ hashFiles('**/go.sum') }}
  46. # Ensure we don't discover cross platform build issues at release time.
  47. # Time used to build linux here is gained back in the build for local E2E step
  48. - name: Build packages
  49. run: make -f builder.Makefile cross
  50. - name: Test
  51. env:
  52. BUILD_TAGS: example,local
  53. run: make -f builder.Makefile test
  54. - name: Build for local E2E
  55. env:
  56. BUILD_TAGS: example,local,e2e
  57. run: make -f builder.Makefile cli
  58. - name: E2E Test
  59. run: make e2e-local