| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- 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@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
- 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@2f0cc07b4b9bea248ae098aba9e1a8a1de5ec24c # v1.17.5
- with:
- otp-version: 26.2.1
- - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- 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@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
- 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
|