run_relup_tests.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. jobs:
  15. relup_test_plan:
  16. runs-on: ["${{ inputs.runner }}", 'linux', 'x64', 'ephemeral']
  17. container: ${{ inputs.builder }}
  18. outputs:
  19. CUR_EE_VSN: ${{ steps.find-versions.outputs.CUR_EE_VSN }}
  20. OLD_VERSIONS: ${{ steps.find-versions.outputs.OLD_VERSIONS }}
  21. defaults:
  22. run:
  23. shell: bash
  24. steps:
  25. - uses: actions/download-artifact@v3
  26. with:
  27. name: emqx-enterprise
  28. - name: extract artifact
  29. run: |
  30. unzip -o -q emqx-enterprise.zip
  31. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  32. - name: Find versions
  33. id: find-versions
  34. run: |
  35. set -x
  36. ee_vsn="$(./pkg-vsn.sh enterprise)"
  37. old_ee_vsns="$(./scripts/relup-build/base-vsns.sh enterprise | xargs)"
  38. old_vsns=$(echo -n "${old_ee_vsns}" | sed 's/ $//g' | jq -R -s -c 'split(" ")')
  39. echo "CUR_EE_VSN=$ee_vsn" >> $GITHUB_OUTPUT
  40. echo "OLD_VERSIONS=$old_vsns" >> $GITHUB_OUTPUT
  41. - name: build emqx
  42. run: |
  43. export PROFILE='emqx-enterprise'
  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. _upgrade_base
  51. _packages
  52. scripts
  53. .ci
  54. relup_test_run:
  55. needs:
  56. - relup_test_plan
  57. if: needs.relup_test_plan.outputs.OLD_VERSIONS != '[]'
  58. runs-on: ["${{ inputs.runner }}", 'linux', 'x64', 'ephemeral']
  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. - uses: erlef/setup-beam@v1.16.0
  71. with:
  72. otp-version: 25.3.2
  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 -eu
  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 -eux
  94. case "$OLD_VSN" in
  95. e*)
  96. export CUR_VSN="$CUR_EE_VSN"
  97. ;;
  98. *)
  99. echo "unknown old version $OLD_VSN"
  100. exit 1
  101. ;;
  102. esac
  103. mkdir -p lux_logs
  104. if ! ./scripts/relup-test/run-relup-lux.sh $OLD_VSN; then
  105. docker logs node1.emqx.io | tee lux_logs/emqx1.log
  106. docker logs node2.emqx.io | tee lux_logs/emqx2.log
  107. exit 1
  108. fi
  109. - uses: actions/upload-artifact@v3
  110. name: Save debug data
  111. if: failure()
  112. with:
  113. name: debug_data
  114. path: |
  115. lux_logs