ci.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. env:
  27. BUILD_TAGS: kube,e2e
  28. run: |
  29. curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/bin/ v1.33.0
  30. make -f builder.Makefile lint
  31. build:
  32. name: Build
  33. runs-on: ubuntu-latest
  34. env:
  35. GO111MODULE: "on"
  36. steps:
  37. - name: Set up Go 1.15
  38. uses: actions/setup-go@v1
  39. with:
  40. go-version: 1.15
  41. id: go
  42. - name: Setup docker CLI
  43. run: |
  44. curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.2.tgz | tar xz
  45. sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
  46. - name: Checkout code into the Go module directory
  47. uses: actions/checkout@v2
  48. - uses: actions/cache@v2
  49. with:
  50. path: ~/go/pkg/mod
  51. key: go-${{ hashFiles('**/go.sum') }}
  52. # Ensure we don't discover cross platform build issues at release time.
  53. # Time used to build linux here is gained back in the build for local E2E step
  54. - name: Build packages
  55. run: make -f builder.Makefile cross
  56. - name: Test
  57. env:
  58. BUILD_TAGS: kube
  59. run: make -f builder.Makefile test
  60. - name: Build for local E2E
  61. env:
  62. BUILD_TAGS: e2e
  63. run: make -f builder.Makefile cli
  64. - name: E2E Test
  65. run: make e2e-local