run_relup_tests.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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_plan:
  15. runs-on: ubuntu-20.04
  16. container: "ghcr.io/emqx/emqx-builder/5.0-26:1.13.4-24.3.4.2-1-ubuntu20.04"
  17. outputs:
  18. CUR_EE_VSN: ${{ steps.find-versions.outputs.CUR_EE_VSN }}
  19. OLD_VERSIONS: ${{ steps.find-versions.outputs.OLD_VERSIONS }}
  20. defaults:
  21. run:
  22. shell: bash
  23. steps:
  24. - uses: actions/checkout@v3
  25. name: Checkout
  26. with:
  27. path: emqx
  28. fetch-depth: 0
  29. - name: Find versions
  30. id: find-versions
  31. run: |
  32. set -x
  33. cd emqx
  34. ee_vsn="$(./pkg-vsn.sh enterprise)"
  35. old_ee_vsns="$(./scripts/relup-build/base-vsns.sh enterprise | xargs)"
  36. old_vsns=$(echo -n "${old_ee_vsns}" | sed 's/ $//g' | jq -R -s -c 'split(" ")')
  37. echo "CUR_EE_VSN=$ee_vsn" >> $GITHUB_OUTPUT
  38. echo "OLD_VERSIONS=$old_vsns" >> $GITHUB_OUTPUT
  39. - name: build emqx
  40. run: |
  41. set -x
  42. cd emqx
  43. make emqx-tgz
  44. make emqx-enterprise-tgz
  45. - uses: actions/upload-artifact@v3
  46. name: Upload built emqx and test scenario
  47. with:
  48. name: emqx_built
  49. path: |
  50. emqx/_upgrade_base
  51. emqx/_packages
  52. emqx/scripts
  53. emqx/.ci
  54. relup_test_run:
  55. needs:
  56. - relup_test_plan
  57. if: needs.relup_test_plan.outputs.OLD_VERSIONS != '[]'
  58. runs-on: ubuntu-20.04
  59. strategy:
  60. fail-fast: false
  61. matrix:
  62. old_vsn: ${{ fromJson(needs.relup_test_plan.outputs.OLD_VERSIONS) }}
  63. env:
  64. OLD_VSN: "${{ matrix.old_vsn }}"
  65. CUR_EE_VSN: "${{ needs.relup_test_plan.outputs.CUR_EE_VSN }}"
  66. defaults:
  67. run:
  68. shell: bash
  69. steps:
  70. # setup Erlang to run lux
  71. - uses: emqx/setup-beam@v1.16.1-emqx
  72. with:
  73. otp-version: 24.3.4.6
  74. - uses: actions/checkout@v3
  75. with:
  76. repository: hawk/lux
  77. ref: lux-2.8.1
  78. path: lux
  79. - name: Install lux
  80. run: |
  81. set -e -u -x
  82. cd lux
  83. autoconf
  84. ./configure
  85. make
  86. echo "$(pwd)/bin" >> $GITHUB_PATH
  87. - uses: actions/download-artifact@v3
  88. name: Download built emqx and test scenario
  89. with:
  90. name: emqx_built
  91. path: .
  92. - name: run relup test
  93. run: |
  94. set -e -x -u
  95. chmod a+x scripts/**/*.sh
  96. ls -l scripts
  97. ls -l scripts/relup-test
  98. case "$OLD_VSN" in
  99. e*)
  100. export CUR_VSN="$CUR_EE_VSN"
  101. ;;
  102. *)
  103. echo "unknown old version $OLD_VSN"
  104. exit 1
  105. ;;
  106. esac
  107. mkdir -p lux_logs
  108. if ! ./scripts/relup-test/run-relup-lux.sh $OLD_VSN; then
  109. docker logs node1.emqx.io | tee lux_logs/emqx1.log
  110. docker logs node2.emqx.io | tee lux_logs/emqx2.log
  111. exit 1
  112. fi
  113. - uses: actions/upload-artifact@v3
  114. name: Save debug data
  115. if: failure()
  116. with:
  117. name: debug_data
  118. path: |
  119. lux_logs