run_relup_tests.yaml 3.2 KB

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