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