name: Release Upgrade Tests concurrency: group: relup-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true on: workflow_call: inputs: builder: required: true type: string permissions: contents: read jobs: relup_test_plan: runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }} container: ${{ inputs.builder }} outputs: CUR_EE_VSN: ${{ steps.find-versions.outputs.CUR_EE_VSN }} OLD_VERSIONS: ${{ steps.find-versions.outputs.OLD_VERSIONS }} defaults: run: shell: bash steps: - uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 with: name: emqx-enterprise - name: extract artifact run: | unzip -o -q emqx-enterprise.zip git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: Find versions id: find-versions run: | set -x ee_vsn="$(./pkg-vsn.sh enterprise)" old_ee_vsns="$(./scripts/relup-build/base-vsns.sh enterprise | xargs)" old_vsns=$(echo -n "${old_ee_vsns}" | sed 's/ $//g' | jq -R -s -c 'split(" ")') echo "CUR_EE_VSN=$ee_vsn" >> $GITHUB_OUTPUT echo "OLD_VERSIONS=$old_vsns" >> $GITHUB_OUTPUT - name: build emqx run: | export PROFILE='emqx-enterprise' make emqx-enterprise-tgz - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 name: Upload built emqx and test scenario with: name: relup_tests_emqx_built path: | _upgrade_base _packages scripts .ci retention-days: 7 relup_test_run: needs: - relup_test_plan if: needs.relup_test_plan.outputs.OLD_VERSIONS != '[]' runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }} strategy: fail-fast: false matrix: old_vsn: ${{ fromJson(needs.relup_test_plan.outputs.OLD_VERSIONS) }} env: OLD_VSN: "${{ matrix.old_vsn }}" CUR_EE_VSN: "${{ needs.relup_test_plan.outputs.CUR_EE_VSN }}" defaults: run: shell: bash steps: - uses: erlef/setup-beam@8b9cac4c04dbcd7bf8fd673e16f988225d89b09b # v1.17.2 with: otp-version: 26.2.1 - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: repository: hawk/lux ref: lux-2.8.1 path: lux - name: Install lux run: | set -eu cd lux autoconf ./configure make echo "$(pwd)/bin" >> $GITHUB_PATH - uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 name: Download built emqx and test scenario with: name: relup_tests_emqx_built path: . - name: run relup test run: | set -eux case "$OLD_VSN" in e*) export CUR_VSN="$CUR_EE_VSN" ;; *) echo "unknown old version $OLD_VSN" exit 1 ;; esac mkdir -p lux_logs if ! ./scripts/relup-test/run-relup-lux.sh $OLD_VSN; then docker logs node1.emqx.io | tee lux_logs/emqx1.log docker logs node2.emqx.io | tee lux_logs/emqx2.log exit 1 fi - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 name: Save debug data if: failure() with: name: relup_test_run_debug_data path: | lux_logs retention-days: 3