Compare commits
29 Commits
master
...
0712-refac
Author | SHA1 | Date |
---|---|---|
![]() |
d579159ab8 | |
![]() |
9fa130d5a4 | |
![]() |
c8aec7ce68 | |
![]() |
05a51306f9 | |
![]() |
3c4d5bdde7 | |
![]() |
38809ffd4b | |
![]() |
de7838357f | |
![]() |
d75f65deae | |
![]() |
a03dd42283 | |
![]() |
b976c6f5a3 | |
![]() |
ba86a039cd | |
![]() |
f8022a849a | |
![]() |
28afa538d3 | |
![]() |
d6bbd5b5a2 | |
![]() |
41d39cfc36 | |
![]() |
f66669f0fd | |
![]() |
96ed17679d | |
![]() |
34cd8dc520 | |
![]() |
54aed80e59 | |
![]() |
f628fc8d14 | |
![]() |
4374785cd7 | |
![]() |
c7d68ed25d | |
![]() |
e3e28d9b41 | |
![]() |
ab0aedd501 | |
![]() |
eaca8e2d9a | |
![]() |
1943120937 | |
![]() |
1566edd50c | |
![]() |
8139804f1e | |
![]() |
f1aaa25aad |
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if ! type "docker" > /dev/null; then
|
||||
echo "docker is not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! type "yq" > /dev/null; then
|
||||
echo "yq is not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
EMQX_BUILDER_VERSION=${EMQX_BUILDER_VERSION:-5.1-1}
|
||||
EMQX_BUILDER_OTP=${EMQX_BUILDER_OTP:-25.3.2-1}
|
||||
EMQX_BUILDER_ELIXIR=${EMQX_BUILDER_ELIXIR:-1.14.5}
|
||||
EMQX_BUILDER_PLATFORM=${EMQX_BUILDER_PLATFORM:-ubuntu22.04}
|
||||
EMQX_BUILDER=${EMQX_BUILDER:-ghcr.io/emqx/emqx-builder/${EMQX_BUILDER_VERSION}:${EMQX_BUILDER_ELIXIR}-${EMQX_BUILDER_OTP}-${EMQX_BUILDER_PLATFORM}}
|
||||
|
||||
commands=$(yq ".runs.steps[].run" .github/actions/pr-sanity-checks/action.yaml | grep -v null)
|
||||
|
||||
BEFORE_REF=${BEFORE_REF:-$(git rev-parse master)}
|
||||
AFTER_REF=${AFTER_REF:-$(git rev-parse HEAD)}
|
||||
docker run --rm -it -v "$(pwd):/emqx" -w /emqx \
|
||||
-e GITHUB_WORKSPACE=/emqx \
|
||||
-e BEFORE_REF="$BEFORE_REF" \
|
||||
-e AFTER_REF="$AFTER_REF" \
|
||||
-e GITHUB_BASE_REF="$BEFORE_REF" \
|
||||
-e MIX_ENV=emqx-enterprise \
|
||||
-e PROFILE=emqx-enterprise \
|
||||
"${EMQX_BUILDER}" /bin/bash -c "${commands}"
|
|
@ -0,0 +1,74 @@
|
|||
name: 'Pull request sanity checks'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: 'bash -Eeuo pipefail {0}'
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Work around https://github.com/actions/checkout/issues/766
|
||||
shell: bash
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Run gitlint
|
||||
shell: bash
|
||||
env:
|
||||
BEFORE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
|
||||
AFTER_REF: ${{ github.sha }}
|
||||
run: |
|
||||
echo "==> gitlint --commits $BEFORE_REF..$AFTER_REF"
|
||||
pip install gitlint
|
||||
gitlint --commits $BEFORE_REF..$AFTER_REF --config .github/workflows/.gitlint
|
||||
echo "==> gitlint ok"
|
||||
- name: Check line-break at EOF
|
||||
shell: bash
|
||||
run: |
|
||||
echo "==> ./scripts/check-nl-at-eof.sh"
|
||||
./scripts/check-nl-at-eof.sh
|
||||
echo "==> ./scripts/check-nl-at-eof.sh ok"
|
||||
- name: Run shellcheck
|
||||
shell: bash
|
||||
run: |
|
||||
echo "==> ./scripts/shellcheck.sh"
|
||||
apt-get update -y
|
||||
apt-get install -y shellcheck
|
||||
./scripts/shellcheck.sh
|
||||
echo "==> ./scripts/shellcheck.sh ok"
|
||||
- name: Check apps version
|
||||
shell: bash
|
||||
run: |
|
||||
echo "==> ./scripts/apps-version-check.sh"
|
||||
./scripts/apps-version-check.sh
|
||||
echo "==> ./scripts/apps-version-check.sh ok"
|
||||
- name: Check Erlang code formatting
|
||||
shell: bash
|
||||
run: |
|
||||
echo "==> ./scripts/check-format.sh"
|
||||
./scripts/check-format.sh
|
||||
echo "==> check-format ok"
|
||||
- name: Run elvis check
|
||||
shell: bash
|
||||
run: |
|
||||
echo "==> ./scripts/elvis-check.sh $GITHUB_BASE_REF"
|
||||
./scripts/elvis-check.sh $GITHUB_BASE_REF
|
||||
echo "==> ./scripts/elvis-check.sh $GITHUB_BASE_REF ok"
|
||||
- name: Setup mix
|
||||
env:
|
||||
MIX_ENV: emqx-enterprise
|
||||
PROFILE: emqx-enterprise
|
||||
shell: bash
|
||||
run: |
|
||||
echo "==> mix deps.get"
|
||||
mix local.hex --force
|
||||
mix local.rebar --force
|
||||
echo "==> mix deps.get ok"
|
||||
- name: Check Elixir code formatting
|
||||
env:
|
||||
MIX_ENV: emqx-enterprise
|
||||
PROFILE: emqx-enterprise
|
||||
shell: bash
|
||||
run: |
|
||||
echo "==> mix format --check-formatted"
|
||||
mix format --check-formatted
|
||||
echo "==> mix format ok"
|
|
@ -0,0 +1,50 @@
|
|||
name: 'Run jmeter'
|
||||
|
||||
inputs:
|
||||
version-emqx:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: emqx-docker
|
||||
path: /tmp
|
||||
- name: load docker image
|
||||
shell: bash
|
||||
env:
|
||||
PKG_VSN: ${{ inputs.version-emqx }}
|
||||
run: |
|
||||
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
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: emqx/emqx-fvt
|
||||
ref: broker-autotest-v5
|
||||
path: scripts
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '8.0.282' # The JDK version to make available on the path.
|
||||
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
|
||||
architecture: x64 # (x64 or x86) - defaults to x64
|
||||
# https://github.com/actions/setup-java/blob/main/docs/switching-to-v2.md
|
||||
distribution: 'zulu'
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: apache-jmeter.tgz
|
||||
- name: install jmeter
|
||||
shell: bash
|
||||
env:
|
||||
JMETER_VERSION: 5.4.3
|
||||
run: |
|
||||
tar -xf apache-jmeter.tgz
|
||||
ln -s apache-jmeter-$JMETER_VERSION jmeter
|
||||
echo "jmeter.save.saveservice.output_format=xml" >> jmeter/user.properties
|
||||
echo "jmeter.save.saveservice.response_data.on_error=true" >> jmeter/user.properties
|
||||
cd jmeter/lib/ext
|
||||
wget --no-verbose https://raw.githubusercontent.com/xmeter-net/mqtt-jmeter/master/Download/v2.0.2/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar
|
||||
wget --no-verbose https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.16/mysql-connector-java-8.0.16.jar
|
||||
wget --no-verbose https://repo1.maven.org/maven2/org/postgresql/postgresql/42.2.18/postgresql-42.2.18.jar
|
|
@ -0,0 +1,204 @@
|
|||
name: PR Entrypoint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
IS_CI: "yes"
|
||||
OTP_VSN: "25.3.2-1"
|
||||
ELIXIR_VSN: "1.14.5"
|
||||
BUILDER_VSN: "25.3.2-1"
|
||||
|
||||
jobs:
|
||||
sanity-checks:
|
||||
runs-on: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }}
|
||||
container: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
|
||||
outputs:
|
||||
ct-matrix: ${{ steps.matrix.outputs.ct-matrix }}
|
||||
ct-host: ${{ steps.matrix.outputs.ct-host }}
|
||||
ct-docker: ${{ steps.matrix.outputs.ct-docker }}
|
||||
version-emqx: ${{ steps.matrix.outputs.version-emqx }}
|
||||
version-emqx-enterprise: ${{ steps.matrix.outputs.version-emqx-enterprise }}
|
||||
runner: ${{ github.repository_owner == 'emqx' && 'aws-amd64' || 'ubuntu-22.04' }}
|
||||
builder: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
|
||||
builder_vsn: "5.1-3"
|
||||
otp_vsn: "25.3.2-1"
|
||||
elixir_vsn: "1.14.5"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: ./.github/actions/pr-sanity-checks
|
||||
- name: Build matrix
|
||||
id: matrix
|
||||
run: |
|
||||
APPS="$(./scripts/find-apps.sh --ci)"
|
||||
MATRIX="$(echo "${APPS}" | jq -c '
|
||||
[
|
||||
(.[] | select(.profile == "emqx") | . + {
|
||||
builder: "${BUILDER_VSN}",
|
||||
otp: "${OTP_VSN}",
|
||||
elixir: "${ELIXIR_VSN}"
|
||||
}),
|
||||
(.[] | select(.profile == "emqx-enterprise") | . + {
|
||||
builder: "${BUILDER_VSN}",
|
||||
otp: ["${OTP_VSN}"][],
|
||||
elixir: "${ELIXIR_VSN}"
|
||||
})
|
||||
]
|
||||
')"
|
||||
echo "${MATRIX}" | jq
|
||||
CT_MATRIX="$(echo "${MATRIX}" | jq -c 'map({profile, builder, otp, elixir}) | unique')"
|
||||
CT_HOST="$(echo "${MATRIX}" | jq -c 'map(select(.runner == "host"))')"
|
||||
CT_DOCKER="$(echo "${MATRIX}" | jq -c 'map(select(.runner == "docker"))')"
|
||||
echo "ct-matrix=${CT_MATRIX}" | tee -a $GITHUB_OUTPUT
|
||||
echo "ct-host=${CT_HOST}" | tee -a $GITHUB_OUTPUT
|
||||
echo "ct-docker=${CT_DOCKER}" | tee -a $GITHUB_OUTPUT
|
||||
echo "version-emqx=$(./pkg-vsn.sh emqx)" | tee -a $GITHUB_OUTPUT
|
||||
echo "version-emqx-enterprise=$(./pkg-vsn.sh emqx-enterprise)" | tee -a $GITHUB_OUTPUT
|
||||
|
||||
compile:
|
||||
runs-on: ${{ needs.sanity-checks.outputs.runner }}
|
||||
container: ${{ needs.sanity-checks.outputs.builder }}
|
||||
needs:
|
||||
- sanity-checks
|
||||
strategy:
|
||||
matrix:
|
||||
profile:
|
||||
- emqx
|
||||
- emqx-enterprise
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Work around https://github.com/actions/checkout/issues/766
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- id: compile
|
||||
env:
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
ENABLE_COVER_COMPILE: 1
|
||||
run: |
|
||||
make $PROFILE
|
||||
zip -ryq $PROFILE.zip .
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.profile }}
|
||||
path: ${{ matrix.profile }}.zip
|
||||
retention-days: 1
|
||||
|
||||
run_test_cases:
|
||||
needs:
|
||||
- sanity-checks
|
||||
- compile
|
||||
uses: ./.github/workflows/run_test_cases.yaml
|
||||
with:
|
||||
runner: ${{ needs.sanity-checks.outputs.runner }}
|
||||
builder: ${{ needs.sanity-checks.outputs.builder }}
|
||||
ct-matrix: ${{ needs.sanity-checks.outputs.ct-matrix }}
|
||||
ct-host: ${{ needs.sanity-checks.outputs.ct-host }}
|
||||
ct-docker: ${{ needs.sanity-checks.outputs.ct-docker }}
|
||||
|
||||
static_checks:
|
||||
needs:
|
||||
- sanity-checks
|
||||
- compile
|
||||
uses: ./.github/workflows/static_checks.yaml
|
||||
with:
|
||||
runner: ${{ needs.sanity-checks.outputs.runner }}
|
||||
builder: ${{ needs.sanity-checks.outputs.builder }}
|
||||
ct-matrix: ${{ needs.sanity-checks.outputs.ct-matrix }}
|
||||
|
||||
build_slim_packages:
|
||||
needs:
|
||||
- sanity-checks
|
||||
uses: ./.github/workflows/build_slim_packages.yaml
|
||||
with:
|
||||
runner: ${{ needs.sanity-checks.outputs.runner }}
|
||||
builder: ${{ needs.sanity-checks.outputs.builder }}
|
||||
builder_vsn: ${{ needs.sanity-checks.outputs.builder_vsn }}
|
||||
otp_vsn: ${{ needs.sanity-checks.outputs.otp_vsn }}
|
||||
elixir_vsn: ${{ needs.sanity-checks.outputs.elixir_vsn }}
|
||||
|
||||
build_docker_for_test:
|
||||
needs:
|
||||
- sanity-checks
|
||||
uses: ./.github/workflows/build_docker_for_test.yaml
|
||||
with:
|
||||
otp_vsn: ${{ needs.sanity-checks.outputs.otp_vsn }}
|
||||
elixir_vsn: ${{ needs.sanity-checks.outputs.elixir_vsn }}
|
||||
version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }}
|
||||
version-emqx-enterprise: ${{ needs.sanity-checks.outputs.version-emqx-enterprise }}
|
||||
|
||||
spellcheck:
|
||||
needs:
|
||||
- sanity-checks
|
||||
- build_slim_packages
|
||||
uses: ./.github/workflows/spellcheck.yaml
|
||||
with:
|
||||
runner: ${{ needs.sanity-checks.outputs.runner }}
|
||||
|
||||
run_conf_tests:
|
||||
needs:
|
||||
- sanity-checks
|
||||
- compile
|
||||
uses: ./.github/workflows/run_conf_tests.yaml
|
||||
with:
|
||||
runner: ${{ needs.sanity-checks.outputs.runner }}
|
||||
builder: ${{ needs.sanity-checks.outputs.builder }}
|
||||
|
||||
check_deps_integrity:
|
||||
needs:
|
||||
- sanity-checks
|
||||
uses: ./.github/workflows/check_deps_integrity.yaml
|
||||
with:
|
||||
runner: ${{ needs.sanity-checks.outputs.runner }}
|
||||
builder: ${{ needs.sanity-checks.outputs.builder }}
|
||||
|
||||
elixir_release:
|
||||
needs:
|
||||
- sanity-checks
|
||||
- compile
|
||||
uses: ./.github/workflows/elixir_release.yaml
|
||||
with:
|
||||
runner: ${{ needs.sanity-checks.outputs.runner }}
|
||||
builder: ${{ needs.sanity-checks.outputs.builder }}
|
||||
|
||||
run_relup_tests:
|
||||
needs:
|
||||
- sanity-checks
|
||||
- compile
|
||||
uses: ./.github/workflows/run_relup_tests.yaml
|
||||
with:
|
||||
runner: ${{ needs.sanity-checks.outputs.runner }}
|
||||
builder: ${{ needs.sanity-checks.outputs.builder }}
|
||||
|
||||
run_jmeter_tests:
|
||||
needs:
|
||||
- sanity-checks
|
||||
- build_docker_for_test
|
||||
uses: ./.github/workflows/run_jmeter_tests.yaml
|
||||
with:
|
||||
runner: ${{ needs.sanity-checks.outputs.runner }}
|
||||
version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }}
|
||||
|
||||
run_docker_tests:
|
||||
needs:
|
||||
- sanity-checks
|
||||
- build_docker_for_test
|
||||
uses: ./.github/workflows/run_docker_tests.yaml
|
||||
with:
|
||||
runner: ${{ needs.sanity-checks.outputs.runner }}
|
||||
version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }}
|
||||
version-emqx-enterprise: ${{ needs.sanity-checks.outputs.version-emqx-enterprise }}
|
||||
|
||||
run_helm_tests:
|
||||
needs:
|
||||
- sanity-checks
|
||||
- build_docker_for_test
|
||||
uses: ./.github/workflows/run_helm_tests.yaml
|
||||
with:
|
||||
version-emqx: ${{ needs.sanity-checks.outputs.version-emqx }}
|
||||
version-emqx-enterprise: ${{ needs.sanity-checks.outputs.version-emqx-enterprise }}
|
|
@ -1,14 +0,0 @@
|
|||
name: Check Apps Version
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
check_apps_version:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Check apps version
|
||||
run: ./scripts/apps-version-check.sh
|
|
@ -4,22 +4,22 @@ concurrency:
|
|||
group: docker-build-${{ github.event_name }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
- e*
|
||||
- docker-latest-*
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
branch_or_tag:
|
||||
required: false
|
||||
profile:
|
||||
required: false
|
||||
default: 'emqx'
|
||||
is_latest:
|
||||
required: false
|
||||
default: false
|
||||
# on:
|
||||
# push:
|
||||
# tags:
|
||||
# - v*
|
||||
# - e*
|
||||
# - docker-latest-*
|
||||
# workflow_dispatch:
|
||||
# inputs:
|
||||
# branch_or_tag:
|
||||
# required: false
|
||||
# profile:
|
||||
# required: false
|
||||
# default: 'emqx'
|
||||
# is_latest:
|
||||
# required: false
|
||||
# default: false
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
name: Build docker image for test
|
||||
|
||||
concurrency:
|
||||
group: docker-test-build-${{ github.event_name }}-${{ github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
otp_vsn:
|
||||
required: true
|
||||
type: string
|
||||
elixir_vsn:
|
||||
required: true
|
||||
type: string
|
||||
version-emqx:
|
||||
required: true
|
||||
type: string
|
||||
version-emqx-enterprise:
|
||||
required: true
|
||||
type: string
|
||||
# on:
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
# - release-51
|
||||
# pull_request:
|
||||
# # GitHub pull_request action is by default triggered when
|
||||
# # opened reopened or synchronize,
|
||||
# # we add labeled and unlabeled to the list because
|
||||
# # the mac job dpends on the PR having a 'Mac' label
|
||||
# types:
|
||||
# - labeled
|
||||
# - unlabeled
|
||||
# - opened
|
||||
# - reopened
|
||||
# - synchronize
|
||||
# workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
EMQX_NAME: ${{ matrix.profile }}
|
||||
PKG_VSN: ${{ matrix.profile == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }}
|
||||
OTP_VSN: ${{ inputs.otp_vsn }}
|
||||
ELIXIR_VSN: ${{ inputs.elixir_vsn }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
profile:
|
||||
- emqx
|
||||
- emqx-enterprise
|
||||
- emqx-elixir
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: build and export to Docker
|
||||
id: build
|
||||
run: |
|
||||
make ${EMQX_NAME}-docker
|
||||
echo "EMQX_IMAGE_TAG=$(cat .docker_image_tag)" >> $GITHUB_ENV
|
||||
- name: smoke test
|
||||
run: |
|
||||
CID=$(docker run -d --rm -P $EMQX_IMAGE_TAG)
|
||||
HTTP_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "18083/tcp") 0).HostPort}}' $CID)
|
||||
./scripts/test/emqx-smoke-test.sh localhost $HTTP_PORT
|
||||
docker stop $CID
|
||||
- name: export docker image
|
||||
run: |
|
||||
docker save $EMQX_IMAGE_TAG | gzip > $EMQX_NAME-docker-$PKG_VSN.tar.gz
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "${{ env.EMQX_NAME }}-docker"
|
||||
path: "${{ env.EMQX_NAME }}-docker-${{ env.PKG_VSN }}.tar.gz"
|
||||
retention-days: 3
|
||||
|
|
@ -4,19 +4,19 @@ concurrency:
|
|||
group: build-${{ github.event_name }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'ci/**'
|
||||
tags:
|
||||
- v*
|
||||
- e*
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
branch_or_tag:
|
||||
required: false
|
||||
profile:
|
||||
required: false
|
||||
# on:
|
||||
# push:
|
||||
# branches:
|
||||
# - 'ci/**'
|
||||
# tags:
|
||||
# - v*
|
||||
# - e*
|
||||
# workflow_dispatch:
|
||||
# inputs:
|
||||
# branch_or_tag:
|
||||
# required: false
|
||||
# profile:
|
||||
# required: false
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
|
@ -88,7 +88,7 @@ jobs:
|
|||
fetch-depth: 0
|
||||
|
||||
- uses: ilammy/msvc-dev-cmd@v1.12.0
|
||||
- uses: erlef/setup-beam@v1.15.4
|
||||
- uses: erlef/setup-beam@v1.16.0
|
||||
with:
|
||||
otp-version: 25.3.2
|
||||
- name: build
|
||||
|
|
|
@ -1,30 +1,50 @@
|
|||
name: Build slim packages
|
||||
|
||||
concurrency:
|
||||
group: slim-${{ github.event_name }}-${{ github.ref }}
|
||||
group: slim-${{ github.event_name }}-${{ github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- release-51
|
||||
pull_request:
|
||||
# GitHub pull_request action is by default triggered when
|
||||
# opened reopened or synchronize,
|
||||
# we add labeled and unlabeled to the list because
|
||||
# the mac job dpends on the PR having a 'Mac' label
|
||||
types:
|
||||
- labeled
|
||||
- unlabeled
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runner:
|
||||
required: true
|
||||
type: string
|
||||
builder:
|
||||
required: true
|
||||
type: string
|
||||
builder_vsn:
|
||||
required: true
|
||||
type: string
|
||||
otp_vsn:
|
||||
required: true
|
||||
type: string
|
||||
elixir_vsn:
|
||||
required: true
|
||||
type: string
|
||||
# on:
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
# - release-51
|
||||
# pull_request:
|
||||
# # GitHub pull_request action is by default triggered when
|
||||
# # opened reopened or synchronize,
|
||||
# # we add labeled and unlabeled to the list because
|
||||
# # the mac job dpends on the PR having a 'Mac' label
|
||||
# types:
|
||||
# - labeled
|
||||
# - unlabeled
|
||||
# - opened
|
||||
# - reopened
|
||||
# - synchronize
|
||||
# workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
runs-on: aws-amd64
|
||||
runs-on: ${{ inputs.runner }}
|
||||
env:
|
||||
EMQX_NAME: ${{ matrix.profile[0] }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
@ -34,25 +54,18 @@ jobs:
|
|||
- ["emqx", "25.3.2-1", "ubuntu22.04", "elixir"]
|
||||
- ["emqx-enterprise", "25.3.2-1", "amzn2023", "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/${{ inputs.builder_vsn }}:${{ inputs.elixir_vsn }}-${{ matrix.profile[1] }}-${{ matrix.profile[2] }}"
|
||||
|
||||
steps:
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: prepare
|
||||
run: |
|
||||
echo "EMQX_NAME=${{ matrix.profile[0] }}" >> $GITHUB_ENV
|
||||
echo "CODE_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
|
||||
- name: Work around https://github.com/actions/checkout/issues/766
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
echo "CODE_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
|
||||
- name: build and test tgz package
|
||||
if: matrix.profile[3] == 'erlang'
|
||||
run: |
|
||||
|
@ -77,12 +90,14 @@ jobs:
|
|||
with:
|
||||
name: "${{ matrix.profile[0] }}-${{ matrix.profile[1] }}-${{ matrix.profile[2] }}"
|
||||
path: _packages/${{ matrix.profile[0] }}/*
|
||||
retention-days: 7
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "${{ matrix.profile[0] }}_schema_dump"
|
||||
path: |
|
||||
scripts/spellcheck
|
||||
_build/docgen/${{ matrix.profile[0] }}/schema-en.json
|
||||
retention-days: 7
|
||||
|
||||
windows:
|
||||
runs-on: windows-2019
|
||||
|
@ -96,7 +111,7 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ilammy/msvc-dev-cmd@v1.12.0
|
||||
- uses: erlef/setup-beam@v1.15.4
|
||||
- uses: erlef/setup-beam@v1.16.0
|
||||
with:
|
||||
otp-version: ${{ matrix.otp }}
|
||||
- name: build
|
||||
|
@ -129,6 +144,7 @@ jobs:
|
|||
with:
|
||||
name: windows
|
||||
path: _packages/${{ matrix.profile }}/*
|
||||
retention-days: 7
|
||||
|
||||
mac:
|
||||
strategy:
|
||||
|
@ -138,18 +154,17 @@ jobs:
|
|||
- emqx
|
||||
- emqx-enterprise
|
||||
otp:
|
||||
- 25.3.2-1
|
||||
- ${{ inputs.otp_vsn }}
|
||||
os:
|
||||
- macos-11
|
||||
- macos-12-arm64
|
||||
- macos-13
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
EMQX_NAME: ${{ matrix.profile }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: prepare
|
||||
run: |
|
||||
echo "EMQX_NAME=${{ matrix.profile }}" >> $GITHUB_ENV
|
||||
- uses: ./.github/actions/package-macos
|
||||
with:
|
||||
profile: ${{ matrix.profile }}
|
||||
|
@ -163,84 +178,4 @@ jobs:
|
|||
with:
|
||||
name: ${{ matrix.os }}
|
||||
path: _packages/**/*
|
||||
|
||||
docker:
|
||||
runs-on: aws-amd64
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
profile:
|
||||
- ["emqx", "5.0.16"]
|
||||
- ["emqx-enterprise", "5.0.1"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: prepare
|
||||
run: |
|
||||
EMQX_NAME=${{ matrix.profile[0] }}
|
||||
PKG_VSN=${PKG_VSN:-$(./pkg-vsn.sh $EMQX_NAME)}
|
||||
EMQX_IMAGE_TAG=emqx/$EMQX_NAME:test
|
||||
EMQX_IMAGE_OLD_VERSION_TAG=emqx/$EMQX_NAME:${{ matrix.profile[1] }}
|
||||
echo "EMQX_NAME=$EMQX_NAME" >> $GITHUB_ENV
|
||||
echo "PKG_VSN=$PKG_VSN" >> $GITHUB_ENV
|
||||
echo "EMQX_IMAGE_TAG=$EMQX_IMAGE_TAG" >> $GITHUB_ENV
|
||||
echo "EMQX_IMAGE_OLD_VERSION_TAG=$EMQX_IMAGE_OLD_VERSION_TAG" >> $GITHUB_ENV
|
||||
- uses: docker/setup-buildx-action@v2
|
||||
- name: build and export to Docker
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./deploy/docker/Dockerfile
|
||||
load: true
|
||||
tags: ${{ env.EMQX_IMAGE_TAG }}
|
||||
build-args: |
|
||||
EMQX_NAME=${{ env.EMQX_NAME }}
|
||||
- name: smoke test
|
||||
run: |
|
||||
CID=$(docker run -d --rm -P $EMQX_IMAGE_TAG)
|
||||
HTTP_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "18083/tcp") 0).HostPort}}' $CID)
|
||||
./scripts/test/emqx-smoke-test.sh localhost $HTTP_PORT
|
||||
docker stop $CID
|
||||
- name: dashboard tests
|
||||
working-directory: ./scripts/ui-tests
|
||||
run: |
|
||||
set -eu
|
||||
docker compose up --abort-on-container-exit --exit-code-from selenium
|
||||
- name: test two nodes cluster with proto_dist=inet_tls in docker
|
||||
run: |
|
||||
./scripts/test/start-two-nodes-in-docker.sh -P $EMQX_IMAGE_TAG $EMQX_IMAGE_OLD_VERSION_TAG
|
||||
HTTP_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "18083/tcp") 0).HostPort}}' haproxy)
|
||||
./scripts/test/emqx-smoke-test.sh localhost $HTTP_PORT
|
||||
# cleanup
|
||||
./scripts/test/start-two-nodes-in-docker.sh -c
|
||||
- name: export docker image
|
||||
run: |
|
||||
docker save $EMQX_IMAGE_TAG | gzip > $EMQX_NAME-$PKG_VSN.tar.gz
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: "${{ matrix.profile[0] }}-docker"
|
||||
path: "${{ env.EMQX_NAME }}-${{ env.PKG_VSN }}.tar.gz"
|
||||
- name: cleanup
|
||||
if: always()
|
||||
working-directory: ./scripts/ui-tests
|
||||
run: |
|
||||
docker compose rm -fs
|
||||
|
||||
spellcheck:
|
||||
needs: linux
|
||||
strategy:
|
||||
matrix:
|
||||
profile:
|
||||
- emqx
|
||||
- emqx-enterprise
|
||||
runs-on: aws-amd64
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
name: Download schema dump
|
||||
with:
|
||||
name: "${{ matrix.profile }}_schema_dump"
|
||||
path: /tmp/
|
||||
- name: Run spellcheck
|
||||
run: |
|
||||
bash /tmp/scripts/spellcheck/spellcheck.sh /tmp/_build/docgen/${{ matrix.profile }}/schema-en.json
|
||||
retention-days: 7
|
||||
|
|
|
@ -1,14 +1,46 @@
|
|||
name: Check Rebar Dependencies
|
||||
name: Check integrity of rebar and mix dependencies
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runner:
|
||||
required: true
|
||||
type: string
|
||||
builder:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
check_deps_integrity:
|
||||
runs-on: ubuntu-22.04
|
||||
container: ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04
|
||||
|
||||
runs-on: ${{ inputs.runner }}
|
||||
container: ${{ inputs.builder }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run check-deps-integrity.escript
|
||||
run: ./scripts/check-deps-integrity.escript
|
||||
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- run: make ensure-rebar3
|
||||
- run: ./scripts/check-deps-integrity.escript
|
||||
- name: Setup mix
|
||||
env:
|
||||
MIX_ENV: emqx-enterprise
|
||||
PROFILE: emqx-enterprise
|
||||
run: |
|
||||
mix local.hex --force
|
||||
mix local.rebar --force
|
||||
mix deps.get
|
||||
- run: ./scripts/check-elixir-deps-discrepancies.exs
|
||||
env:
|
||||
MIX_ENV: emqx-enterprise
|
||||
PROFILE: emqx-enterprise
|
||||
- run: ./scripts/check-elixir-applications.exs
|
||||
env:
|
||||
MIX_ENV: emqx-enterprise
|
||||
PROFILE: emqx-enterprise
|
||||
- name: Upload produced lock files
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: produced_lock_files
|
||||
path: |
|
||||
mix.lock
|
||||
rebar.lock
|
||||
retention-days: 1
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
name: Code style check
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
code_style_check:
|
||||
runs-on: ubuntu-22.04
|
||||
container: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1000
|
||||
- name: Work around https://github.com/actions/checkout/issues/766
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: Check line-break at EOF
|
||||
run: |
|
||||
./scripts/check-nl-at-eof.sh
|
||||
- name: Check Elixir code formatting
|
||||
run: |
|
||||
mix format --check-formatted
|
||||
|
||||
- name: Check Erlang code formatting
|
||||
run: |
|
||||
./scripts/check-format.sh
|
||||
|
||||
- name: Run elvis check
|
||||
run: |
|
||||
./scripts/elvis-check.sh $GITHUB_BASE_REF
|
|
@ -1,45 +0,0 @@
|
|||
---
|
||||
|
||||
name: Check Elixir Release Applications
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
elixir_apps_check:
|
||||
runs-on: ubuntu-22.04
|
||||
# just use the latest builder
|
||||
container: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
profile:
|
||||
- emqx
|
||||
- emqx-enterprise
|
||||
- emqx-pkg
|
||||
- emqx-enterprise-pkg
|
||||
|
||||
steps:
|
||||
- name: fix_git_permission
|
||||
run: git config --global --add safe.directory '/__w/emqx/emqx'
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: ensure rebar
|
||||
run: ./scripts/ensure-rebar3.sh
|
||||
- name: Work around https://github.com/actions/checkout/issues/766
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: check applications
|
||||
run: ./scripts/check-elixir-applications.exs
|
||||
env:
|
||||
MIX_ENV: ${{ matrix.profile }}
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
# - name: check applications started with emqx_machine
|
||||
# run: ./scripts/check-elixir-emqx-machine-boot-discrepancies.exs
|
||||
# env:
|
||||
# MIX_ENV: ${{ matrix.profile }}
|
||||
|
||||
...
|
|
@ -1,49 +0,0 @@
|
|||
---
|
||||
|
||||
name: Elixir Dependency Version Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
elixir_deps_check:
|
||||
runs-on: ubuntu-22.04
|
||||
container: ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: ensure rebar
|
||||
run: ./scripts/ensure-rebar3.sh
|
||||
- name: Work around https://github.com/actions/checkout/issues/766
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: setup mix
|
||||
run: |
|
||||
mix local.hex --force
|
||||
mix local.rebar --force
|
||||
mix deps.get
|
||||
# we check only enterprise because `rebar3 tree`, even if an
|
||||
# enterprise app is excluded from `project_app_dirs` in
|
||||
# `rebar.config.erl`, will still list dependencies from it.
|
||||
# Since the enterprise profile is a superset of the
|
||||
# community one and thus more complete, we use the former.
|
||||
env:
|
||||
MIX_ENV: emqx-enterprise
|
||||
PROFILE: emqx-enterprise
|
||||
- name: check elixir deps
|
||||
run: ./scripts/check-elixir-deps-discrepancies.exs
|
||||
env:
|
||||
MIX_ENV: emqx-enterprise
|
||||
PROFILE: emqx-enterprise
|
||||
- name: produced lock files
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: produced_lock_files
|
||||
path: |
|
||||
mix.lock
|
||||
rebar.lock
|
||||
retention-days: 1
|
||||
|
||||
...
|
|
@ -0,0 +1,50 @@
|
|||
# FIXME: temporary workflow for testing; remove later
|
||||
name: Elixir Build (temporary)
|
||||
|
||||
concurrency:
|
||||
group: mix-${{ github.event_name }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runner:
|
||||
required: true
|
||||
type: string
|
||||
builder:
|
||||
required: true
|
||||
type: string
|
||||
# on:
|
||||
# pull_request:
|
||||
# workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
elixir_release_build:
|
||||
runs-on: ${{ inputs.runner }}
|
||||
container: ${{ inputs.builder }}
|
||||
strategy:
|
||||
matrix:
|
||||
profile:
|
||||
- emqx
|
||||
- emqx-enterprise
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.profile }}
|
||||
- name: extract artifact
|
||||
run: |
|
||||
unzip -o -q ${{ matrix.profile }}.zip
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: elixir release
|
||||
run: make ${{ matrix.profile }}-elixir
|
||||
- name: start release
|
||||
run: |
|
||||
_build/${{ matrix.profile }}/rel/emqx/bin/emqx start
|
||||
- name: check if started
|
||||
run: |
|
||||
set -e
|
||||
sleep 10
|
||||
timeout 1 bash -c '</dev/tcp/localhost/1883'
|
||||
_build/${{ matrix.profile }}/rel/emqx/bin/emqx ping
|
||||
_build/${{ matrix.profile }}/rel/emqx/bin/emqx ctl status
|
||||
./scripts/test/emqx-smoke-test.sh localhost 18083
|
|
@ -1,41 +0,0 @@
|
|||
# FIXME: temporary workflow for testing; remove later
|
||||
name: Elixir Build (temporary)
|
||||
|
||||
concurrency:
|
||||
group: mix-${{ github.event_name }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
elixir_release_build:
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
profile:
|
||||
- emqx
|
||||
- emqx-enterprise
|
||||
container: ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: install tools
|
||||
run: apt update && apt install netcat-openbsd
|
||||
- name: Work around https://github.com/actions/checkout/issues/766
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- name: elixir release
|
||||
run: make ${{ matrix.profile }}-elixir
|
||||
- name: start release
|
||||
run: |
|
||||
cd _build/${{ matrix.profile }}/rel/emqx
|
||||
bin/emqx start
|
||||
- name: check if started
|
||||
run: |
|
||||
sleep 10
|
||||
nc -zv localhost 1883
|
||||
cd _build/${{ matrix.profile }}/rel/emqx
|
||||
bin/emqx ping
|
||||
bin/emqx ctl status
|
|
@ -1,53 +1,59 @@
|
|||
name: Run Configuration tests
|
||||
|
||||
concurrency:
|
||||
group: conftest-${{ github.event_name }}-${{ github.ref }}
|
||||
group: conftest-${{ github.event_name }}-${{ github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'ci/**'
|
||||
tags:
|
||||
- v*
|
||||
- e*
|
||||
pull_request:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runner:
|
||||
required: true
|
||||
type: string
|
||||
builder:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
env:
|
||||
IS_CI: "yes"
|
||||
# on:
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
# - 'ci/**'
|
||||
# tags:
|
||||
# - v*
|
||||
# - e*
|
||||
# pull_request:
|
||||
|
||||
jobs:
|
||||
run_conf_tests:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ${{ inputs.runner }}
|
||||
container: ${{ inputs.builder }}
|
||||
env:
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
profile:
|
||||
- emqx
|
||||
- emqx-enterprise
|
||||
container: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
|
||||
steps:
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: source
|
||||
- name: build_package
|
||||
working-directory: source
|
||||
name: ${{ matrix.profile }}
|
||||
- name: extract artifact
|
||||
run: |
|
||||
make ${{ matrix.profile }}
|
||||
- name: run_tests
|
||||
working-directory: source
|
||||
env:
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
run: |
|
||||
./scripts/conf-test/run.sh
|
||||
- name: print_erlang_log
|
||||
unzip -o -q ${{ matrix.profile }}.zip
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- run: ./scripts/test/check-example-configs.sh
|
||||
- run: ./scripts/conf-test/run.sh
|
||||
- name: print erlang log
|
||||
if: failure()
|
||||
run: |
|
||||
cat source/_build/${{ matrix.profile }}/rel/emqx/logs/erlang.log.*
|
||||
cat _build/${{ matrix.profile }}/rel/emqx/logs/erlang.log.*
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: logs-${{ matrix.profile }}
|
||||
path: source/_build/${{ matrix.profile }}/rel/emqx/logs
|
||||
path: _build/${{ matrix.profile }}/rel/emqx/logs
|
||||
|
||||
|
|
|
@ -0,0 +1,122 @@
|
|||
name: Docker image tests
|
||||
|
||||
concurrency:
|
||||
group: docker-tests-${{ github.event_name }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runner:
|
||||
required: true
|
||||
type: string
|
||||
version-emqx:
|
||||
required: true
|
||||
type: string
|
||||
version-emqx-enterprise:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
# on:
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
# - 'ci/**'
|
||||
# tags:
|
||||
# - v*
|
||||
# pull_request:
|
||||
|
||||
jobs:
|
||||
basic-tests:
|
||||
runs-on: ${{ inputs.runner }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
profile:
|
||||
- ["emqx", "5.0.16"]
|
||||
- ["emqx-elixir", "5.0.16"]
|
||||
- ["emqx-enterprise", "5.0.1"]
|
||||
|
||||
env:
|
||||
EMQX_NAME: ${{ matrix.profile[0] }}
|
||||
PKG_VSN: ${{ matrix.profile[0] == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }}
|
||||
EMQX_IMAGE_OLD_VERSION_TAG: emqx/${{ matrix.profile[0] }}:${{ matrix.profile[1] }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ env.EMQX_NAME }}-docker
|
||||
path: /tmp
|
||||
- name: load docker image
|
||||
run: |
|
||||
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
|
||||
- name: test two nodes cluster with proto_dist=inet_tls in docker
|
||||
run: |
|
||||
./scripts/test/start-two-nodes-in-docker.sh -P $EMQX_IMAGE_TAG $EMQX_IMAGE_OLD_VERSION_TAG
|
||||
HTTP_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "18083/tcp") 0).HostPort}}' haproxy)
|
||||
./scripts/test/emqx-smoke-test.sh localhost $HTTP_PORT
|
||||
./scripts/test/start-two-nodes-in-docker.sh -c
|
||||
- name: dashboard tests
|
||||
working-directory: ./scripts/ui-tests
|
||||
run: |
|
||||
set -eu
|
||||
docker compose up --abort-on-container-exit --exit-code-from selenium
|
||||
- name: cleanup
|
||||
if: always()
|
||||
working-directory: ./scripts/ui-tests
|
||||
run: |
|
||||
docker compose rm -fs
|
||||
|
||||
pytest:
|
||||
runs-on: ${{ inputs.runner }}
|
||||
env:
|
||||
EMQX_NAME: ${{ matrix.profile }}
|
||||
PKG_VSN: ${{ matrix.profile == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }}
|
||||
DB_BACKEND: ${{ matrix.cluster_db_backend }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
profile:
|
||||
- emqx
|
||||
- emqx-enterprise
|
||||
- emqx-elixir
|
||||
cluster_db_backend:
|
||||
- mnesia
|
||||
- rlog
|
||||
steps:
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ env.EMQX_NAME }}-docker
|
||||
path: /tmp
|
||||
- name: load docker image
|
||||
run: |
|
||||
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
|
||||
- name: run emqx
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
./.ci/docker-compose-file/scripts/run-emqx.sh $EMQX_IMAGE_TAG $DB_BACKEND
|
||||
- name: make paho tests
|
||||
run: |
|
||||
if ! docker exec -i python /scripts/pytest.sh "$DB_BACKEND"; then
|
||||
echo "DUMP_CONTAINER_LOGS_BGN"
|
||||
echo "============== haproxy =============="
|
||||
docker logs haproxy
|
||||
echo "============== node1 =============="
|
||||
docker logs node1.emqx.io
|
||||
echo "============== node2 =============="
|
||||
docker logs node2.emqx.io
|
||||
echo "DUMP_CONTAINER_LOGS_END"
|
||||
exit 1
|
||||
fi
|
||||
# simple smoke test for node_dump
|
||||
- name: test node_dump
|
||||
run: |
|
||||
docker exec -u root node1.emqx.io apt update && apt install -y net-tools
|
||||
docker exec node1.emqx.io node_dump
|
|
@ -1,80 +0,0 @@
|
|||
name: Check emqx app standalone
|
||||
|
||||
## apps/emqx can be used as a rebar/mix dependency
|
||||
## in other project, so we need to make sure apps/emqx
|
||||
## as an Erlang/Elixir app works standalone
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
run_emqx_app_tests:
|
||||
strategy:
|
||||
matrix:
|
||||
builder:
|
||||
- 5.1-3
|
||||
otp:
|
||||
- 25.3.2-1
|
||||
# no need to use more than 1 version of Elixir, since tests
|
||||
# run using only Erlang code. This is needed just to specify
|
||||
# the base image.
|
||||
elixir:
|
||||
- 1.14.5
|
||||
os:
|
||||
- ubuntu22.04
|
||||
arch:
|
||||
- amd64
|
||||
runs-on:
|
||||
- aws-amd64
|
||||
- ubuntu-22.04
|
||||
use-self-hosted:
|
||||
- ${{ github.repository_owner == 'emqx' }}
|
||||
exclude:
|
||||
- runs-on: ubuntu-22.04
|
||||
use-self-hosted: true
|
||||
- runs-on: aws-amd64
|
||||
use-self-hosted: false
|
||||
|
||||
runs-on: ${{ matrix.runs-on }}
|
||||
container: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir}}-${{ matrix.otp }}-${{ matrix.os }}"
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: run
|
||||
run: |
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
echo "git diff base: $GITHUB_BASE_REF"
|
||||
if [[ "$GITHUB_BASE_REF" =~ [0-9a-f]{8,40} ]]; then
|
||||
# base is a commit sha1
|
||||
compare_base="$GITHUB_BASE_REF"
|
||||
else
|
||||
repo="${GITHUB_REPOSITORY}"
|
||||
git remote -v
|
||||
remote="$(git remote -v | grep -E "github\.com(:|/)$repo((\.git)|(\s))" | grep fetch | awk '{print $1}')"
|
||||
git fetch "$remote" "$GITHUB_BASE_REF"
|
||||
compare_base="$remote/$GITHUB_BASE_REF"
|
||||
fi
|
||||
changed_files="$(git diff --name-only ${compare_base} HEAD apps/emqx)"
|
||||
if [ "$changed_files" = '' ]; then
|
||||
echo "nothing changed in apps/emqx, ignored."
|
||||
exit 0
|
||||
fi
|
||||
make ensure-rebar3
|
||||
cp rebar3 apps/emqx/
|
||||
cd apps/emqx
|
||||
./rebar3 xref
|
||||
./rebar3 dialyzer
|
||||
./rebar3 eunit -v
|
||||
./rebar3 ct --name 'test@127.0.0.1' -v --readable=true
|
||||
./rebar3 proper -d test/props
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: logs-${{ matrix.runs-on }}
|
||||
path: apps/emqx/_build/test/logs
|
|
@ -1,255 +0,0 @@
|
|||
name: Functional Verification Tests
|
||||
|
||||
concurrency:
|
||||
group: fvt-${{ github.event_name }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'ci/**'
|
||||
tags:
|
||||
- v*
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-22.04
|
||||
# prepare source with any OTP version, no need for a matrix
|
||||
container: ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-debian11
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: source
|
||||
fetch-depth: 0
|
||||
- name: get deps
|
||||
run: |
|
||||
make -C source deps-all
|
||||
zip -ryq source.zip source/* source/.[^.]*
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: source
|
||||
path: source.zip
|
||||
|
||||
docker_test:
|
||||
runs-on: ubuntu-22.04
|
||||
needs: prepare
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
profile:
|
||||
- emqx
|
||||
- emqx-enterprise
|
||||
- emqx-elixir
|
||||
cluster_db_backend:
|
||||
- mnesia
|
||||
- rlog
|
||||
os:
|
||||
- ["debian11", "debian:11-slim"]
|
||||
builder:
|
||||
- 5.1-3
|
||||
otp:
|
||||
- 25.3.2-1
|
||||
elixir:
|
||||
- 1.14.5
|
||||
arch:
|
||||
- amd64
|
||||
steps:
|
||||
- uses: erlef/setup-beam@v1.15.4
|
||||
with:
|
||||
otp-version: 25.3.2
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: source
|
||||
path: .
|
||||
- name: unzip source code
|
||||
run: unzip -q source.zip
|
||||
|
||||
- name: make docker image
|
||||
working-directory: source
|
||||
env:
|
||||
EMQX_BUILDER: ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os[0] }}
|
||||
EMQX_RUNNER: ${{ matrix.os[1] }}
|
||||
run: |
|
||||
make ${{ matrix.profile }}-docker
|
||||
- name: run emqx
|
||||
timeout-minutes: 5
|
||||
working-directory: source
|
||||
run: |
|
||||
set -x
|
||||
if [[ "${{ matrix.profile }}" = *-elixir ]]
|
||||
then
|
||||
export IS_ELIXIR=yes
|
||||
PROFILE=$(echo ${{ matrix.profile }} | sed -e "s/-elixir//g")
|
||||
IMAGE=emqx/$PROFILE:$(./pkg-vsn.sh ${{ matrix.profile }})-elixir
|
||||
else
|
||||
IMAGE=emqx/${{ matrix.profile }}:$(./pkg-vsn.sh ${{ matrix.profile }})
|
||||
fi
|
||||
./.ci/docker-compose-file/scripts/run-emqx.sh $IMAGE ${{ matrix.cluster_db_backend }}
|
||||
- name: make paho tests
|
||||
run: |
|
||||
if ! docker exec -i python /scripts/pytest.sh "${{ matrix.cluster_db_backend }}"; then
|
||||
echo "DUMP_CONTAINER_LOGS_BGN"
|
||||
echo "============== haproxy =============="
|
||||
docker logs haproxy
|
||||
echo "============== node1 =============="
|
||||
docker logs node1.emqx.io
|
||||
echo "============== node2 =============="
|
||||
docker logs node2.emqx.io
|
||||
echo "DUMP_CONTAINER_LOGS_END"
|
||||
exit 1
|
||||
fi
|
||||
# simple smoke test for node_dump
|
||||
- name: test node_dump
|
||||
run: |
|
||||
docker exec node1.emqx.io node_dump
|
||||
|
||||
helm_test:
|
||||
runs-on: ubuntu-22.04
|
||||
needs: prepare
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
discovery:
|
||||
- k8s
|
||||
- dns
|
||||
profile:
|
||||
- emqx
|
||||
- emqx-enterprise
|
||||
os:
|
||||
- ["debian11", "debian:11-slim"]
|
||||
builder:
|
||||
- 5.1-3
|
||||
otp:
|
||||
- 25.3.2-1
|
||||
elixir:
|
||||
- 1.14.5
|
||||
arch:
|
||||
- amd64
|
||||
# - emqx-enterprise # TODO test enterprise
|
||||
|
||||
steps:
|
||||
- uses: erlef/setup-beam@v1.15.4
|
||||
with:
|
||||
otp-version: 25.3.2
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: source
|
||||
path: .
|
||||
- name: unzip source code
|
||||
run: unzip -q source.zip
|
||||
|
||||
- name: make docker image
|
||||
working-directory: source
|
||||
env:
|
||||
EMQX_BUILDER: ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-${{ matrix.os[0] }}
|
||||
EMQX_RUNNER: ${{ matrix.os[1] }}
|
||||
run: |
|
||||
make ${{ matrix.profile }}-docker
|
||||
echo "TARGET=emqx/${{ matrix.profile }}" >> $GITHUB_ENV
|
||||
echo "EMQX_TAG=$(./pkg-vsn.sh ${{ matrix.profile }})" >> $GITHUB_ENV
|
||||
- run: minikube start
|
||||
- run: minikube image load $TARGET:$EMQX_TAG
|
||||
- name: run emqx on chart
|
||||
working-directory: source
|
||||
if: matrix.discovery == 'k8s'
|
||||
run: |
|
||||
helm install ${{ matrix.profile }} \
|
||||
--set emqxConfig.EMQX_CLUSTER__DISCOVERY_STRATEGY="k8s" \
|
||||
--set emqxConfig.EMQX_CLUSTER__K8S__APISERVER="https://kubernetes.default.svc:443" \
|
||||
--set emqxConfig.EMQX_CLUSTER__K8S__SERVICE_NAME="${{ matrix.profile }}-headless" \
|
||||
--set emqxConfig.EMQX_CLUSTER__K8S__NAMESPACE="default" \
|
||||
--set image.repository=$TARGET \
|
||||
--set image.pullPolicy=Never \
|
||||
--set image.tag=$EMQX_TAG \
|
||||
--set emqxAclConfig="" \
|
||||
--set emqxConfig.EMQX_MQTT__RETRY_INTERVAL=2s \
|
||||
--set emqxConfig.EMQX_MQTT__MAX_TOPIC_ALIAS=10 \
|
||||
--set emqxConfig.EMQX_AUTHORIZATION__SOURCES=[] \
|
||||
--set emqxConfig.EMQX_AUTHORIZATION__NO_MATCH=allow \
|
||||
deploy/charts/${{ matrix.profile }} \
|
||||
--debug
|
||||
- name: run emqx on chart
|
||||
working-directory: source
|
||||
if: matrix.discovery == 'dns'
|
||||
run: |
|
||||
helm install ${{ matrix.profile }} \
|
||||
--set emqxConfig.EMQX_CLUSTER__DISCOVERY_STRATEGY="dns" \
|
||||
--set emqxConfig.EMQX_CLUSTER__DNS__RECORD_TYPE="srv" \
|
||||
--set emqxConfig.EMQX_CLUSTER__DNS__NAME="${{ matrix.profile }}-headless.default.svc.cluster.local" \
|
||||
--set image.repository=$TARGET \
|
||||
--set image.pullPolicy=Never \
|
||||
--set image.tag=$EMQX_TAG \
|
||||
--set emqxAclConfig="" \
|
||||
--set emqxConfig.EMQX_MQTT__RETRY_INTERVAL=2s \
|
||||
--set emqxConfig.EMQX_MQTT__MAX_TOPIC_ALIAS=10 \
|
||||
--set emqxConfig.EMQX_AUTHORIZATION__SOURCES=[] \
|
||||
--set emqxConfig.EMQX_AUTHORIZATION__NO_MATCH=allow \
|
||||
deploy/charts/${{ matrix.profile }} \
|
||||
--debug
|
||||
- name: waiting emqx started
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
while [ "$(kubectl get StatefulSet -l app.kubernetes.io/instance=${{ matrix.profile }} -o jsonpath='{.items[0].status.replicas}')" \
|
||||
!= "$(kubectl get StatefulSet -l app.kubernetes.io/instance=${{ matrix.profile }} -o jsonpath='{.items[0].status.readyReplicas}')" ]; do
|
||||
echo "==============================";
|
||||
kubectl get pods;
|
||||
echo "==============================";
|
||||
echo "waiting emqx started";
|
||||
sleep 10;
|
||||
done
|
||||
- name: Get Token
|
||||
timeout-minutes: 1
|
||||
run: |
|
||||
kubectl port-forward service/${{ matrix.profile }} 18083:18083 > /dev/null &
|
||||
|
||||
while
|
||||
[ "$(curl --silent -X 'GET' 'http://127.0.0.1:18083/api/v5/status' | tail -n1)" != "emqx is running" ]
|
||||
do
|
||||
echo "waiting emqx"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "TOKEN=$(curl --silent -X 'POST' 'http://127.0.0.1:18083/api/v5/login' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"username": "admin","password": "public"}' | jq -r ".token")" >> $GITHUB_ENV
|
||||
|
||||
- name: Check cluster
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
while
|
||||
[ "$(curl --silent -H "Authorization: Bearer $TOKEN" -X GET http://127.0.0.1:18083/api/v5/cluster| jq '.nodes|length')" != "3" ];
|
||||
do
|
||||
echo "waiting ${{ matrix.profile }} cluster scale"
|
||||
sleep 1
|
||||
done
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: emqx/paho.mqtt.testing
|
||||
ref: develop-5.0
|
||||
path: paho.mqtt.testing
|
||||
- name: install pytest
|
||||
run: |
|
||||
pip install pytest==7.1.2 pytest-retry
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
- name: run paho test
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
port_connected () {
|
||||
local server="$1"
|
||||
local port="$2"
|
||||
echo > /dev/tcp/${server}/${port} 2>/dev/null
|
||||
}
|
||||
|
||||
kubectl port-forward service/${{ matrix.profile }} 1883:1883 > /dev/null &
|
||||
|
||||
while ! port_connected localhost 1883; do
|
||||
echo server not listening yet...
|
||||
sleep 10
|
||||
done
|
||||
|
||||
pytest --retries 3 -v paho.mqtt.testing/interoperability/test_client/V5/test_connect.py -k test_basic --host "127.0.0.1"
|
||||
- if: failure()
|
||||
run: kubectl logs -l "app.kubernetes.io/instance=${{ matrix.profile }}" -c emqx --tail=1000
|
|
@ -1,16 +0,0 @@
|
|||
name: Run gitlint
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
run_gitlint:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Run gitlint
|
||||
shell: bash
|
||||
run: |
|
||||
set -ex
|
||||
docker run --ulimit nofile=1024 -v $(pwd):/repo -w /repo ghcr.io/emqx/gitlint --commits ${{ github.event.pull_request.base.sha }}..$GITHUB_SHA --config .github/workflows/.gitlint
|
|
@ -0,0 +1,156 @@
|
|||
name: Helm tests
|
||||
|
||||
concurrency:
|
||||
group: helm-${{ github.event_name }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
version-emqx:
|
||||
required: true
|
||||
type: string
|
||||
version-emqx-enterprise:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
# on:
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
# - 'ci/**'
|
||||
# tags:
|
||||
# - v*
|
||||
# pull_request:
|
||||
|
||||
jobs:
|
||||
helm_test:
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
EMQX_NAME: ${{ matrix.profile }}
|
||||
PKG_VSN: ${{ matrix.profile == 'emqx-enterprise' && inputs.version-emqx-enterprise || inputs.version-emqx }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
discovery:
|
||||
- k8s
|
||||
- dns
|
||||
profile:
|
||||
- emqx
|
||||
- emqx-enterprise
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: source
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: "${{ env.EMQX_NAME }}-docker"
|
||||
path: /tmp
|
||||
- name: load docker image
|
||||
run: |
|
||||
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 "TARGET=emqx/${EMQX_NAME}" >> $GITHUB_ENV
|
||||
- run: minikube start
|
||||
- run: minikube image load $TARGET:$EMQX_TAG
|
||||
- name: run emqx on chart (k8s)
|
||||
if: matrix.discovery == 'k8s'
|
||||
working-directory: source
|
||||
run: |
|
||||
helm install ${EMQX_NAME} \
|
||||
--set emqxConfig.EMQX_CLUSTER__DISCOVERY_STRATEGY="k8s" \
|
||||
--set emqxConfig.EMQX_CLUSTER__K8S__APISERVER="https://kubernetes.default.svc:443" \
|
||||
--set emqxConfig.EMQX_CLUSTER__K8S__SERVICE_NAME="${EMQX_NAME}-headless" \
|
||||
--set emqxConfig.EMQX_CLUSTER__K8S__NAMESPACE="default" \
|
||||
--set image.repository=$TARGET \
|
||||
--set image.pullPolicy=Never \
|
||||
--set image.tag=$EMQX_TAG \
|
||||
--set emqxAclConfig="" \
|
||||
--set emqxConfig.EMQX_MQTT__RETRY_INTERVAL=2s \
|
||||
--set emqxConfig.EMQX_MQTT__MAX_TOPIC_ALIAS=10 \
|
||||
--set emqxConfig.EMQX_AUTHORIZATION__SOURCES=[] \
|
||||
--set emqxConfig.EMQX_AUTHORIZATION__NO_MATCH=allow \
|
||||
deploy/charts/${EMQX_NAME} \
|
||||
--debug
|
||||
- name: run emqx on chart (dns)
|
||||
if: matrix.discovery == 'dns'
|
||||
working-directory: source
|
||||
run: |
|
||||
helm install ${EMQX_NAME} \
|
||||
--set emqxConfig.EMQX_CLUSTER__DISCOVERY_STRATEGY="dns" \
|
||||
--set emqxConfig.EMQX_CLUSTER__DNS__RECORD_TYPE="srv" \
|
||||
--set emqxConfig.EMQX_CLUSTER__DNS__NAME="${EMQX_NAME}-headless.default.svc.cluster.local" \
|
||||
--set image.repository=$TARGET \
|
||||
--set image.pullPolicy=Never \
|
||||
--set image.tag=$EMQX_TAG \
|
||||
--set emqxAclConfig="" \
|
||||
--set emqxConfig.EMQX_MQTT__RETRY_INTERVAL=2s \
|
||||
--set emqxConfig.EMQX_MQTT__MAX_TOPIC_ALIAS=10 \
|
||||
--set emqxConfig.EMQX_AUTHORIZATION__SOURCES=[] \
|
||||
--set emqxConfig.EMQX_AUTHORIZATION__NO_MATCH=allow \
|
||||
deploy/charts/${EMQX_NAME} \
|
||||
--debug
|
||||
- name: waiting emqx started
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
while [ "$(kubectl get StatefulSet -l app.kubernetes.io/instance=${EMQX_NAME} -o jsonpath='{.items[0].status.replicas}')" \
|
||||
!= "$(kubectl get StatefulSet -l app.kubernetes.io/instance=${EMQX_NAME} -o jsonpath='{.items[0].status.readyReplicas}')" ]; do
|
||||
echo "==============================";
|
||||
kubectl get pods;
|
||||
echo "==============================";
|
||||
echo "waiting emqx started";
|
||||
sleep 10;
|
||||
done
|
||||
- name: Get Token
|
||||
timeout-minutes: 1
|
||||
run: |
|
||||
kubectl port-forward service/${EMQX_NAME} 18083:18083 > /dev/null &
|
||||
|
||||
while
|
||||
[ "$(curl --silent -X 'GET' 'http://127.0.0.1:18083/api/v5/status' | tail -n1)" != "emqx is running" ]
|
||||
do
|
||||
echo "waiting emqx"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "TOKEN=$(curl --silent -X 'POST' 'http://127.0.0.1:18083/api/v5/login' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"username": "admin","password": "public"}' | jq -r ".token")" >> $GITHUB_ENV
|
||||
|
||||
- name: Check cluster
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
while
|
||||
[ "$(curl --silent -H "Authorization: Bearer $TOKEN" -X GET http://127.0.0.1:18083/api/v5/cluster| jq '.nodes|length')" != "3" ];
|
||||
do
|
||||
echo "waiting ${EMQX_NAME} cluster scale"
|
||||
sleep 1
|
||||
done
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: emqx/paho.mqtt.testing
|
||||
ref: develop-5.0
|
||||
path: paho.mqtt.testing
|
||||
- name: install pytest
|
||||
run: |
|
||||
pip install pytest==7.1.2 pytest-retry
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
- name: run paho test
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
port_connected () {
|
||||
local server="$1"
|
||||
local port="$2"
|
||||
echo > /dev/tcp/${server}/${port} 2>/dev/null
|
||||
}
|
||||
|
||||
kubectl port-forward service/${EMQX_NAME} 1883:1883 > /dev/null &
|
||||
|
||||
while ! port_connected localhost 1883; do
|
||||
echo server not listening yet...
|
||||
sleep 10
|
||||
done
|
||||
|
||||
pytest --retries 3 -v paho.mqtt.testing/interoperability/test_client/V5/test_connect.py -k test_basic --host "127.0.0.1"
|
||||
- if: failure()
|
||||
run: kubectl logs -l "app.kubernetes.io/instance=${EMQX_NAME}" -c emqx --tail=1000
|
|
@ -1,22 +1,27 @@
|
|||
name: JMeter integration tests
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v5.*"
|
||||
pull_request:
|
||||
branches:
|
||||
- "master"
|
||||
workflow_call:
|
||||
inputs:
|
||||
runner:
|
||||
required: true
|
||||
type: string
|
||||
version-emqx:
|
||||
required: true
|
||||
type: string
|
||||
# on:
|
||||
# push:
|
||||
# tags:
|
||||
# - "v5.*"
|
||||
# pull_request:
|
||||
# branches:
|
||||
# - "master"
|
||||
|
||||
jobs:
|
||||
build_emqx_for_jmeter_tests:
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
version: ${{ steps.build_docker.outputs.version}}
|
||||
jmeter_artifact:
|
||||
runs-on: ${{ inputs.runner }}
|
||||
steps:
|
||||
- uses: erlef/setup-beam@v1.15.4
|
||||
with:
|
||||
otp-version: 25.3.2
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- name: Cache Jmeter
|
||||
id: cache-jmeter
|
||||
uses: actions/cache@v3
|
||||
|
@ -42,24 +47,9 @@ jobs:
|
|||
with:
|
||||
name: apache-jmeter.tgz
|
||||
path: /tmp/apache-jmeter.tgz
|
||||
- uses: actions/checkout@v3
|
||||
- name: zip emqx docker image
|
||||
id: build_docker
|
||||
if: endsWith(github.repository, 'emqx')
|
||||
run: |
|
||||
## TODO: make profile a matrix dimension
|
||||
PROFILE='emqx'
|
||||
make "${PROFILE}-docker"
|
||||
VSN="$(./pkg-vsn.sh $PROFILE)"
|
||||
echo "version=${VSN}" >> $GITHUB_OUTPUT
|
||||
docker save -o emqx.tar emqx/emqx:${VSN}
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: emqx.tar
|
||||
path: ./emqx.tar
|
||||
|
||||
advanced_feat:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ${{ inputs.runner }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
@ -70,23 +60,14 @@ jobs:
|
|||
- mqtt_topic_rewrite
|
||||
# - mqtt_retainer
|
||||
|
||||
needs: build_emqx_for_jmeter_tests
|
||||
needs: jmeter_artifact
|
||||
steps:
|
||||
- uses: erlef/setup-beam@v1.15.4
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: ./.github/actions/prepare-jmeter
|
||||
with:
|
||||
otp-version: 25.3.2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: emqx.tar
|
||||
path: /tmp
|
||||
- name: load docker image
|
||||
run: |
|
||||
docker load < /tmp/emqx.tar
|
||||
version-emqx: ${{ inputs.version-emqx }}
|
||||
- name: docker compose up
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
_EMQX_DOCKER_IMAGE_TAG: emqx/emqx:${{ needs.build_emqx_for_jmeter_tests.outputs.version }}
|
||||
run: |
|
||||
docker-compose \
|
||||
-f .ci/docker-compose-file/docker-compose-emqx-cluster.yaml \
|
||||
|
@ -104,35 +85,9 @@ jobs:
|
|||
done
|
||||
docker ps -a
|
||||
echo HAPROXY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' haproxy) >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: emqx/emqx-fvt
|
||||
ref: broker-autotest-v5
|
||||
path: scripts
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '8.0.282' # The JDK version to make available on the path.
|
||||
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
|
||||
architecture: x64 # (x64 or x86) - defaults to x64
|
||||
# https://github.com/actions/setup-java/blob/main/docs/switching-to-v2.md
|
||||
distribution: 'zulu'
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: apache-jmeter.tgz
|
||||
path: /tmp
|
||||
- name: install jmeter
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
JMETER_VERSION: 5.4.3
|
||||
run: |
|
||||
cd /tmp && tar -xvf apache-jmeter.tgz
|
||||
echo "jmeter.save.saveservice.output_format=xml" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
||||
echo "jmeter.save.saveservice.response_data.on_error=true" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
||||
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/ext/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar https://raw.githubusercontent.com/xmeter-net/mqtt-jmeter/master/Download/v2.0.2/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar
|
||||
ln -s /tmp/apache-jmeter-$JMETER_VERSION /opt/jmeter
|
||||
- name: run jmeter
|
||||
run: |
|
||||
/opt/jmeter/bin/jmeter.sh \
|
||||
jmeter/bin/jmeter.sh \
|
||||
-Jjmeter.save.saveservice.output_format=xml -n \
|
||||
-t scripts/broker-autotest-suite/${{ matrix.scripts_type }}.jmx \
|
||||
-Demqx_ip=$HAPROXY_IP \
|
||||
|
@ -151,9 +106,7 @@ jobs:
|
|||
path: ./jmeter_logs
|
||||
|
||||
pgsql_authn_authz:
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
_EMQX_DOCKER_IMAGE_TAG: emqx/emqx:${{ needs.build_emqx_for_jmeter_tests.outputs.version }}
|
||||
runs-on: ${{ inputs.runner }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
@ -168,19 +121,12 @@ jobs:
|
|||
- pgsql_authn
|
||||
- pgsql_authz
|
||||
|
||||
needs: build_emqx_for_jmeter_tests
|
||||
needs: jmeter_artifact
|
||||
steps:
|
||||
- uses: erlef/setup-beam@v1.15.4
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: ./.github/actions/prepare-jmeter
|
||||
with:
|
||||
otp-version: 25.3.2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: emqx.tar
|
||||
path: /tmp
|
||||
- name: load docker image
|
||||
run: |
|
||||
docker load < /tmp/emqx.tar
|
||||
version-emqx: ${{ inputs.version-emqx }}
|
||||
- name: docker compose up
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
|
@ -204,36 +150,9 @@ jobs:
|
|||
docker ps -a
|
||||
echo HAPROXY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' haproxy) >> $GITHUB_ENV
|
||||
echo PGSQL_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pgsql-tls) >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: emqx/emqx-fvt
|
||||
ref: broker-autotest-v5
|
||||
path: scripts
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '8.0.282' # The JDK version to make available on the path.
|
||||
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
|
||||
architecture: x64 # (x64 or x86) - defaults to x64
|
||||
# https://github.com/actions/setup-java/blob/main/docs/switching-to-v2.md
|
||||
distribution: 'zulu'
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: apache-jmeter.tgz
|
||||
path: /tmp
|
||||
- name: install jmeter
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
JMETER_VERSION: 5.4.3
|
||||
run: |
|
||||
cd /tmp && tar -xvf apache-jmeter.tgz
|
||||
echo "jmeter.save.saveservice.output_format=xml" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
||||
echo "jmeter.save.saveservice.response_data.on_error=true" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
||||
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/ext/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar https://raw.githubusercontent.com/xmeter-net/mqtt-jmeter/master/Download/v2.0.2/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar
|
||||
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/postgresql-42.2.18.jar https://repo1.maven.org/maven2/org/postgresql/postgresql/42.2.18/postgresql-42.2.18.jar
|
||||
ln -s /tmp/apache-jmeter-$JMETER_VERSION /opt/jmeter
|
||||
- name: run jmeter
|
||||
run: |
|
||||
/opt/jmeter/bin/jmeter.sh \
|
||||
jmeter/bin/jmeter.sh \
|
||||
-Jjmeter.save.saveservice.output_format=xml -n \
|
||||
-t scripts/broker-autotest-suite/${{ matrix.scripts_type }}.jmx \
|
||||
-Demqx_ip=$HAPROXY_IP \
|
||||
|
@ -265,7 +184,7 @@ jobs:
|
|||
path: ./jmeter_logs
|
||||
|
||||
mysql_authn_authz:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ${{ inputs.runner }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
@ -277,23 +196,15 @@ jobs:
|
|||
- mysql_authn
|
||||
- mysql_authz
|
||||
|
||||
needs: build_emqx_for_jmeter_tests
|
||||
needs: jmeter_artifact
|
||||
steps:
|
||||
- uses: erlef/setup-beam@v1.15.4
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: ./.github/actions/prepare-jmeter
|
||||
with:
|
||||
otp-version: 25.3.2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: emqx.tar
|
||||
path: /tmp
|
||||
- name: load docker image
|
||||
run: |
|
||||
docker load < /tmp/emqx.tar
|
||||
version-emqx: ${{ inputs.version-emqx }}
|
||||
- name: docker compose up
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
_EMQX_DOCKER_IMAGE_TAG: emqx/emqx:${{ needs.build_emqx_for_jmeter_tests.outputs.version }}
|
||||
PGSQL_TAG: ${{ matrix.mysql_tag }}
|
||||
run: |
|
||||
docker-compose \
|
||||
|
@ -314,36 +225,9 @@ jobs:
|
|||
docker ps -a
|
||||
echo HAPROXY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' haproxy) >> $GITHUB_ENV
|
||||
echo MYSQL_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mysql-tls) >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: emqx/emqx-fvt
|
||||
ref: broker-autotest-v5
|
||||
path: scripts
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '8.0.282' # The JDK version to make available on the path.
|
||||
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
|
||||
architecture: x64 # (x64 or x86) - defaults to x64
|
||||
# https://github.com/actions/setup-java/blob/main/docs/switching-to-v2.md
|
||||
distribution: 'zulu'
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: apache-jmeter.tgz
|
||||
path: /tmp
|
||||
- name: install jmeter
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
JMETER_VERSION: 5.4.3
|
||||
run: |
|
||||
cd /tmp && tar -xvf apache-jmeter.tgz
|
||||
echo "jmeter.save.saveservice.output_format=xml" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
||||
echo "jmeter.save.saveservice.response_data.on_error=true" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
||||
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/ext/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar https://raw.githubusercontent.com/xmeter-net/mqtt-jmeter/master/Download/v2.0.2/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar
|
||||
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/mysql-connector-java-8.0.16.jar https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.16/mysql-connector-java-8.0.16.jar
|
||||
ln -s /tmp/apache-jmeter-$JMETER_VERSION /opt/jmeter
|
||||
- name: run jmeter
|
||||
run: |
|
||||
/opt/jmeter/bin/jmeter.sh \
|
||||
jmeter/bin/jmeter.sh \
|
||||
-Jjmeter.save.saveservice.output_format=xml -n \
|
||||
-t scripts/broker-autotest-suite/${{ matrix.scripts_type }}.jmx \
|
||||
-Demqx_ip=$HAPROXY_IP \
|
||||
|
@ -371,7 +255,7 @@ jobs:
|
|||
path: ./jmeter_logs
|
||||
|
||||
JWT_authn:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ${{ inputs.runner }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
@ -379,23 +263,14 @@ jobs:
|
|||
scripts_type:
|
||||
- jwt_authn
|
||||
|
||||
needs: build_emqx_for_jmeter_tests
|
||||
needs: jmeter_artifact
|
||||
steps:
|
||||
- uses: erlef/setup-beam@v1.15.4
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: ./.github/actions/prepare-jmeter
|
||||
with:
|
||||
otp-version: 25.3.2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: emqx.tar
|
||||
path: /tmp
|
||||
- name: load docker image
|
||||
run: |
|
||||
docker load < /tmp/emqx.tar
|
||||
version-emqx: ${{ inputs.version-emqx }}
|
||||
- name: docker compose up
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
_EMQX_DOCKER_IMAGE_TAG: emqx/emqx:${{ needs.build_emqx_for_jmeter_tests.outputs.version }}
|
||||
run: |
|
||||
docker-compose \
|
||||
-f .ci/docker-compose-file/docker-compose-emqx-cluster.yaml \
|
||||
|
@ -413,11 +288,6 @@ jobs:
|
|||
done
|
||||
docker ps -a
|
||||
echo HAPROXY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' haproxy) >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: emqx/emqx-fvt
|
||||
ref: broker-autotest-v5
|
||||
path: scripts
|
||||
- name: run jwks_server
|
||||
timeout-minutes: 10
|
||||
run: |
|
||||
|
@ -426,30 +296,9 @@ jobs:
|
|||
cd target
|
||||
docker run --name jwks_server --network emqx_bridge --ip 172.100.239.88 -d -v $(pwd)/jwkserver-0.0.1.jar:/jwks_server/jwkserver-0.0.1.jar --workdir /jwks_server openjdk:8-jdk bash \
|
||||
-c "java -jar jwkserver-0.0.1.jar"
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '8.0.282' # The JDK version to make available on the path.
|
||||
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
|
||||
architecture: x64 # (x64 or x86) - defaults to x64
|
||||
# https://github.com/actions/setup-java/blob/main/docs/switching-to-v2.md
|
||||
distribution: 'zulu'
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: apache-jmeter.tgz
|
||||
path: /tmp
|
||||
- name: install jmeter
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
JMETER_VERSION: 5.4.3
|
||||
run: |
|
||||
cd /tmp && tar -xvf apache-jmeter.tgz
|
||||
echo "jmeter.save.saveservice.output_format=xml" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
||||
echo "jmeter.save.saveservice.response_data.on_error=true" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
||||
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/ext/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar https://raw.githubusercontent.com/xmeter-net/mqtt-jmeter/master/Download/v2.0.2/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar
|
||||
ln -s /tmp/apache-jmeter-$JMETER_VERSION /opt/jmeter
|
||||
- name: run jmeter
|
||||
run: |
|
||||
/opt/jmeter/bin/jmeter.sh \
|
||||
jmeter/bin/jmeter.sh \
|
||||
-Jjmeter.save.saveservice.output_format=xml -n \
|
||||
-t scripts/broker-autotest-suite/${{ matrix.scripts_type }}.jmx \
|
||||
-Demqx_ip=$HAPROXY_IP \
|
||||
|
@ -469,7 +318,7 @@ jobs:
|
|||
path: ./jmeter_logs
|
||||
|
||||
built_in_database_authn_authz:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ${{ inputs.runner }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
@ -478,24 +327,14 @@ jobs:
|
|||
- built_in_database_authn
|
||||
- built_in_database_authz
|
||||
|
||||
needs: build_emqx_for_jmeter_tests
|
||||
needs: jmeter_artifact
|
||||
steps:
|
||||
- uses: erlef/setup-beam@v1.15.4
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: ./.github/actions/prepare-jmeter
|
||||
with:
|
||||
otp-version: 25.3.2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: emqx.tar
|
||||
path: /tmp
|
||||
- name: load docker image
|
||||
run: |
|
||||
docker load < /tmp/emqx.tar
|
||||
version-emqx: ${{ inputs.version-emqx }}
|
||||
- name: docker compose up
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
_EMQX_DOCKER_IMAGE_TAG: emqx/emqx:${{ needs.build_emqx_for_jmeter_tests.outputs.version }}
|
||||
PGSQL_TAG: ${{ matrix.mysql_tag }}
|
||||
run: |
|
||||
docker-compose \
|
||||
-f .ci/docker-compose-file/docker-compose-emqx-cluster.yaml \
|
||||
|
@ -513,44 +352,17 @@ jobs:
|
|||
done
|
||||
docker ps -a
|
||||
echo HAPROXY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' haproxy) >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: emqx/emqx-fvt
|
||||
ref: broker-autotest-v5
|
||||
path: scripts
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '8.0.282' # The JDK version to make available on the path.
|
||||
java-package: jdk # (jre, jdk, or jdk+fx) - defaults to jdk
|
||||
architecture: x64 # (x64 or x86) - defaults to x64
|
||||
# https://github.com/actions/setup-java/blob/main/docs/switching-to-v2.md
|
||||
distribution: 'zulu'
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: apache-jmeter.tgz
|
||||
path: /tmp
|
||||
- name: install jmeter
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
JMETER_VERSION: 5.4.3
|
||||
run: |
|
||||
cd /tmp && tar -xvf apache-jmeter.tgz
|
||||
echo "jmeter.save.saveservice.output_format=xml" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
||||
echo "jmeter.save.saveservice.response_data.on_error=true" >> /tmp/apache-jmeter-$JMETER_VERSION/user.properties
|
||||
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/ext/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar https://raw.githubusercontent.com/xmeter-net/mqtt-jmeter/master/Download/v2.0.2/mqtt-xmeter-fuse-2.0.2-jar-with-dependencies.jar
|
||||
wget --no-verbose -O /tmp/apache-jmeter-$JMETER_VERSION/lib/mysql-connector-java-8.0.16.jar https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.16/mysql-connector-java-8.0.16.jar
|
||||
ln -s /tmp/apache-jmeter-$JMETER_VERSION /opt/jmeter
|
||||
- name: run jmeter
|
||||
run: |
|
||||
/opt/jmeter/bin/jmeter.sh \
|
||||
-Jjmeter.save.saveservice.output_format=xml -n \
|
||||
-t scripts/broker-autotest-suite/${{ matrix.scripts_type }}.jmx \
|
||||
-Demqx_ip=$HAPROXY_IP \
|
||||
-l jmeter_logs/${{ matrix.scripts_type }}_${{ matrix.mysql_tag }}.jtl \
|
||||
-j jmeter_logs/logs/${{ matrix.scripts_type }}_${{ matrix.mysql_tag }}.log
|
||||
-l jmeter_logs/${{ matrix.scripts_type }}.jtl \
|
||||
-j jmeter_logs/logs/${{ matrix.scripts_type }}.log
|
||||
- name: check logs
|
||||
run: |
|
||||
if cat jmeter_logs/${{ matrix.scripts_type }}_${{ matrix.mysql_tag }}.jtl | grep -e '<failure>true</failure>' > /dev/null 2>&1; then
|
||||
if cat jmeter_logs/${{ matrix.scripts_type }}.jtl | grep -e '<failure>true</failure>' > /dev/null 2>&1; then
|
||||
echo "check logs failed"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -559,11 +371,3 @@ jobs:
|
|||
with:
|
||||
name: jmeter_logs
|
||||
path: ./jmeter_logs
|
||||
|
||||
delete-artifact:
|
||||
runs-on: ubuntu-22.04
|
||||
needs: [advanced_feat,pgsql_authn_authz,JWT_authn,mysql_authn_authz,built_in_database_authn_authz]
|
||||
steps:
|
||||
- uses: geekyeggo/delete-artifact@v2
|
||||
with:
|
||||
name: emqx.tar
|
||||
|
|
|
@ -4,6 +4,15 @@ concurrency:
|
|||
group: relup-${{ github.event_name }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runner:
|
||||
required: true
|
||||
type: string
|
||||
builder:
|
||||
required: true
|
||||
type: string
|
||||
# on:
|
||||
# push:
|
||||
# branches:
|
||||
|
@ -14,8 +23,8 @@ concurrency:
|
|||
|
||||
jobs:
|
||||
relup_test_plan:
|
||||
runs-on: ubuntu-22.04
|
||||
container: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
|
||||
runs-on: ${{ inputs.runner }}
|
||||
container: ${{ inputs.builder }}
|
||||
outputs:
|
||||
CUR_EE_VSN: ${{ steps.find-versions.outputs.CUR_EE_VSN }}
|
||||
OLD_VERSIONS: ${{ steps.find-versions.outputs.OLD_VERSIONS }}
|
||||
|
@ -23,16 +32,18 @@ jobs:
|
|||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
name: Checkout
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: emqx
|
||||
fetch-depth: 0
|
||||
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
|
||||
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(" ")')
|
||||
|
@ -40,8 +51,6 @@ jobs:
|
|||
echo "OLD_VERSIONS=$old_vsns" >> $GITHUB_OUTPUT
|
||||
- name: build emqx
|
||||
run: |
|
||||
set -x
|
||||
cd emqx
|
||||
export PROFILE='emqx-enterprise'
|
||||
make emqx-enterprise-tgz
|
||||
- uses: actions/upload-artifact@v3
|
||||
|
@ -49,10 +58,10 @@ jobs:
|
|||
with:
|
||||
name: emqx_built
|
||||
path: |
|
||||
emqx/_upgrade_base
|
||||
emqx/_packages
|
||||
emqx/scripts
|
||||
emqx/.ci
|
||||
_upgrade_base
|
||||
_packages
|
||||
scripts
|
||||
.ci
|
||||
|
||||
relup_test_run:
|
||||
needs:
|
||||
|
@ -70,7 +79,6 @@ jobs:
|
|||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
# setup Erlang to run lux
|
||||
- uses: erlef/setup-beam@v1.15.4
|
||||
with:
|
||||
otp-version: 25.3.2
|
||||
|
@ -94,7 +102,7 @@ jobs:
|
|||
path: .
|
||||
- name: run relup test
|
||||
run: |
|
||||
set -e -x -u
|
||||
set -eux
|
||||
chmod a+x scripts/**/*.sh
|
||||
ls -l scripts
|
||||
ls -l scripts/relup-test
|
||||
|
|
|
@ -1,156 +1,48 @@
|
|||
name: Run test case
|
||||
|
||||
concurrency:
|
||||
group: test-${{ github.event_name }}-${{ github.ref }}
|
||||
group: test-${{ github.event_name }}-${{ github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'ci/**'
|
||||
tags:
|
||||
- v*
|
||||
- e*
|
||||
pull_request:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runner:
|
||||
required: true
|
||||
type: string
|
||||
builder:
|
||||
required: true
|
||||
type: string
|
||||
ct-matrix:
|
||||
required: true
|
||||
type: string
|
||||
ct-host:
|
||||
required: true
|
||||
type: string
|
||||
ct-docker:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
# on:
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
# - 'ci/**'
|
||||
# tags:
|
||||
# - v*
|
||||
# - e*
|
||||
# pull_request:
|
||||
|
||||
env:
|
||||
IS_CI: "yes"
|
||||
|
||||
jobs:
|
||||
build-matrix:
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
prepare: ${{ steps.matrix.outputs.prepare }}
|
||||
host: ${{ steps.matrix.outputs.host }}
|
||||
docker: ${{ steps.matrix.outputs.docker }}
|
||||
runs-on: ${{ steps.runner.outputs.runs-on }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build matrix
|
||||
id: matrix
|
||||
run: |
|
||||
APPS="$(./scripts/find-apps.sh --ci)"
|
||||
MATRIX="$(echo "${APPS}" | jq -c '
|
||||
[
|
||||
(.[] | select(.profile == "emqx") | . + {
|
||||
builder: "5.1-3",
|
||||
otp: "25.3.2-1",
|
||||
elixir: "1.14.5"
|
||||
}),
|
||||
(.[] | select(.profile == "emqx-enterprise") | . + {
|
||||
builder: "5.1-3",
|
||||
otp: ["25.3.2-1"][],
|
||||
elixir: "1.14.5"
|
||||
})
|
||||
]
|
||||
')"
|
||||
echo "${MATRIX}" | jq
|
||||
MATRIX_PREPARE="$(echo "${MATRIX}" | jq -c 'map({profile, builder, otp, elixir}) | unique')"
|
||||
MATRIX_HOST="$(echo "${MATRIX}" | jq -c 'map(select(.runner == "host"))')"
|
||||
MATRIX_DOCKER="$(echo "${MATRIX}" | jq -c 'map(select(.runner == "docker"))')"
|
||||
echo "prepare=${MATRIX_PREPARE}" | tee -a $GITHUB_OUTPUT
|
||||
echo "host=${MATRIX_HOST}" | tee -a $GITHUB_OUTPUT
|
||||
echo "docker=${MATRIX_DOCKER}" | tee -a $GITHUB_OUTPUT
|
||||
- name: Choose runner host
|
||||
id: runner
|
||||
run: |
|
||||
RUNS_ON="ubuntu-22.04"
|
||||
${{ github.repository_owner == 'emqx' }} && RUNS_ON="aws-amd64"
|
||||
echo "runs-on=${RUNS_ON}" | tee -a $GITHUB_OUTPUT
|
||||
|
||||
prepare:
|
||||
runs-on: ${{ needs.build-matrix.outputs.runs-on }}
|
||||
needs: [build-matrix]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJson(needs.build-matrix.outputs.prepare) }}
|
||||
container: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-ubuntu22.04"
|
||||
steps:
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
path: source
|
||||
- name: get_all_deps
|
||||
working-directory: source
|
||||
env:
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
run: |
|
||||
make ensure-rebar3
|
||||
# fetch all deps and compile
|
||||
make ${{ matrix.profile }}-compile
|
||||
make test-compile
|
||||
cd ..
|
||||
zip -ryq source.zip source/* source/.[^.]*
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: source-${{ matrix.profile }}-${{ matrix.otp }}
|
||||
path: source.zip
|
||||
|
||||
check_examples:
|
||||
needs:
|
||||
- build-matrix
|
||||
- prepare
|
||||
runs-on: ${{ needs.build-matrix.outputs.runs-on }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJson(needs.build-matrix.outputs.prepare) }}
|
||||
container: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-ubuntu22.04"
|
||||
steps:
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: source-${{ matrix.profile }}-${{ matrix.otp }}
|
||||
path: .
|
||||
- name: unzip source code
|
||||
run: unzip -o -q source.zip
|
||||
- name: check example config files
|
||||
env:
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
working-directory: source
|
||||
run: ./scripts/test/check-example-configs.sh
|
||||
|
||||
static_checks:
|
||||
needs:
|
||||
- build-matrix
|
||||
- prepare
|
||||
runs-on: ${{ needs.build-matrix.outputs.runs-on }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJson(needs.build-matrix.outputs.prepare) }}
|
||||
container: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-ubuntu22.04"
|
||||
steps:
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: source-${{ matrix.profile }}-${{ matrix.otp }}
|
||||
path: .
|
||||
- name: unzip source code
|
||||
run: unzip -o -q source.zip
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: "source/emqx_dialyzer_${{ matrix.otp }}_plt"
|
||||
key: rebar3-dialyzer-plt-${{ matrix.profile }}-${{ matrix.otp }}-${{ hashFiles('source/rebar.*', 'source/apps/*/rebar.*', 'source/lib-ee/*/rebar.*') }}
|
||||
restore-keys: |
|
||||
rebar3-dialyzer-plt-${{ matrix.profile }}-${{ matrix.otp }}-
|
||||
- name: run static checks
|
||||
env:
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
working-directory: source
|
||||
run: make static_checks
|
||||
|
||||
eunit_and_proper:
|
||||
needs:
|
||||
- build-matrix
|
||||
- prepare
|
||||
runs-on: ${{ needs.build-matrix.outputs.runs-on }}
|
||||
runs-on: ${{ inputs.runner }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJson(needs.build-matrix.outputs.prepare) }}
|
||||
include: ${{ fromJson(inputs.ct-matrix) }}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
|
@ -161,16 +53,16 @@ jobs:
|
|||
- uses: AutoModality/action-clean@v1
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: source-${{ matrix.profile }}-${{ matrix.otp }}
|
||||
path: .
|
||||
- name: unzip source code
|
||||
run: unzip -o -q source.zip
|
||||
name: ${{ matrix.profile }}
|
||||
- name: extract artifact
|
||||
run: |
|
||||
unzip -o -q ${{ matrix.profile }}.zip
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
# produces eunit.coverdata
|
||||
- name: eunit
|
||||
env:
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
CT_COVER_EXPORT_PREFIX: ${{ matrix.profile }}-${{ matrix.otp }}
|
||||
working-directory: source
|
||||
run: make eunit
|
||||
|
||||
# produces proper.coverdata
|
||||
|
@ -178,23 +70,19 @@ jobs:
|
|||
env:
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
CT_COVER_EXPORT_PREFIX: ${{ matrix.profile }}-${{ matrix.otp }}
|
||||
working-directory: source
|
||||
run: make proper
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverdata
|
||||
path: source/_build/test/cover
|
||||
path: _build/test/cover
|
||||
|
||||
ct_docker:
|
||||
needs:
|
||||
- build-matrix
|
||||
- prepare
|
||||
runs-on: ${{ needs.build-matrix.outputs.runs-on }}
|
||||
runs-on: ${{ inputs.runner }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJson(needs.build-matrix.outputs.docker) }}
|
||||
include: ${{ fromJson(inputs.ct-docker) }}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
|
@ -204,14 +92,14 @@ jobs:
|
|||
- uses: AutoModality/action-clean@v1
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: source-${{ matrix.profile }}-${{ matrix.otp }}
|
||||
path: .
|
||||
- name: unzip source code
|
||||
run: unzip -q source.zip
|
||||
name: ${{ matrix.profile }}
|
||||
- name: extract artifact
|
||||
run: |
|
||||
unzip -o -q ${{ matrix.profile }}.zip
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
|
||||
# produces $PROFILE-<app-name>-<otp-vsn>-sg<suitegroup>.coverdata
|
||||
- name: run common tests
|
||||
working-directory: source
|
||||
env:
|
||||
DOCKER_CT_RUNNER_IMAGE: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-ubuntu22.04"
|
||||
MONGO_TAG: "5"
|
||||
|
@ -229,22 +117,19 @@ jobs:
|
|||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverdata
|
||||
path: source/_build/test/cover
|
||||
path: _build/test/cover
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: logs-${{ matrix.profile }}-${{ matrix.prefix }}-${{ matrix.otp }}-sg${{ matrix.suitegroup }}
|
||||
path: source/_build/test/logs
|
||||
path: _build/test/logs
|
||||
|
||||
ct:
|
||||
needs:
|
||||
- build-matrix
|
||||
- prepare
|
||||
runs-on: ${{ needs.build-matrix.outputs.runs-on }}
|
||||
runs-on: ${{ inputs.runner }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJson(needs.build-matrix.outputs.host) }}
|
||||
include: ${{ fromJson(inputs.ct-host) }}
|
||||
|
||||
container: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-ubuntu22.04"
|
||||
defaults:
|
||||
|
@ -255,14 +140,14 @@ jobs:
|
|||
- uses: AutoModality/action-clean@v1
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: source-${{ matrix.profile }}-${{ matrix.otp }}
|
||||
path: .
|
||||
- name: unzip source code
|
||||
run: unzip -q source.zip
|
||||
name: ${{ matrix.profile }}
|
||||
- name: extract artifact
|
||||
run: |
|
||||
unzip -o -q ${{ matrix.profile }}.zip
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
|
||||
# produces $PROFILE-<app-name>-<otp-vsn>-sg<suitegroup>.coverdata
|
||||
- name: run common tests
|
||||
working-directory: source
|
||||
env:
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
SUITEGROUP: ${{ matrix.suitegroup }}
|
||||
|
@ -272,58 +157,61 @@ jobs:
|
|||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverdata
|
||||
path: source/_build/test/cover
|
||||
path: _build/test/cover
|
||||
if-no-files-found: warn # do not fail if no coverdata found
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: logs-${{ matrix.profile }}-${{ matrix.prefix }}-${{ matrix.otp }}-sg${{ matrix.suitegroup }}
|
||||
path: source/_build/test/logs
|
||||
path: _build/test/logs
|
||||
|
||||
make_cover:
|
||||
needs:
|
||||
- eunit_and_proper
|
||||
- ct
|
||||
- ct_docker
|
||||
runs-on: ubuntu-22.04
|
||||
container: "ghcr.io/emqx/emqx-builder/5.1-3:1.14.5-25.3.2-1-ubuntu22.04"
|
||||
runs-on: ${{ inputs.runner }}
|
||||
container: ${{ inputs.builder }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
profile:
|
||||
- emqx-enterprise
|
||||
steps:
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: source-emqx-enterprise-25.3.2-1
|
||||
path: .
|
||||
- name: unzip source code
|
||||
run: unzip -q source.zip
|
||||
name: ${{ matrix.profile }}
|
||||
- name: extract artifact
|
||||
run: |
|
||||
unzip -o -q ${{ matrix.profile }}.zip
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
name: download coverdata
|
||||
with:
|
||||
name: coverdata
|
||||
path: source/_build/test/cover
|
||||
path: _build/test/cover
|
||||
|
||||
- name: make cover
|
||||
working-directory: source
|
||||
env:
|
||||
PROFILE: emqx-enterprise
|
||||
run: make cover
|
||||
|
||||
- name: send to coveralls
|
||||
working-directory: source
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PROFILE: emqx-enterprise
|
||||
run: make coveralls
|
||||
|
||||
- name: get coveralls logs
|
||||
working-directory: source
|
||||
if: failure()
|
||||
run: cat rebar3.crashdump
|
||||
|
||||
# do this in a separate job
|
||||
upload_coverdata:
|
||||
needs: make_cover
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ${{ inputs.runner }}
|
||||
steps:
|
||||
- name: Coveralls Finished
|
||||
env:
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
name: Shellcheck
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
shellcheck:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v3
|
||||
- name: Install shellcheck
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt install shellcheck
|
||||
- name: Run shellcheck
|
||||
run: |
|
||||
./scripts/shellcheck.sh
|
||||
echo "success"
|
|
@ -0,0 +1,46 @@
|
|||
name: Build slim packages
|
||||
|
||||
concurrency:
|
||||
group: spellcheck-${{ github.event_name }}-${{ github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runner:
|
||||
required: true
|
||||
type: string
|
||||
# on:
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
# - release-51
|
||||
# pull_request:
|
||||
# # GitHub pull_request action is by default triggered when
|
||||
# # opened reopened or synchronize,
|
||||
# # we add labeled and unlabeled to the list because
|
||||
# # the mac job dpends on the PR having a 'Mac' label
|
||||
# types:
|
||||
# - labeled
|
||||
# - unlabeled
|
||||
# - opened
|
||||
# - reopened
|
||||
# - synchronize
|
||||
# workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
spellcheck:
|
||||
strategy:
|
||||
matrix:
|
||||
profile:
|
||||
- emqx
|
||||
- emqx-enterprise
|
||||
runs-on: ${{ inputs.runner }}
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: "${{ matrix.profile }}_schema_dump"
|
||||
path: /tmp/
|
||||
- name: Run spellcheck
|
||||
run: |
|
||||
bash /tmp/scripts/spellcheck/spellcheck.sh /tmp/_build/docgen/${{ matrix.profile }}/schema-en.json
|
|
@ -0,0 +1,59 @@
|
|||
name: Static checks
|
||||
|
||||
concurrency:
|
||||
group: static-checks-${{ github.event_name }}-${{ github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runner:
|
||||
required: true
|
||||
type: string
|
||||
builder:
|
||||
required: true
|
||||
type: string
|
||||
ct-matrix:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
# on:
|
||||
# push:
|
||||
# branches:
|
||||
# - master
|
||||
# - 'ci/**'
|
||||
# tags:
|
||||
# - v*
|
||||
# - e*
|
||||
# pull_request:
|
||||
|
||||
env:
|
||||
IS_CI: "yes"
|
||||
|
||||
jobs:
|
||||
static_checks:
|
||||
runs-on: ${{ inputs.runner }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJson(inputs.ct-matrix) }}
|
||||
container: "ghcr.io/emqx/emqx-builder/${{ matrix.builder }}:${{ matrix.elixir }}-${{ matrix.otp }}-ubuntu22.04"
|
||||
steps:
|
||||
- uses: AutoModality/action-clean@v1
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.profile }}
|
||||
- name: extract artifact
|
||||
run: |
|
||||
unzip -o -q ${{ matrix.profile }}.zip
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
- uses: actions/cache@v3
|
||||
with:
|
||||
path: "emqx_dialyzer_${{ matrix.otp }}_plt"
|
||||
key: rebar3-dialyzer-plt-${{ matrix.profile }}-${{ matrix.otp }}-${{ hashFiles('rebar.*', 'apps/*/rebar.*', 'lib-ee/*/rebar.*') }}
|
||||
restore-keys: |
|
||||
rebar3-dialyzer-plt-${{ matrix.profile }}-${{ matrix.otp }}-
|
||||
- name: run static checks
|
||||
env:
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
run: make static_checks
|
14
build
14
build
|
@ -361,10 +361,10 @@ make_tgz() {
|
|||
log "Archive sha256sum: $(cat "${target}.sha256")"
|
||||
}
|
||||
|
||||
trap docker_cleanup EXIT
|
||||
|
||||
docker_cleanup() {
|
||||
rm -f ./.dockerignore >/dev/null
|
||||
# shellcheck disable=SC2015
|
||||
[ -f ./.dockerignore.bak ] && mv ./.dockerignore.bak ./.dockerignore >/dev/null || true
|
||||
}
|
||||
|
||||
## Build the default docker image based on debian 11.
|
||||
|
@ -384,7 +384,14 @@ make_docker() {
|
|||
if [[ "$PROFILE" = *enterprise* ]]; then
|
||||
extra_deps='libsasl2-2,libsasl2-modules-gssapi-mit'
|
||||
fi
|
||||
echo '_build' >> ./.dockerignore
|
||||
# shellcheck disable=SC2015
|
||||
[ -f ./.dockerignore ] && mv ./.dockerignore ./.dockerignore.bak || true
|
||||
trap docker_cleanup EXIT
|
||||
{
|
||||
echo '/_build'
|
||||
echo '/deps'
|
||||
echo '/*.lock'
|
||||
} >> ./.dockerignore
|
||||
set -x
|
||||
docker build --no-cache --pull \
|
||||
--build-arg BUILD_FROM="${EMQX_BUILDER}" \
|
||||
|
@ -394,6 +401,7 @@ make_docker() {
|
|||
--tag "${EMQX_IMAGE_TAG}" \
|
||||
-f "${EMQX_DOCKERFILE}" .
|
||||
[[ "${DEBUG:-}" -eq 1 ]] || set +x
|
||||
echo "${EMQX_IMAGE_TAG}" > ./.docker_image_tag
|
||||
}
|
||||
|
||||
function join {
|
||||
|
|
Loading…
Reference in New Issue