optional-ci.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. name: Cloud integration tests
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. jobs:
  8. check-optional-tests:
  9. name: Check if needs to run ACI or Windows tests
  10. runs-on: ubuntu-latest
  11. outputs:
  12. trigger-aci: ${{steps.runacitest.outputs.triggered}}
  13. trigger-ecs: ${{steps.runecstest.outputs.triggered}}
  14. trigger-windows: ${{steps.runwindowstest.outputs.triggered}}
  15. steps:
  16. - uses: khan/pull-request-comment-trigger@master
  17. name: Check if test ACI
  18. if: github.event_name == 'pull_request'
  19. id: runacitest
  20. with:
  21. trigger: '/test-aci'
  22. - uses: khan/pull-request-comment-trigger@master
  23. name: Check if test Windows
  24. if: github.event_name == 'pull_request'
  25. id: runwindowstest
  26. with:
  27. trigger: '/test-windows'
  28. - uses: khan/pull-request-comment-trigger@master
  29. name: Check if test ECS
  30. if: github.event_name == 'pull_request'
  31. id: runecstest
  32. with:
  33. trigger: '/test-ecs'
  34. aci-tests:
  35. name: ACI e2e tests
  36. runs-on: ubuntu-latest
  37. env:
  38. GO111MODULE: "on"
  39. needs: check-optional-tests
  40. if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-aci == 'true'
  41. steps:
  42. - name: Set up Go 1.15
  43. uses: actions/setup-go@v1
  44. with:
  45. go-version: 1.15
  46. id: go
  47. - name: Checkout code into the Go module directory
  48. uses: actions/checkout@v2
  49. - uses: actions/cache@v2
  50. with:
  51. path: ~/go/pkg/mod
  52. key: go-${{ hashFiles('**/go.sum') }}
  53. - name: Build for ACI e2e tests
  54. run: make -f builder.Makefile cli
  55. - name: ACI e2e Test
  56. env:
  57. AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
  58. AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
  59. AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
  60. run: make e2e-aci
  61. ecs-tests:
  62. name: ECS e2e tests
  63. runs-on: ubuntu-latest
  64. env:
  65. GO111MODULE: "on"
  66. needs: check-optional-tests
  67. if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-ecs == 'true'
  68. steps:
  69. - name: Set up Go 1.15
  70. uses: actions/setup-go@v1
  71. with:
  72. go-version: 1.15
  73. id: go
  74. - name: Checkout code into the Go module directory
  75. uses: actions/checkout@v2
  76. - uses: actions/cache@v2
  77. with:
  78. path: ~/go/pkg/mod
  79. key: go-${{ hashFiles('**/go.sum') }}
  80. - name: Build for ECS e2e tests
  81. run: make -f builder.Makefile cli
  82. - name: create aws config folder
  83. run: mkdir -p ~/.aws
  84. - name: ECS e2e Test
  85. env:
  86. AWS_DEFAULT_REGION: us-west-2
  87. AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
  88. AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
  89. run: make e2e-ecs
  90. windows-build:
  91. name: Windows Build
  92. runs-on: windows-latest
  93. env:
  94. GO111MODULE: "on"
  95. needs: check-optional-tests
  96. if: github.ref == 'refs/heads/main' || needs.check-optional-tests.outputs.trigger-windows == 'true'
  97. steps:
  98. - name: Set up Go 1.15
  99. uses: actions/setup-go@v1
  100. with:
  101. go-version: 1.15
  102. id: go
  103. - name: Checkout code into the Go module directory
  104. uses: actions/checkout@v2
  105. - uses: actions/cache@v2
  106. with:
  107. path: ~/go/pkg/mod
  108. key: go-${{ hashFiles('**/go.sum') }}
  109. - name: Test
  110. env:
  111. BUILD_TAGS: example,local
  112. run: make -f builder.Makefile test
  113. - name: Build
  114. env:
  115. BUILD_TAGS: example,local
  116. run: make -f builder.Makefile cli
  117. - name: E2E Test
  118. run: make e2e-win-ci
  119. - name: ACI e2e Test
  120. env:
  121. AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
  122. AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
  123. AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
  124. run: make e2e-aci