124 lines
3.1 KiB
YAML
124 lines
3.1 KiB
YAML
name: Release Upgrade Tests
|
|
|
|
concurrency:
|
|
group: relup-${{ github.event_name }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
tags:
|
|
- v*
|
|
- e*
|
|
pull_request:
|
|
|
|
jobs:
|
|
relup_test_plan:
|
|
runs-on: ubuntu-20.04
|
|
container: "ghcr.io/emqx/emqx-builder/5.0-26:1.13.4-24.3.4.2-1-ubuntu20.04"
|
|
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/checkout@v3
|
|
name: Checkout
|
|
with:
|
|
path: emqx
|
|
fetch-depth: 0
|
|
- name: Find versions
|
|
id: find-versions
|
|
run: |
|
|
set -x
|
|
cd emqx
|
|
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: |
|
|
set -x
|
|
cd emqx
|
|
make emqx-tgz
|
|
make emqx-enterprise-tgz
|
|
- uses: actions/upload-artifact@v3
|
|
name: Upload built emqx and test scenario
|
|
with:
|
|
name: emqx_built
|
|
path: |
|
|
emqx/_upgrade_base
|
|
emqx/_packages
|
|
emqx/scripts
|
|
emqx/.ci
|
|
|
|
relup_test_run:
|
|
needs:
|
|
- relup_test_plan
|
|
if: needs.relup_test_plan.outputs.OLD_VERSIONS != '[]'
|
|
runs-on: ubuntu-20.04
|
|
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:
|
|
# setup Erlang to run lux
|
|
- uses: emqx/setup-beam@v1.16.1-emqx
|
|
with:
|
|
otp-version: 24.3.4.6
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: hawk/lux
|
|
ref: lux-2.8.1
|
|
path: lux
|
|
- name: Install lux
|
|
run: |
|
|
set -e -u -x
|
|
cd lux
|
|
autoconf
|
|
./configure
|
|
make
|
|
echo "$(pwd)/bin" >> $GITHUB_PATH
|
|
- uses: actions/download-artifact@v3
|
|
name: Download built emqx and test scenario
|
|
with:
|
|
name: emqx_built
|
|
path: .
|
|
- name: run relup test
|
|
run: |
|
|
set -e -x -u
|
|
chmod a+x scripts/**/*.sh
|
|
ls -l scripts
|
|
ls -l scripts/relup-test
|
|
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@v3
|
|
name: Save debug data
|
|
if: failure()
|
|
with:
|
|
name: debug_data
|
|
path: |
|
|
lux_logs
|