_pr_entrypoint.yaml 6.0 KB

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