build_slim_packages.yaml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. name: Build slim packages
  2. concurrency:
  3. group: slim-${{ github.event_name }}-${{ github.ref }}
  4. cancel-in-progress: true
  5. on:
  6. push:
  7. branches:
  8. - master
  9. pull_request:
  10. # GitHub pull_request action is by default triggered when
  11. # opened reopened or synchronize,
  12. # we add labeled and unlabeled to the list because
  13. # the mac job dpends on the PR having a 'Mac' label
  14. types:
  15. - labeled
  16. - unlabeled
  17. - opened
  18. - reopened
  19. - synchronize
  20. workflow_dispatch:
  21. jobs:
  22. linux:
  23. runs-on: aws-amd64
  24. strategy:
  25. fail-fast: false
  26. matrix:
  27. profile:
  28. - ["emqx", "24.3.4.2-1", "el7"]
  29. - ["emqx", "25.1.2-2", "ubuntu20.04"]
  30. - ["emqx-enterprise", "24.3.4.2-1", "ubuntu20.04"]
  31. builder:
  32. - 5.0-26
  33. elixir:
  34. - 1.13.4
  35. container: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.profile[1] }}-${{ matrix.profile[2] }}"
  36. steps:
  37. - uses: AutoModality/action-clean@v1
  38. - uses: actions/checkout@v3
  39. with:
  40. fetch-depth: 0
  41. - name: prepare
  42. run: |
  43. echo "EMQX_NAME=${{ matrix.profile[0] }}" >> $GITHUB_ENV
  44. echo "CODE_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
  45. - name: Work around https://github.com/actions/checkout/issues/766
  46. run: |
  47. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  48. - name: build and test tgz package
  49. run: |
  50. make ${EMQX_NAME}-tgz
  51. ./scripts/pkg-tests.sh ${EMQX_NAME}-tgz
  52. - name: run static checks
  53. if: contains(matrix.os, 'ubuntu')
  54. run: |
  55. make static_checks
  56. - name: build and test deb/rpm packages
  57. run: |
  58. make ${EMQX_NAME}-pkg
  59. ./scripts/pkg-tests.sh ${EMQX_NAME}-pkg
  60. - name: build and test tgz package (Elixir)
  61. run: |
  62. make ${EMQX_NAME}-elixir-tgz
  63. ./scripts/pkg-tests.sh ${EMQX_NAME}-elixir-tgz
  64. - name: build and test deb/rpm packages (Elixir)
  65. run: |
  66. make ${EMQX_NAME}-elixir-pkg
  67. ./scripts/pkg-tests.sh ${EMQX_NAME}-elixir-pkg
  68. - uses: actions/upload-artifact@v3
  69. with:
  70. name: "${{ matrix.profile[0] }}-${{ matrix.profile[1] }}-${{ matrix.profile[2] }}"
  71. path: _packages/${{ matrix.profile[0] }}/*
  72. - uses: actions/upload-artifact@v3
  73. with:
  74. name: "${{ matrix.profile[0] }}_schema_dump"
  75. path: |
  76. scripts/spellcheck
  77. _build/${{ matrix.profile[0] }}/lib/emqx_dashboard/priv/www/static/schema.json
  78. windows:
  79. runs-on: windows-2019
  80. strategy:
  81. fail-fast: false
  82. matrix:
  83. profile:
  84. - emqx
  85. otp:
  86. - 25.1.2
  87. steps:
  88. - uses: actions/checkout@v3
  89. - uses: ilammy/msvc-dev-cmd@v1.12.0
  90. - uses: emqx/setup-beam@v1.16.1-emqx
  91. with:
  92. otp-version: ${{ matrix.otp }}
  93. - name: build
  94. env:
  95. PYTHON: python
  96. DIAGNOSTIC: 1
  97. run: |
  98. # ensure crypto app (openssl)
  99. erl -eval "erlang:display(crypto:info_lib())" -s init stop
  100. make ${{ matrix.profile }}-tgz
  101. - name: run emqx
  102. timeout-minutes: 5
  103. run: |
  104. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx start
  105. Start-Sleep -s 5
  106. echo "EMQX started"
  107. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx stop
  108. echo "EMQX stopped"
  109. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx install
  110. echo "EMQX installed"
  111. ./_build/${{ matrix.profile }}/rel/emqx/bin/emqx uninstall
  112. echo "EMQX uninstalled"
  113. - uses: actions/upload-artifact@v3
  114. with:
  115. name: windows
  116. path: _packages/${{ matrix.profile }}/*
  117. mac:
  118. strategy:
  119. fail-fast: false
  120. matrix:
  121. profile:
  122. - emqx
  123. - emqx-enterprise
  124. otp:
  125. - 24.3.4.2-1
  126. os:
  127. - macos-11
  128. - macos-12-arm64
  129. runs-on: ${{ matrix.os }}
  130. steps:
  131. - uses: actions/checkout@v3
  132. - name: prepare
  133. run: |
  134. echo "EMQX_NAME=${{ matrix.profile }}" >> $GITHUB_ENV
  135. - uses: ./.github/actions/package-macos
  136. with:
  137. profile: ${{ matrix.profile }}
  138. otp: ${{ matrix.otp }}
  139. os: ${{ matrix.os }}
  140. apple_id_password: ${{ secrets.APPLE_ID_PASSWORD }}
  141. apple_developer_identity: ${{ secrets.APPLE_DEVELOPER_IDENTITY }}
  142. apple_developer_id_bundle: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }}
  143. apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }}
  144. - uses: actions/upload-artifact@v3
  145. with:
  146. name: ${{ matrix.os }}
  147. path: _packages/**/*
  148. spellcheck:
  149. needs: linux
  150. strategy:
  151. matrix:
  152. profile:
  153. - emqx
  154. - emqx-enterprise
  155. runs-on: aws-amd64
  156. steps:
  157. - uses: actions/download-artifact@v3
  158. name: Download schema dump
  159. with:
  160. name: "${{ matrix.profile }}_schema_dump"
  161. path: /tmp/
  162. - name: Run spellcheck
  163. run: |
  164. bash /tmp/scripts/spellcheck/spellcheck.sh /tmp/_build/${{ matrix.profile }}/lib/emqx_dashboard/priv/www/static/schema.json