ci.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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.33.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: Setup docker CLI
  41. run: |
  42. curl https://download.docker.com/linux/static/stable/x86_64/docker-20.10.2.tgz | tar xz
  43. sudo cp ./docker/docker /usr/bin/ && rm -rf docker && docker version
  44. - name: Checkout code into the Go module directory
  45. uses: actions/checkout@v2
  46. - uses: actions/cache@v2
  47. with:
  48. path: ~/go/pkg/mod
  49. key: go-${{ hashFiles('**/go.sum') }}
  50. # Ensure we don't discover cross platform build issues at release time.
  51. # Time used to build linux here is gained back in the build for local E2E step
  52. - name: Build packages
  53. run: make -f builder.Makefile cross
  54. - name: Test
  55. env:
  56. BUILD_TAGS: example
  57. run: make -f builder.Makefile test
  58. - name: Build for local E2E
  59. env:
  60. BUILD_TAGS: example,e2e
  61. run: make -f builder.Makefile cli
  62. - name: E2E Test
  63. run: make e2e-local