build_packages_cron.yaml 5.7 KB

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