|
|
@@ -178,76 +178,78 @@ jobs:
|
|
|
fi
|
|
|
exit $RESULT
|
|
|
|
|
|
- relup_test:
|
|
|
+ relup_test_plan:
|
|
|
runs-on: ubuntu-20.04
|
|
|
container: emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04
|
|
|
+ outputs:
|
|
|
+ profile: ${{ steps.profile-and-versions.outputs.profile }}
|
|
|
+ vsn: ${{ steps.profile-and-versions.outputs.vsn }}
|
|
|
+ old_vsns: ${{ steps.profile-and-versions.outputs.old_vsns }}
|
|
|
+ broker: ${{ steps.profile-and-versions.outputs.broker }}
|
|
|
+ matrix: ${{ steps.generate-matrix.outputs.matrix }}
|
|
|
defaults:
|
|
|
run:
|
|
|
shell: bash
|
|
|
steps:
|
|
|
- - uses: actions/setup-python@v2
|
|
|
- with:
|
|
|
- python-version: '3.8'
|
|
|
- architecture: 'x64'
|
|
|
- - uses: actions/checkout@v2
|
|
|
- with:
|
|
|
- repository: emqx/paho.mqtt.testing
|
|
|
- ref: develop-4.0
|
|
|
- path: paho.mqtt.testing
|
|
|
- - uses: actions/checkout@v2
|
|
|
- with:
|
|
|
- repository: terry-xiaoyu/one_more_emqx
|
|
|
- ref: master
|
|
|
- path: one_more_emqx
|
|
|
- uses: actions/checkout@v2
|
|
|
+ name: Checkout
|
|
|
with:
|
|
|
- repository: emqx/emqtt-bench
|
|
|
- ref: '0.3.3'
|
|
|
- path: emqtt-bench
|
|
|
- - uses: actions/checkout@v2
|
|
|
- with:
|
|
|
- repository: hawk/lux
|
|
|
- ref: lux-2.6
|
|
|
- path: lux
|
|
|
- - uses: actions/checkout@v2
|
|
|
- with:
|
|
|
- repository: ${{ github.repository }}
|
|
|
path: emqx
|
|
|
fetch-depth: 0
|
|
|
- - name: prepare
|
|
|
- run: |
|
|
|
- if make -C emqx emqx-ee --dry-run > /dev/null 2>&1; then
|
|
|
- echo "https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com" > $HOME/.git-credentials
|
|
|
- git config --global credential.helper store
|
|
|
- echo "${{ secrets.CI_GIT_TOKEN }}" >> emqx/scripts/git-token
|
|
|
- echo "PROFILE=emqx-ee" >> $GITHUB_ENV
|
|
|
- else
|
|
|
- echo "PROFILE=emqx" >> $GITHUB_ENV
|
|
|
- fi
|
|
|
- - name: get version
|
|
|
+ - name: Get profile and version list
|
|
|
+ id: profile-and-versions
|
|
|
run: |
|
|
|
- set -e -x -u
|
|
|
cd emqx
|
|
|
- if [ $PROFILE = "emqx" ];then
|
|
|
- broker="emqx-ce"
|
|
|
- edition='opensource'
|
|
|
- else
|
|
|
- broker="emqx-ee"
|
|
|
- edition='enterprise'
|
|
|
- fi
|
|
|
- echo "BROKER=$broker" >> $GITHUB_ENV
|
|
|
-
|
|
|
vsn="$(./pkg-vsn.sh)"
|
|
|
- echo "VSN=$vsn" >> $GITHUB_ENV
|
|
|
-
|
|
|
pre_vsn="$(echo $vsn | grep -oE '^[0-9]+.[0-9]')"
|
|
|
- if [ $PROFILE = "emqx" ]; then
|
|
|
- old_vsns="$(git tag -l "v$pre_vsn.[0-9]" | xargs echo -n | sed "s/v$vsn//")"
|
|
|
+
|
|
|
+ if make emqx-ee --dry-run > /dev/null 2>&1; then
|
|
|
+ profile="emqx-ee"
|
|
|
+ old_vsns="$(git tag -l "e$pre_vsn.[0-9]" | xargs echo -n | sed "s/e$vsn//")"
|
|
|
+ broker="emqx-ee"
|
|
|
+
|
|
|
else
|
|
|
- old_vsns="$(git tag -l "e$pre_vsn.[0-9]" | xargs echo -n | sed "s/e$vsn//")"
|
|
|
+ profile="emqx"
|
|
|
+ old_vsns="$(git tag -l "v$pre_vsn.[0-9]" | xargs echo -n | sed "s/v$vsn//")"
|
|
|
+ broker="emqx-ce"
|
|
|
fi
|
|
|
+
|
|
|
echo "OLD_VSNS=$old_vsns" >> $GITHUB_ENV
|
|
|
- - name: download emqx
|
|
|
+
|
|
|
+ echo "::set-output name=vsn::$vsn"
|
|
|
+ echo "::set-output name=profile::$profile"
|
|
|
+ echo "::set-output name=broker::$broker"
|
|
|
+ echo "::set-output name=old_vsns::$old_vsns"
|
|
|
+ - name: Generate matrix
|
|
|
+ id: generate-matrix
|
|
|
+ run: |
|
|
|
+ matrix=$(echo -n "$OLD_VSNS" | jq -R -s -c 'split(" ")')
|
|
|
+ echo "::set-output name=matrix::$matrix"
|
|
|
+
|
|
|
+ relup_test_build:
|
|
|
+ needs: relup_test_plan
|
|
|
+ runs-on: ubuntu-20.04
|
|
|
+ container: emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04
|
|
|
+ defaults:
|
|
|
+ run:
|
|
|
+ shell: bash
|
|
|
+ env:
|
|
|
+ OLD_VSNS: "${{ needs.relup_test_plan.outputs.old_vsns }}"
|
|
|
+ PROFILE: "${{ needs.relup_test_plan.outputs.profile }}"
|
|
|
+ BROKER: "${{ needs.relup_test_plan.outputs.broker }}"
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v2
|
|
|
+ name: Checkout
|
|
|
+ with:
|
|
|
+ path: emqx
|
|
|
+ - name: Prepare credentials
|
|
|
+ run: |
|
|
|
+ if [ "$PROFILE" = "emqx-ee" ]; then
|
|
|
+ echo "https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com" > $HOME/.git-credentials
|
|
|
+ git config --global credential.helper store
|
|
|
+ echo "${{ secrets.CI_GIT_TOKEN }}" >> emqx/scripts/git-token
|
|
|
+ fi
|
|
|
+ - name: Download bases
|
|
|
run: |
|
|
|
set -e -x -u
|
|
|
mkdir -p emqx/_upgrade_base
|
|
|
@@ -256,53 +258,70 @@ jobs:
|
|
|
for old_vsn in ${old_vsns[@]}; do
|
|
|
wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$BROKER/$old_vsn/$PROFILE-ubuntu20.04-${old_vsn#[e|v]}-amd64.zip
|
|
|
done
|
|
|
- - name: build emqx
|
|
|
+ - name: Build emqx
|
|
|
run: make -C emqx ${PROFILE}-zip
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
+ name: Upload built emqx and test scenario
|
|
|
with:
|
|
|
- name: emqx
|
|
|
- path: emqx/_packages/**/*.zip
|
|
|
- - name: build emqtt-bench
|
|
|
- run: make -C emqtt-bench
|
|
|
- - name: build lux
|
|
|
- run: |
|
|
|
- set -e -u -x
|
|
|
- cd lux
|
|
|
- autoconf
|
|
|
- ./configure
|
|
|
- make
|
|
|
- make install
|
|
|
- - name: run relup test
|
|
|
- timeout-minutes: 30
|
|
|
- run: |
|
|
|
- set -e -x -u
|
|
|
- if [ -n "$OLD_VSNS" ]; then
|
|
|
- mkdir -p packages
|
|
|
- cp emqx/_packages/${PROFILE}/*.zip packages
|
|
|
- cp emqx/_upgrade_base/*.zip packages
|
|
|
- lux \
|
|
|
- --case_timeout infinity \
|
|
|
- --var PROFILE=$PROFILE \
|
|
|
- --var PACKAGE_PATH=$(pwd)/packages \
|
|
|
- --var BENCH_PATH=$(pwd)/emqtt-bench \
|
|
|
- --var ONE_MORE_EMQX_PATH=$(pwd)/one_more_emqx \
|
|
|
- --var VSN="$VSN" \
|
|
|
- --var OLD_VSNS="$OLD_VSNS" \
|
|
|
- emqx/.ci/fvt_tests/relup.lux
|
|
|
- fi
|
|
|
- - uses: actions/upload-artifact@v1
|
|
|
- if: failure()
|
|
|
+ name: emqx_built
|
|
|
+ path: |
|
|
|
+ emqx/_packages/*/*.zip
|
|
|
+ emqx/.ci/fvt_tests
|
|
|
+
|
|
|
+ relup_test_run:
|
|
|
+ needs:
|
|
|
+ - relup_test_plan
|
|
|
+ - relup_test_build
|
|
|
+ runs-on: ubuntu-20.04
|
|
|
+ container: emqx/relup-test-env:erl23.2.7.2-emqx-2-ubuntu20.04
|
|
|
+ strategy:
|
|
|
+ matrix:
|
|
|
+ old_vsn: ${{ fromJson(needs.relup_test_plan.outputs.matrix) }}
|
|
|
+ env:
|
|
|
+ OLD_VSN: "${{ matrix.old_vsn }}"
|
|
|
+ PROFILE: "${{ needs.relup_test_plan.outputs.profile }}"
|
|
|
+ VSN: "${{ needs.relup_test_plan.outputs.vsn }}"
|
|
|
+ BROKER: "${{ needs.relup_test_plan.outputs.broker }}"
|
|
|
+ defaults:
|
|
|
+ run:
|
|
|
+ shell: bash
|
|
|
+ steps:
|
|
|
+ - uses: actions/download-artifact@v2
|
|
|
+ name: Dowload built emqx and test scenario
|
|
|
with:
|
|
|
- name: emqx_logs
|
|
|
- path: packages/emqx/log/emqx.log.1
|
|
|
- - uses: actions/upload-artifact@v1
|
|
|
- if: failure()
|
|
|
+ name: emqx_built
|
|
|
+ path: emqx_built
|
|
|
+ - uses: actions/checkout@v2
|
|
|
+ name: Checkout one_more_emqx
|
|
|
with:
|
|
|
- name: emqx2_logs
|
|
|
- path: packages/emqx2/log/emqx.log.1
|
|
|
- - uses: actions/upload-artifact@v1
|
|
|
+ repository: terry-xiaoyu/one_more_emqx
|
|
|
+ ref: master
|
|
|
+ path: one_more_emqx
|
|
|
+ - name: Prepare packages
|
|
|
+ run: |
|
|
|
+ set -e -x -u
|
|
|
+ mkdir -p packages
|
|
|
+ cp emqx_built/_packages/*/*.zip packages
|
|
|
+ cd packages
|
|
|
+ wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$BROKER/$OLD_VSN/$PROFILE-ubuntu20.04-${OLD_VSN#[e|v]}-amd64.zip
|
|
|
+ - name: Run relup test scenario
|
|
|
+ timeout-minutes: 5
|
|
|
+ run: |
|
|
|
+ lux \
|
|
|
+ --case_timeout infinity \
|
|
|
+ --var PROFILE=$PROFILE \
|
|
|
+ --var PACKAGE_PATH=$(pwd)/packages \
|
|
|
+ --var ONE_MORE_EMQX_PATH=$(pwd)/one_more_emqx \
|
|
|
+ --var VSN="$VSN" \
|
|
|
+ --var OLD_VSN="$OLD_VSN" \
|
|
|
+ emqx_built/.ci/fvt_tests/relup.lux
|
|
|
+ - uses: actions/upload-artifact@v2
|
|
|
+ name: Save debug data
|
|
|
if: failure()
|
|
|
with:
|
|
|
- name: lux_logs
|
|
|
- path: lux_logs
|
|
|
-
|
|
|
+ name: debug_data
|
|
|
+ path: |
|
|
|
+ packages/emqx/log/emqx.log.1
|
|
|
+ packages/emqx2/log/emqx.log.1
|
|
|
+ packages/*.zip
|
|
|
+ lux_logs
|