build_packages_cron.yaml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. name: Scheduled build packages
  2. concurrency:
  3. group: build-${{ github.event_name }}-${{ github.ref }}
  4. cancel-in-progress: true
  5. on:
  6. schedule:
  7. - cron: '0 */6 * * *'
  8. workflow_dispatch:
  9. jobs:
  10. linux:
  11. if: github.repository_owner == 'emqx'
  12. runs-on: aws-${{ matrix.arch }}
  13. container:
  14. image: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}"
  15. strategy:
  16. fail-fast: false
  17. matrix:
  18. profile:
  19. - ['emqx', 'master']
  20. - ['emqx-enterprise', 'release-51']
  21. - ['emqx-enterprise', 'release-52']
  22. otp:
  23. - 25.3.2-2
  24. arch:
  25. - amd64
  26. os:
  27. - debian10
  28. - ubuntu22.04
  29. - amzn2023
  30. builder:
  31. - 5.1-4
  32. elixir:
  33. - 1.14.5
  34. defaults:
  35. run:
  36. shell: bash
  37. steps:
  38. - uses: emqx/self-hosted-cleanup-action@v1.0.3
  39. - uses: actions/checkout@v3
  40. with:
  41. ref: ${{ matrix.profile[1] }}
  42. fetch-depth: 0
  43. - name: fix workdir
  44. run: |
  45. set -eu
  46. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  47. # Align path for CMake caches
  48. if [ ! "$PWD" = "/emqx" ]; then
  49. ln -s $PWD /emqx
  50. cd /emqx
  51. fi
  52. echo "pwd is $PWD"
  53. - name: build emqx packages
  54. env:
  55. PROFILE: ${{ matrix.profile[0] }}
  56. ACLOCAL_PATH: "/usr/share/aclocal:/usr/local/share/aclocal"
  57. run: |
  58. set -eu
  59. make "${PROFILE}-tgz"
  60. make "${PROFILE}-pkg"
  61. - name: test emqx packages
  62. env:
  63. PROFILE: ${{ matrix.profile[0] }}
  64. run: |
  65. set -eu
  66. ./scripts/pkg-tests.sh "${PROFILE}-tgz"
  67. ./scripts/pkg-tests.sh "${PROFILE}-pkg"
  68. - uses: actions/upload-artifact@v3
  69. if: success()
  70. with:
  71. name: ${{ matrix.profile[0] }}
  72. path: _packages/${{ matrix.profile[0] }}/
  73. - name: Send notification to Slack
  74. uses: slackapi/slack-github-action@v1.23.0
  75. if: failure()
  76. env:
  77. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  78. with:
  79. payload: |
  80. {"text": "Scheduled build of ${{ matrix.profile[0] }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
  81. mac:
  82. runs-on: ${{ matrix.os }}
  83. if: github.repository_owner == 'emqx'
  84. strategy:
  85. fail-fast: false
  86. matrix:
  87. profile:
  88. - emqx
  89. branch:
  90. - master
  91. otp:
  92. - 25.3.2-2
  93. os:
  94. - macos-13
  95. - macos-12-arm64
  96. steps:
  97. - uses: emqx/self-hosted-cleanup-action@v1.0.3
  98. - uses: actions/checkout@v3
  99. with:
  100. ref: ${{ matrix.branch }}
  101. fetch-depth: 0
  102. - uses: ./.github/actions/package-macos
  103. with:
  104. profile: ${{ matrix.profile }}
  105. otp: ${{ matrix.otp }}
  106. os: ${{ matrix.os }}
  107. apple_id_password: ${{ secrets.APPLE_ID_PASSWORD }}
  108. apple_developer_identity: ${{ secrets.APPLE_DEVELOPER_IDENTITY }}
  109. apple_developer_id_bundle: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }}
  110. apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }}
  111. - uses: actions/upload-artifact@v3
  112. if: success()
  113. with:
  114. name: ${{ matrix.profile }}
  115. path: _packages/${{ matrix.profile }}/
  116. retention-days: 7
  117. - name: Send notification to Slack
  118. uses: slackapi/slack-github-action@v1.23.0
  119. if: failure()
  120. env:
  121. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  122. with:
  123. payload: |
  124. {"text": "Scheduled build of ${{ matrix.profile }} package for ${{ matrix.os }} failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
  125. windows:
  126. if: github.repository_owner == 'emqx'
  127. runs-on: windows-2019
  128. strategy:
  129. fail-fast: false
  130. matrix:
  131. profile:
  132. - emqx
  133. otp:
  134. - 25.3.2
  135. steps:
  136. - uses: actions/checkout@v3
  137. - uses: ilammy/msvc-dev-cmd@v1.12.0
  138. - uses: erlef/setup-beam@v1.16.0
  139. with:
  140. otp-version: ${{ matrix.otp }}
  141. - name: build
  142. env:
  143. PYTHON: python
  144. DIAGNOSTIC: 1
  145. run: |
  146. # ensure crypto app (openssl)
  147. erl -eval "erlang:display(crypto:info_lib())" -s init stop
  148. make ${{ matrix.profile }}-tgz
  149. - name: run emqx
  150. timeout-minutes: 5
  151. run: |
  152. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx start
  153. Start-Sleep -s 10
  154. $pingOutput = ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx ping
  155. if ($pingOutput = 'pong') {
  156. echo "EMQX started OK"
  157. } else {
  158. echo "Failed to ping EMQX $pingOutput"
  159. Exit 1
  160. }
  161. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx stop
  162. echo "EMQX stopped"
  163. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx install
  164. echo "EMQX installed"
  165. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx uninstall
  166. echo "EMQX uninstalled"
  167. - uses: actions/upload-artifact@v3
  168. with:
  169. name: windows
  170. path: _packages/${{ matrix.profile }}/*
  171. retention-days: 7
  172. - name: Send notification to Slack
  173. uses: slackapi/slack-github-action@v1.23.0
  174. if: failure()
  175. env:
  176. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  177. with:
  178. payload: |
  179. {"text": "Scheduled build of ${{ matrix.profile }} package for Windows failed: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}