ci.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. name: Continuous integration
  2. on: [push]
  3. jobs:
  4. lint:
  5. name: Lint
  6. runs-on: ubuntu-latest
  7. env:
  8. GO111MODULE: "on"
  9. steps:
  10. - name: Set up Go 1.15
  11. uses: actions/setup-go@v1
  12. with:
  13. go-version: 1.15
  14. id: go
  15. - name: Checkout code into the Go module directory
  16. uses: actions/checkout@v2
  17. # https://github.com/dependabot/dependabot-core/issues/1995
  18. - name: Update dependabot PR
  19. if: github.event.pusher.name == 'dependabot-preview'
  20. run: |
  21. git config --local user.email "[email protected]"
  22. git config --local user.name "CI GitHub Action"
  23. go mod tidy -v
  24. git add .
  25. git commit -sm'Update go.sum after dependabot PR'
  26. - name: Update dependabot PR if needed
  27. if: github.event.pusher.name == 'dependabot-preview'
  28. uses: ad-m/github-push-action@master
  29. with:
  30. github_token: ${{ secrets.GITHUB_TOKEN }}
  31. branch: ${{ github.ref }}
  32. force: false
  33. - name: Validate go-mod is up-to-date and license headers
  34. run: make validate
  35. - name: Validate imports
  36. run: make import-restrictions
  37. - name: Run golangci-lint
  38. run: |
  39. curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b . v1.30.0
  40. ./golangci-lint run --timeout 10m0s
  41. build:
  42. name: Build
  43. runs-on: ubuntu-latest
  44. env:
  45. GO111MODULE: "on"
  46. steps:
  47. - name: Set up Go 1.15
  48. uses: actions/setup-go@v1
  49. with:
  50. go-version: 1.15
  51. id: go
  52. - name: Checkout code into the Go module directory
  53. uses: actions/checkout@v2
  54. - uses: actions/cache@v2
  55. with:
  56. path: ~/go/pkg/mod
  57. key: go-${{ hashFiles('**/go.sum') }}
  58. - name: Test
  59. env:
  60. BUILD_TAGS: example,local,ecs
  61. run: make -f builder.Makefile test
  62. - name: Build
  63. env:
  64. BUILD_TAGS: example,local,ecs
  65. run: make -f builder.Makefile cli
  66. - name: E2E Test
  67. run: make e2e-local