run_relup_tests.yaml 3.1 KB

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