build_slim_packages.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. tags:
  8. - v*
  9. - e*
  10. pull_request:
  11. workflow_dispatch:
  12. jobs:
  13. linux:
  14. runs-on: ubuntu-20.04
  15. strategy:
  16. fail-fast: false
  17. matrix:
  18. profile:
  19. - emqx-edge
  20. - emqx
  21. - emqx-enterprise
  22. otp:
  23. - 24.1.5-2
  24. os:
  25. - ubuntu20.04
  26. - centos7
  27. container: "ghcr.io/emqx/emqx-builder/5.0-2:${{ matrix.otp }}-${{ matrix.os }}"
  28. steps:
  29. - uses: actions/checkout@v1
  30. - name: build zip package
  31. run: make ${{ matrix.profile }}-zip
  32. - name: build deb/rpm packages
  33. run: make ${{ matrix.profile }}-pkg
  34. - name: packages test
  35. run: |
  36. export CODE_PATH=$GITHUB_WORKSPACE
  37. EMQX_NAME=${{ matrix.profile }} .ci/build_packages/tests.sh
  38. - uses: actions/upload-artifact@v2
  39. with:
  40. name: ${{ matrix.profile}}-${{ matrix.otp }}-${{ matrix.os }}
  41. path: _packages/**/*.zip
  42. mac:
  43. strategy:
  44. fail-fast: false
  45. matrix:
  46. profile:
  47. - emqx
  48. - emqx-enterprise
  49. otp:
  50. - 24.1.5-2
  51. macos:
  52. - macos-11
  53. - macos-10.15
  54. runs-on: ${{ matrix.macos }}
  55. steps:
  56. - uses: actions/checkout@v2
  57. - name: prepare
  58. run: |
  59. brew update
  60. brew install curl zip unzip gnu-sed kerl unixodbc freetds
  61. echo "/usr/local/bin" >> $GITHUB_PATH
  62. echo "EMQX_NAME=${{ matrix.profile }}" >> $GITHUB_ENV
  63. - uses: actions/cache@v2
  64. id: cache
  65. with:
  66. path: ~/.kerl
  67. key: otp-${{ matrix.otp }}-${{ matrix.macos }}
  68. - name: build erlang
  69. if: steps.cache.outputs.cache-hit != 'true'
  70. timeout-minutes: 60
  71. env:
  72. KERL_BUILD_BACKEND: git
  73. OTP_GITHUB_URL: https://github.com/emqx/otp
  74. run: |
  75. kerl update releases
  76. kerl build ${{ matrix.otp }}
  77. kerl install ${{ matrix.otp }} $HOME/.kerl/${{ matrix.otp }}
  78. - name: build ${{ matrix.profile }}
  79. run: |
  80. . $HOME/.kerl/${{ matrix.otp }}/activate
  81. make ensure-rebar3
  82. sudo cp rebar3 /usr/local/bin/rebar3
  83. make ${{ matrix.profile }}-zip
  84. - name: test
  85. run: |
  86. pkg_name=$(find _packages/${{ matrix.profile }} -mindepth 1 -maxdepth 1 -iname \*.zip)
  87. unzip -q $pkg_name
  88. # gsed -i '/emqx_telemetry/d' ./emqx/data/loaded_plugins
  89. ./emqx/bin/emqx start || cat emqx/log/erlang.log.1
  90. ready='no'
  91. for i in {1..10}; do
  92. if curl -fs 127.0.0.1:18083/api/v5/status > /dev/null; then
  93. ready='yes'
  94. break
  95. fi
  96. sleep 1
  97. done
  98. if [ "$ready" != "yes" ]; then
  99. echo "Timed out waiting for emqx to be ready"
  100. cat emqx/log/erlang.log.1
  101. exit 1
  102. fi
  103. ./emqx/bin/emqx_ctl status
  104. ./emqx/bin/emqx stop
  105. rm -rf emqx
  106. - uses: actions/upload-artifact@v2
  107. with:
  108. name: macos
  109. path: _packages/**/*.zip