build_packages_cron.yaml 5.6 KB

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