_pr_entrypoint.yaml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. name: PR Entrypoint
  2. concurrency:
  3. group: pr-entrypoint-${{ github.event_name }}-${{ github.ref }}
  4. cancel-in-progress: true
  5. on:
  6. pull_request:
  7. workflow_dispatch:
  8. inputs:
  9. ref:
  10. required: false
  11. env:
  12. IS_CI: "yes"
  13. jobs:
  14. sanity-checks:
  15. runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }}
  16. container: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
  17. outputs:
  18. ct-matrix: ${{ steps.matrix.outputs.ct-matrix }}
  19. ct-host: ${{ steps.matrix.outputs.ct-host }}
  20. ct-docker: ${{ steps.matrix.outputs.ct-docker }}
  21. version-emqx: ${{ steps.matrix.outputs.version-emqx }}
  22. version-emqx-enterprise: ${{ steps.matrix.outputs.version-emqx-enterprise }}
  23. runner: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }}
  24. builder: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
  25. builder_vsn: "5.1-3"
  26. otp_vsn: "25.3.2-1"
  27. elixir_vsn: "1.14.5"
  28. steps:
  29. - uses: actions/checkout@v3
  30. with:
  31. ref: ${{ github.event.inputs.ref }}
  32. fetch-depth: 0
  33. - name: Work around https://github.com/actions/checkout/issues/766
  34. run: |
  35. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  36. - uses: ./.github/actions/pr-sanity-checks
  37. - name: Build matrix
  38. id: matrix
  39. run: |
  40. APPS="$(./scripts/find-apps.sh --ci)"
  41. MATRIX="$(echo "${APPS}" | jq -c '
  42. [
  43. (.[] | select(.profile == "emqx") | . + {
  44. builder: "5.1-3",
  45. otp: "25.3.2-1",
  46. elixir: "1.14.5"
  47. }),
  48. (.[] | select(.profile == "emqx-enterprise") | . + {
  49. builder: "5.1-3",
  50. otp: ["25.3.2-1"][],
  51. elixir: "1.14.5"
  52. })
  53. ]
  54. ')"
  55. echo "${MATRIX}" | jq
  56. CT_MATRIX="$(echo "${MATRIX}" | jq -c 'map({profile, builder, otp, elixir}) | unique')"
  57. CT_HOST="$(echo "${MATRIX}" | jq -c 'map(select(.runner == "host"))')"
  58. CT_DOCKER="$(echo "${MATRIX}" | jq -c 'map(select(.runner == "docker"))')"
  59. echo "ct-matrix=${CT_MATRIX}" | tee -a $GITHUB_OUTPUT
  60. echo "ct-host=${CT_HOST}" | tee -a $GITHUB_OUTPUT
  61. echo "ct-docker=${CT_DOCKER}" | tee -a $GITHUB_OUTPUT
  62. echo "version-emqx=$(./pkg-vsn.sh emqx)" | tee -a $GITHUB_OUTPUT
  63. echo "version-emqx-enterprise=$(./pkg-vsn.sh emqx-enterprise)" | tee -a $GITHUB_OUTPUT
  64. compile:
  65. runs-on: ${{ needs.sanity-checks.outputs.runner }}
  66. container: ${{ needs.sanity-checks.outputs.builder }}
  67. needs:
  68. - sanity-checks
  69. strategy:
  70. matrix:
  71. profile:
  72. - emqx
  73. - emqx-enterprise
  74. steps:
  75. - uses: actions/checkout@v3
  76. with:
  77. fetch-depth: 0
  78. - name: Work around https://github.com/actions/checkout/issues/766
  79. run: |
  80. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  81. - id: compile
  82. env:
  83. PROFILE: ${{ matrix.profile }}
  84. ENABLE_COVER_COMPILE: 1
  85. run: |
  86. make $PROFILE
  87. zip -ryq $PROFILE.zip .
  88. - uses: actions/upload-artifact@v3
  89. with:
  90. name: ${{ matrix.profile }}
  91. path: ${{ matrix.profile }}.zip
  92. retention-days: 1
  93. run_test_cases:
  94. needs:
  95. - sanity-checks
  96. - compile
  97. uses: ./.github/workflows/run_test_cases.yaml
  98. with:
  99. runner: ${{ needs.sanity-checks.outputs.runner }}
  100. builder: ${{ needs.sanity-checks.outputs.builder }}
  101. ct-matrix: ${{ needs.sanity-checks.outputs.ct-matrix }}
  102. ct-host: ${{ needs.sanity-checks.outputs.ct-host }}
  103. ct-docker: ${{ needs.sanity-checks.outputs.ct-docker }}
  104. static_checks:
  105. needs:
  106. - sanity-checks
  107. - compile
  108. uses: ./.github/workflows/static_checks.yaml
  109. with:
  110. runner: ${{ needs.sanity-checks.outputs.runner }}
  111. builder: ${{ needs.sanity-checks.outputs.builder }}
  112. ct-matrix: ${{ needs.sanity-checks.outputs.ct-matrix }}
  113. build_slim_packages:
  114. needs:
  115. - sanity-checks
  116. uses: ./.github/workflows/build_slim_packages.yaml
  117. with:
  118. runner: ${{ needs.sanity-checks.outputs.runner }}
  119. builder: ${{ needs.sanity-checks.outputs.builder }}
  120. builder_vsn: ${{ needs.sanity-checks.outputs.builder_vsn }}
  121. otp_vsn: ${{ needs.sanity-checks.outputs.otp_vsn }}
  122. elixir_vsn: ${{ needs.sanity-checks.outputs.elixir_vsn }}
  123. build_docker_for_test:
  124. needs:
  125. - sanity-checks
  126. uses: ./.github/workflows/build_docker_for_test.yaml
  127. with:
  128. otp_vsn: ${{ needs.sanity-checks.outputs.otp_vsn }}
  129. elixir_vsn: ${{ needs.sanity-checks.outputs.elixir_vsn }}
  130. version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }}
  131. version-emqx-enterprise: ${{ needs.sanity-checks.outputs.version-emqx-enterprise }}
  132. spellcheck:
  133. needs:
  134. - sanity-checks
  135. - build_slim_packages
  136. uses: ./.github/workflows/spellcheck.yaml
  137. with:
  138. runner: ${{ needs.sanity-checks.outputs.runner }}
  139. run_conf_tests:
  140. needs:
  141. - sanity-checks
  142. - compile
  143. uses: ./.github/workflows/run_conf_tests.yaml
  144. with:
  145. runner: ${{ needs.sanity-checks.outputs.runner }}
  146. builder: ${{ needs.sanity-checks.outputs.builder }}
  147. check_deps_integrity:
  148. needs:
  149. - sanity-checks
  150. uses: ./.github/workflows/check_deps_integrity.yaml
  151. with:
  152. runner: ${{ needs.sanity-checks.outputs.runner }}
  153. builder: ${{ needs.sanity-checks.outputs.builder }}
  154. run_jmeter_tests:
  155. needs:
  156. - sanity-checks
  157. - build_docker_for_test
  158. uses: ./.github/workflows/run_jmeter_tests.yaml
  159. with:
  160. version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }}
  161. run_docker_tests:
  162. needs:
  163. - sanity-checks
  164. - build_docker_for_test
  165. uses: ./.github/workflows/run_docker_tests.yaml
  166. with:
  167. runner: ${{ needs.sanity-checks.outputs.runner }}
  168. version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }}
  169. version-emqx-enterprise: ${{ needs.sanity-checks.outputs.version-emqx-enterprise }}
  170. run_helm_tests:
  171. needs:
  172. - sanity-checks
  173. - build_docker_for_test
  174. uses: ./.github/workflows/run_helm_tests.yaml
  175. with:
  176. version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }}
  177. version-emqx-enterprise: ${{ needs.sanity-checks.outputs.version-emqx-enterprise }}