run_relup_tests.yaml 3.9 KB

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