run_relup_tests.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 }}
  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: AutoModality/action-clean@v1
  26. - uses: actions/download-artifact@v3
  27. with:
  28. name: emqx-enterprise
  29. - name: extract artifact
  30. run: |
  31. unzip -o -q emqx-enterprise.zip
  32. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  33. - name: Find versions
  34. id: find-versions
  35. run: |
  36. set -x
  37. ee_vsn="$(./pkg-vsn.sh enterprise)"
  38. old_ee_vsns="$(./scripts/relup-build/base-vsns.sh enterprise | xargs)"
  39. old_vsns=$(echo -n "${old_ee_vsns}" | sed 's/ $//g' | jq -R -s -c 'split(" ")')
  40. echo "CUR_EE_VSN=$ee_vsn" >> $GITHUB_OUTPUT
  41. echo "OLD_VERSIONS=$old_vsns" >> $GITHUB_OUTPUT
  42. - name: build emqx
  43. run: |
  44. export PROFILE='emqx-enterprise'
  45. make emqx-enterprise-tgz
  46. - uses: actions/upload-artifact@v3
  47. name: Upload built emqx and test scenario
  48. with:
  49. name: emqx_built
  50. path: |
  51. _upgrade_base
  52. _packages
  53. scripts
  54. .ci
  55. relup_test_run:
  56. needs:
  57. - relup_test_plan
  58. if: needs.relup_test_plan.outputs.OLD_VERSIONS != '[]'
  59. runs-on: ubuntu-22.04
  60. strategy:
  61. fail-fast: false
  62. matrix:
  63. old_vsn: ${{ fromJson(needs.relup_test_plan.outputs.OLD_VERSIONS) }}
  64. env:
  65. OLD_VSN: "${{ matrix.old_vsn }}"
  66. CUR_EE_VSN: "${{ needs.relup_test_plan.outputs.CUR_EE_VSN }}"
  67. defaults:
  68. run:
  69. shell: bash
  70. steps:
  71. - uses: erlef/setup-beam@v1.16.0
  72. with:
  73. otp-version: 25.3.2
  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 -eu
  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 -eux
  95. case "$OLD_VSN" in
  96. e*)
  97. export CUR_VSN="$CUR_EE_VSN"
  98. ;;
  99. *)
  100. echo "unknown old version $OLD_VSN"
  101. exit 1
  102. ;;
  103. esac
  104. mkdir -p lux_logs
  105. if ! ./scripts/relup-test/run-relup-lux.sh $OLD_VSN; then
  106. docker logs node1.emqx.io | tee lux_logs/emqx1.log
  107. docker logs node2.emqx.io | tee lux_logs/emqx2.log
  108. exit 1
  109. fi
  110. - uses: actions/upload-artifact@v3
  111. name: Save debug data
  112. if: failure()
  113. with:
  114. name: debug_data
  115. path: |
  116. lux_logs