ci: some more fixes

This commit is contained in:
Ivan Dyachkov 2023-08-02 17:11:54 +02:00
parent 38809ffd4b
commit 3c4d5bdde7
14 changed files with 80 additions and 69 deletions

View File

@ -14,9 +14,9 @@ runs:
name: emqx-docker name: emqx-docker
path: /tmp path: /tmp
- name: load docker image - name: load docker image
shell: bash
env: env:
PKG_VSN: ${{ inputs.version-emqx }} PKG_VSN: ${{ inputs.version-emqx }}
shell: bash
run: | run: |
EMQX_DOCKER_IMAGE_TAG=$(docker load < /tmp/emqx-docker-${PKG_VSN}.tar.gz | sed 's/Loaded image: //g') EMQX_DOCKER_IMAGE_TAG=$(docker load < /tmp/emqx-docker-${PKG_VSN}.tar.gz | sed 's/Loaded image: //g')
echo "_EMQX_DOCKER_IMAGE_TAG=$EMQX_DOCKER_IMAGE_TAG" >> $GITHUB_ENV echo "_EMQX_DOCKER_IMAGE_TAG=$EMQX_DOCKER_IMAGE_TAG" >> $GITHUB_ENV
@ -36,9 +36,9 @@ runs:
with: with:
name: apache-jmeter.tgz name: apache-jmeter.tgz
- name: install jmeter - name: install jmeter
env:
JMETER_VERSION: 5.4.3
shell: bash shell: bash
env:
JMETER_VERSION: 5.4.3
run: | run: |
tar -xf apache-jmeter.tgz tar -xf apache-jmeter.tgz
ln -s apache-jmeter-$JMETER_VERSION jmeter ln -s apache-jmeter-$JMETER_VERSION jmeter

View File

@ -5,11 +5,16 @@ on:
env: env:
IS_CI: "yes" IS_CI: "yes"
OTP_VSN: "25.3.2-1"
ELIXIR_VSN: "1.14.5"
BUILDER_VSN: "25.3.2-1"
BUILDER: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
RUNNER: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }}
jobs: jobs:
sanity-checks: sanity-checks:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
container: ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04 container: ${{ env.BUILDER }}
outputs: outputs:
ct-matrix: ${{ steps.matrix.outputs.ct-matrix }} ct-matrix: ${{ steps.matrix.outputs.ct-matrix }}
ct-host: ${{ steps.matrix.outputs.ct-host }} ct-host: ${{ steps.matrix.outputs.ct-host }}
@ -29,14 +34,14 @@ jobs:
MATRIX="$(echo "${APPS}" | jq -c ' MATRIX="$(echo "${APPS}" | jq -c '
[ [
(.[] | select(.profile == "emqx") | . + { (.[] | select(.profile == "emqx") | . + {
builder: "5.1-3", builder: "${BUILDER_VSN}",
otp: "25.3.2-1", otp: "${OTP_VSN}",
elixir: "1.14.5" elixir: "${ELIXIR_VSN}"
}), }),
(.[] | select(.profile == "emqx-enterprise") | . + { (.[] | select(.profile == "emqx-enterprise") | . + {
builder: "5.1-3", builder: "${BUILDER_VSN}",
otp: ["25.3.2-1"][], otp: ["${OTP_VSN}"][],
elixir: "1.14.5" elixir: "${ELIXIR_VSN}"
}) })
] ]
')" ')"
@ -51,9 +56,10 @@ jobs:
echo "version-emqx-enterprise=$(./pkg-vsn.sh emqx-enterprise)" | tee -a $GITHUB_OUTPUT echo "version-emqx-enterprise=$(./pkg-vsn.sh emqx-enterprise)" | tee -a $GITHUB_OUTPUT
compile: compile:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
container: ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04 container: ${{ env.BUILDER }}
needs: [sanity-checks] needs:
- sanity-checks
strategy: strategy:
matrix: matrix:
profile: profile:
@ -80,15 +86,15 @@ jobs:
path: ${{ matrix.profile }}.zip path: ${{ matrix.profile }}.zip
retention-days: 1 retention-days: 1
# run_test_cases: run_test_cases:
# needs: needs:
# - sanity-checks - sanity-checks
# - compile - compile
# uses: ./.github/workflows/run_test_cases.yaml uses: ./.github/workflows/run_test_cases.yaml
# with: with:
# ct-matrix: ${{ needs.sanity-checks.outputs.ct-matrix }} ct-matrix: ${{ needs.sanity-checks.outputs.ct-matrix }}
# ct-host: ${{ needs.sanity-checks.outputs.ct-host }} ct-host: ${{ needs.sanity-checks.outputs.ct-host }}
# ct-docker: ${{ needs.sanity-checks.outputs.ct-docker }} ct-docker: ${{ needs.sanity-checks.outputs.ct-docker }}
static_checks: static_checks:
needs: needs:

View File

@ -36,8 +36,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
EMQX_NAME: ${{ matrix.profile }} EMQX_NAME: ${{ matrix.profile }}
OTP_VSN: 25.3.2-1
ELIXIR_VSN: 1.14.5
PKG_VSN: ${{ matrix.profile == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }} PKG_VSN: ${{ matrix.profile == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }}
strategy: strategy:

View File

@ -26,7 +26,7 @@ on:
jobs: jobs:
linux: linux:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
env: env:
EMQX_NAME: ${{ matrix.profile[0] }} EMQX_NAME: ${{ matrix.profile[0] }}
@ -38,12 +38,8 @@ jobs:
- ["emqx", "25.3.2-1", "ubuntu22.04", "elixir"] - ["emqx", "25.3.2-1", "ubuntu22.04", "elixir"]
- ["emqx-enterprise", "25.3.2-1", "amzn2023", "erlang"] - ["emqx-enterprise", "25.3.2-1", "amzn2023", "erlang"]
- ["emqx-enterprise", "25.3.2-1", "ubuntu20.04", "erlang"] - ["emqx-enterprise", "25.3.2-1", "ubuntu20.04", "erlang"]
builder:
- 5.1-3
elixir:
- '1.14.5'
container: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.profile[1] }}-${{ matrix.profile[2] }}" container: "ghcr.io/emqx/emqx-builder/${{ env.BUILDER }}:${{ env.ELIXIR }}-${{ matrix.profile[1] }}-${{ matrix.profile[2] }}"
steps: steps:
- uses: AutoModality/action-clean@v1 - uses: AutoModality/action-clean@v1
@ -142,10 +138,10 @@ jobs:
- emqx - emqx
- emqx-enterprise - emqx-enterprise
otp: otp:
- 25.3.2-1 - ${{ env.OTP_VSN }}
os: os:
- macos-11
- macos-12-arm64 - macos-12-arm64
- macos-13
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
env: env:

View File

@ -5,8 +5,8 @@ on:
jobs: jobs:
check_deps_integrity: check_deps_integrity:
runs-on: aws-amd64 runs-on: ${{ env.RUNNER }}
container: ghcr.io/emqx/emqx-builder/5.1-1:1.14.5-25.3.2-1-ubuntu22.04 container: ${{ env.BUILDER }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

View File

@ -13,13 +13,13 @@ on:
jobs: jobs:
elixir_release_build: elixir_release_build:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
container: ${{ env.BUILDER }}
strategy: strategy:
matrix: matrix:
profile: profile:
- emqx - emqx
- emqx-enterprise - emqx-enterprise
container: ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04
steps: steps:
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:

View File

@ -17,19 +17,16 @@ on:
# - e* # - e*
# pull_request: # pull_request:
env:
IS_CI: "yes"
jobs: jobs:
run_conf_tests: run_conf_tests:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
container: ${{ env.BUILDER }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
profile: profile:
- emqx - emqx
- emqx-enterprise - emqx-enterprise
container: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
steps: steps:
- uses: AutoModality/action-clean@v1 - uses: AutoModality/action-clean@v1
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3

View File

@ -25,7 +25,7 @@ on:
jobs: jobs:
basic-tests: basic-tests:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -48,7 +48,7 @@ jobs:
path: /tmp path: /tmp
- name: load docker image - name: load docker image
run: | run: |
EMQX_IMAGE_TAG=$(docker load < /tmp/${EMQX_NAME}-${PKG_VSN}.tar.gz | sed 's/Loaded image: //g') EMQX_IMAGE_TAG=$(docker load < /tmp/${EMQX_NAME}-${PKG_VSN}.tar.gz 2>/dev/null | sed 's/Loaded image: //g')
echo "EMQX_IMAGE_TAG=$EMQX_IMAGE_TAG" >> $GITHUB_ENV echo "EMQX_IMAGE_TAG=$EMQX_IMAGE_TAG" >> $GITHUB_ENV
- name: test two nodes cluster with proto_dist=inet_tls in docker - name: test two nodes cluster with proto_dist=inet_tls in docker
run: | run: |
@ -68,10 +68,10 @@ jobs:
docker compose rm -fs docker compose rm -fs
pytest: pytest:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
env: env:
EMQX_NAME: ${{ matrix.profile[0] }} EMQX_NAME: ${{ matrix.profile }}
PKG_VSN: ${{ matrix.profile[0] == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }} PKG_VSN: ${{ matrix.profile == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }}
DB_BACKEND: ${{ matrix.cluster_db_backend }} DB_BACKEND: ${{ matrix.cluster_db_backend }}
strategy: strategy:
@ -93,7 +93,7 @@ jobs:
path: /tmp path: /tmp
- name: load docker image - name: load docker image
run: | run: |
EMQX_IMAGE_TAG=$(docker load < /tmp/${EMQX_NAME}-${PKG_VSN}.tar.gz | sed 's/Loaded image: //g') EMQX_IMAGE_TAG=$(docker load < /tmp/${EMQX_NAME}-${PKG_VSN}.tar.gz 2>/dev/null | sed 's/Loaded image: //g')
echo "EMQX_IMAGE_TAG=$EMQX_IMAGE_TAG" >> $GITHUB_ENV echo "EMQX_IMAGE_TAG=$EMQX_IMAGE_TAG" >> $GITHUB_ENV
- name: run emqx - name: run emqx
timeout-minutes: 5 timeout-minutes: 5

View File

@ -50,7 +50,7 @@ jobs:
path: /tmp path: /tmp
- name: load docker image - name: load docker image
run: | run: |
EMQX_TAG=$(docker load < /tmp/${EMQX_NAME}-${PKG_VSN}.tar.gz | sed 's/Loaded image: //g') EMQX_TAG=$(docker load < /tmp/${EMQX_NAME}-${PKG_VSN}.tar.gz 2>/dev/null | sed 's/Loaded image: //g')
echo "EMQX_TAG=$EMQX_TAG" >> $GITHUB_ENV echo "EMQX_TAG=$EMQX_TAG" >> $GITHUB_ENV
echo "TARGET=emqx/${EMQX_NAME}" >> $GITHUB_ENV echo "TARGET=emqx/${EMQX_NAME}" >> $GITHUB_ENV
- run: minikube start - run: minikube start

View File

@ -16,7 +16,7 @@ on:
jobs: jobs:
jmeter_artifact: jmeter_artifact:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
steps: steps:
- uses: AutoModality/action-clean@v1 - uses: AutoModality/action-clean@v1
- name: Cache Jmeter - name: Cache Jmeter
@ -46,7 +46,7 @@ jobs:
path: /tmp/apache-jmeter.tgz path: /tmp/apache-jmeter.tgz
advanced_feat: advanced_feat:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -103,7 +103,7 @@ jobs:
path: ./jmeter_logs path: ./jmeter_logs
pgsql_authn_authz: pgsql_authn_authz:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -181,7 +181,7 @@ jobs:
path: ./jmeter_logs path: ./jmeter_logs
mysql_authn_authz: mysql_authn_authz:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -252,7 +252,7 @@ jobs:
path: ./jmeter_logs path: ./jmeter_logs
JWT_authn: JWT_authn:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -295,7 +295,7 @@ jobs:
-c "java -jar jwkserver-0.0.1.jar" -c "java -jar jwkserver-0.0.1.jar"
- name: run jmeter - name: run jmeter
run: | run: |
/opt/jmeter/bin/jmeter.sh \ jmeter/bin/jmeter.sh \
-Jjmeter.save.saveservice.output_format=xml -n \ -Jjmeter.save.saveservice.output_format=xml -n \
-t scripts/broker-autotest-suite/${{ matrix.scripts_type }}.jmx \ -t scripts/broker-autotest-suite/${{ matrix.scripts_type }}.jmx \
-Demqx_ip=$HAPROXY_IP \ -Demqx_ip=$HAPROXY_IP \
@ -315,7 +315,7 @@ jobs:
path: ./jmeter_logs path: ./jmeter_logs
built_in_database_authn_authz: built_in_database_authn_authz:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
strategy: strategy:
fail-fast: false fail-fast: false

View File

@ -16,8 +16,8 @@ on:
jobs: jobs:
relup_test_plan: relup_test_plan:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
container: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04" container: ${{ env.BUILDER }}
outputs: outputs:
CUR_EE_VSN: ${{ steps.find-versions.outputs.CUR_EE_VSN }} CUR_EE_VSN: ${{ steps.find-versions.outputs.CUR_EE_VSN }}
OLD_VERSIONS: ${{ steps.find-versions.outputs.OLD_VERSIONS }} OLD_VERSIONS: ${{ steps.find-versions.outputs.OLD_VERSIONS }}
@ -60,12 +60,11 @@ jobs:
needs: needs:
- relup_test_plan - relup_test_plan
if: needs.relup_test_plan.outputs.OLD_VERSIONS != '[]' if: needs.relup_test_plan.outputs.OLD_VERSIONS != '[]'
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ubuntu-22.04
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
old_vsn: ${{ fromJson(needs.relup_test_plan.outputs.OLD_VERSIONS) }} old_vsn: ${{ fromJson(needs.relup_test_plan.outputs.OLD_VERSIONS) }}
container: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
env: env:
OLD_VSN: "${{ matrix.old_vsn }}" OLD_VSN: "${{ matrix.old_vsn }}"
CUR_EE_VSN: "${{ needs.relup_test_plan.outputs.CUR_EE_VSN }}" CUR_EE_VSN: "${{ needs.relup_test_plan.outputs.CUR_EE_VSN }}"
@ -73,7 +72,22 @@ jobs:
run: run:
shell: bash shell: bash
steps: steps:
- uses: AutoModality/action-clean@v1 - uses: erlef/setup-beam@v1.15.4
with:
otp-version: 25.3.2
- 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 - uses: actions/download-artifact@v3
name: Download built emqx and test scenario name: Download built emqx and test scenario
with: with:

View File

@ -32,7 +32,7 @@ env:
jobs: jobs:
eunit_and_proper: eunit_and_proper:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -72,7 +72,7 @@ jobs:
path: _build/test/cover path: _build/test/cover
ct_docker: ct_docker:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -119,7 +119,7 @@ jobs:
path: _build/test/logs path: _build/test/logs
ct: ct:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -164,8 +164,8 @@ jobs:
- eunit_and_proper - eunit_and_proper
- ct - ct
- ct_docker - ct_docker
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
container: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04" container: ${{ env.BUILDER }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -205,7 +205,7 @@ jobs:
# do this in a separate job # do this in a separate job
upload_coverdata: upload_coverdata:
needs: make_cover needs: make_cover
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
steps: steps:
- name: Coveralls Finished - name: Coveralls Finished
env: env:

View File

@ -31,7 +31,7 @@ jobs:
profile: profile:
- emqx - emqx
- emqx-enterprise - emqx-enterprise
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
steps: steps:
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:

View File

@ -26,7 +26,7 @@ env:
jobs: jobs:
static_checks: static_checks:
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }} runs-on: ${{ env.RUNNER }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix: