run_relup_tests.yaml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. name: Release Upgrade Tests
  2. concurrency:
  3. group: relup-${{ github.event_name }}-${{ github.ref }}
  4. cancel-in-progress: true
  5. on:
  6. push:
  7. branches:
  8. - '**'
  9. tags:
  10. - v*
  11. - e*
  12. pull_request:
  13. jobs:
  14. relup_test:
  15. strategy:
  16. matrix:
  17. profile:
  18. - emqx
  19. - emqx-enterprise
  20. otp:
  21. - 24.1.5-4
  22. # no need to use more than 1 version of Elixir, since tests
  23. # run using only Erlang code. This is needed just to specify
  24. # the base image.
  25. elixir:
  26. - 1.13.2
  27. os:
  28. - ubuntu20.04
  29. arch:
  30. - amd64
  31. runs-on: ubuntu-20.04
  32. container: "ghcr.io/emqx/emqx-builder/5.0-5:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os }}"
  33. defaults:
  34. run:
  35. shell: bash
  36. steps:
  37. - uses: actions/setup-python@v2
  38. with:
  39. python-version: '3.8'
  40. architecture: 'x64'
  41. - uses: actions/checkout@v2
  42. with:
  43. repository: emqx/paho.mqtt.testing
  44. ref: develop-4.0
  45. path: paho.mqtt.testing
  46. - uses: actions/checkout@v2
  47. with:
  48. repository: terry-xiaoyu/one_more_emqx
  49. ref: master
  50. path: one_more_emqx
  51. - uses: actions/checkout@v2
  52. with:
  53. repository: emqx/emqtt-bench
  54. ref: 0.3.4
  55. path: emqtt-bench
  56. - uses: actions/checkout@v2
  57. with:
  58. repository: hawk/lux
  59. ref: lux-2.6
  60. path: lux
  61. - uses: actions/checkout@v2
  62. with:
  63. repository: ${{ github.repository }}
  64. path: emqx
  65. fetch-depth: 0
  66. - name: get version
  67. run: |
  68. set -e -x -u
  69. cd emqx
  70. export PROFILE=${{ matrix.profile }}
  71. export OTP_VSN=${{ matrix.otp }}
  72. echo "PROFILE=$PROFILE" >> $GITHUB_ENV
  73. echo "OTP_VSN=$OTP_VSN" >> $GITHUB_ENV
  74. if [ $PROFILE = "emqx" ];then
  75. broker="emqx-ce"
  76. else
  77. broker="emqx-enterprise"
  78. fi
  79. echo "BROKER=$broker" >> $GITHUB_ENV
  80. vsn="$(./pkg-vsn.sh $PROFILE)"
  81. echo "VSN=$vsn" >> $GITHUB_ENV
  82. pre_vsn="$(echo $vsn | grep -oE '^[0-9]+.[0-9]')"
  83. old_vsns="$(git tag -l "v$pre_vsn.[0-9]" | xargs echo -n | sed "s/v$vsn//")"
  84. echo "OLD_VSNS=$old_vsns" >> $GITHUB_ENV
  85. - name: download emqx
  86. run: |
  87. set -e -x -u
  88. mkdir -p emqx/_upgrade_base
  89. cd emqx/_upgrade_base
  90. old_vsns=($(echo $OLD_VSNS | tr ' ' ' '))
  91. for old_vsn in ${old_vsns[@]}; do
  92. wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$BROKER/$old_vsn/$PROFILE-${old_vsn#[e|v]}-otp${OTP_VSN}-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
  93. done
  94. - name: Get deps git refs for cache
  95. id: deps-refs
  96. run: |
  97. cd emqx
  98. scripts/get-dep-refs.sh
  99. - name: load rocksdb cache
  100. uses: actions/cache@v2
  101. with:
  102. path: emqx/_build/default/lib/rocksdb/
  103. key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ steps.deps-refs.outputs.DEP_ROCKSDB_REF }}
  104. - name: load quicer cache
  105. uses: actions/cache@v2
  106. with:
  107. path: emqx/_build/default/lib/quicer/
  108. key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ steps.deps-refs.outputs.DEP_QUICER_REF }}
  109. - name: build emqx
  110. run: make -C emqx ${PROFILE}-tgz
  111. - name: build emqtt-bench
  112. run: make -C emqtt-bench
  113. - name: build lux
  114. run: |
  115. set -e -u -x
  116. cd lux
  117. autoconf
  118. ./configure
  119. make
  120. make install
  121. - name: run relup test
  122. timeout-minutes: 20
  123. run: |
  124. set -e -x -u
  125. if [ -n "$OLD_VSNS" ]; then
  126. mkdir -p packages
  127. cp emqx/_packages/${PROFILE}/*.tar.gz packages
  128. cp emqx/_upgrade_base/*.tar.gz packages
  129. lux \
  130. --case_timeout infinity \
  131. --var PROFILE=$PROFILE \
  132. --var PACKAGE_PATH=$(pwd)/packages \
  133. --var BENCH_PATH=$(pwd)/emqtt-bench \
  134. --var ONE_MORE_EMQX_PATH=$(pwd)/one_more_emqx \
  135. --var VSN="$VSN" \
  136. --var OLD_VSNS="$OLD_VSNS" \
  137. emqx/.ci/fvt_tests/relup.lux
  138. fi
  139. - uses: actions/upload-artifact@v1
  140. if: failure()
  141. with:
  142. name: lux_logs
  143. path: lux_logs