Merge pull request #5407 from zmstone/build-ci-on-otp-24
Build ci on otp 24
This commit is contained in:
commit
1239eb23b0
|
@ -1,11 +1,10 @@
|
|||
#!/bin/bash
|
||||
set -x -e -u
|
||||
export DEBUG=1
|
||||
export CODE_PATH=${CODE_PATH:-"/emqx"}
|
||||
export EMQX_NAME=${EMQX_NAME:-"emqx"}
|
||||
export PACKAGE_PATH="${CODE_PATH}/_packages/${EMQX_NAME}"
|
||||
export RELUP_PACKAGE_PATH="${CODE_PATH}/_upgrade_base"
|
||||
# export EMQX_NODE_NAME="emqx-on-$(uname -m)@127.0.0.1"
|
||||
# export EMQX_NODE_COOKIE=$(date +%s%N)
|
||||
|
||||
case "$(uname -m)" in
|
||||
x86_64)
|
||||
|
@ -122,6 +121,9 @@ run_test(){
|
|||
tee -a "$emqx_env_vars" <<EOF
|
||||
export EMQX_ZONE__EXTERNAL__SERVER_KEEPALIVE=60
|
||||
export EMQX_MQTT__MAX_TOPIC_ALIAS=10
|
||||
export EMQX_LOG__CONSOLE_HANDLER__LEVEL=debug
|
||||
export EMQX_LOG__FILE_HANDLERS__EMQX_LOG__LEVEL=debug
|
||||
export EMQX_LOG__PRIMARY_LEVEL=debug
|
||||
EOF
|
||||
## for ARM, due to CI env issue, skip start of quic listener for the moment
|
||||
[[ $(arch) == *arm* || $(arch) == aarch64 ]] && tee -a "$emqx_env_vars" <<EOF
|
||||
|
@ -151,6 +153,8 @@ EOF
|
|||
# shellcheck disable=SC2009 # pgrep does not support Extended Regular Expressions
|
||||
ps -ef | grep -E '\-progname\s.+emqx\s'
|
||||
if ! emqx 'stop'; then
|
||||
# shellcheck disable=SC2009 # pgrep does not support Extended Regular Expressions
|
||||
ps -ef | grep -E '\-progname\s.+emqx\s'
|
||||
echo "ERROR: failed_to_stop_emqx_with_the_stop_command"
|
||||
cat /var/log/emqx/erlang.log.1 || true
|
||||
cat /var/log/emqx/emqx.log.1 || true
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
version: '3.9'
|
||||
|
||||
services:
|
||||
erlang:
|
||||
container_name: erlang
|
||||
erlang23:
|
||||
container_name: erlang23
|
||||
image: emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04
|
||||
env_file:
|
||||
- conf.env
|
||||
|
@ -21,6 +21,26 @@ services:
|
|||
working_dir: /emqx
|
||||
tty: true
|
||||
|
||||
erlang24:
|
||||
container_name: erlang24
|
||||
image: emqx/build-env:erl24.0.1-emqx-1-ubuntu20.04
|
||||
env_file:
|
||||
- conf.env
|
||||
environment:
|
||||
GITHUB_ACTIONS: ${GITHUB_ACTIONS}
|
||||
GITHUB_TOKEN: ${GITHUB_TOKEN}
|
||||
GITHUB_RUN_ID: ${GITHUB_RUN_ID}
|
||||
GITHUB_SHA: ${GITHUB_SHA}
|
||||
GITHUB_RUN_NUMBER: ${GITHUB_RUN_NUMBER}
|
||||
GITHUB_EVENT_NAME: ${GITHUB_EVENT_NAME}
|
||||
GITHUB_REF: ${GITHUB_REF}
|
||||
networks:
|
||||
- emqx_bridge
|
||||
volumes:
|
||||
- ../..:/emqx
|
||||
working_dir: /emqx
|
||||
tty: true
|
||||
|
||||
networks:
|
||||
emqx_bridge:
|
||||
driver: bridge
|
||||
|
|
|
@ -10,8 +10,14 @@ on:
|
|||
|
||||
jobs:
|
||||
prepare:
|
||||
strategy:
|
||||
matrix:
|
||||
container:
|
||||
- "emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04"
|
||||
- "emqx/build-env:erl24.0.1-emqx-1-ubuntu20.04"
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
container: emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04
|
||||
container: ${{ matrix.container }}
|
||||
|
||||
outputs:
|
||||
profiles: ${{ steps.set_profile.outputs.profiles}}
|
||||
|
@ -213,6 +219,9 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
|
||||
erl_otp:
|
||||
- 23.2.7.2-emqx-2
|
||||
- 24.0.1-emqx-1
|
||||
arch:
|
||||
- amd64
|
||||
- arm64
|
||||
|
|
|
@ -16,6 +16,8 @@ jobs:
|
|||
matrix:
|
||||
erl_otp:
|
||||
- erl23.2.7.2-emqx-2
|
||||
- erl24.0.1-emqx-1
|
||||
|
||||
os:
|
||||
- ubuntu20.04
|
||||
- centos7
|
||||
|
@ -43,7 +45,7 @@ jobs:
|
|||
with:
|
||||
name: rebar3.crashdump
|
||||
path: ./rebar3.crashdump
|
||||
- name: pakcages test
|
||||
- name: packages test
|
||||
run: |
|
||||
export CODE_PATH=$GITHUB_WORKSPACE
|
||||
.ci/build_packages/tests.sh
|
||||
|
|
|
@ -4,8 +4,14 @@ on: [pull_request]
|
|||
|
||||
jobs:
|
||||
check_deps_integrity:
|
||||
strategy:
|
||||
matrix:
|
||||
container:
|
||||
- "emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04"
|
||||
- "emqx/build-env:erl24.0.1-emqx-1-ubuntu20.04"
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
container: emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04
|
||||
container: ${{ matrix.container }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
|
|
@ -9,8 +9,14 @@ on:
|
|||
|
||||
jobs:
|
||||
check_all:
|
||||
strategy:
|
||||
matrix:
|
||||
container:
|
||||
- "emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04"
|
||||
- "emqx/build-env:erl24.0.1-emqx-1-ubuntu20.04"
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
container: emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04
|
||||
container: ${{ matrix.container }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
|
|
@ -183,8 +183,15 @@ jobs:
|
|||
exit $RESULT
|
||||
|
||||
relup_test:
|
||||
strategy:
|
||||
matrix:
|
||||
container:
|
||||
- "emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04"
|
||||
- "emqx/build-env:erl24.0.1-emqx-1-ubuntu20.04"
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
container: emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04
|
||||
container: ${{ matrix.container }}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
@ -295,4 +302,3 @@ jobs:
|
|||
with:
|
||||
name: lux_logs
|
||||
path: lux_logs
|
||||
|
||||
|
|
|
@ -9,8 +9,14 @@ on:
|
|||
|
||||
jobs:
|
||||
run_static_analysis:
|
||||
strategy:
|
||||
matrix:
|
||||
container:
|
||||
- "emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04"
|
||||
- "emqx/build-env:erl24.0.1-emqx-1-ubuntu20.04"
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
container: emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04
|
||||
container: ${{ matrix.container }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -26,8 +32,14 @@ jobs:
|
|||
run: make dialyzer
|
||||
|
||||
run_proper_test:
|
||||
strategy:
|
||||
matrix:
|
||||
container:
|
||||
- "emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04"
|
||||
- "emqx/build-env:erl24.0.1-emqx-1-ubuntu20.04"
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
container: emqx/build-env:erl23.2.7.2-emqx-2-ubuntu20.04
|
||||
container: ${{ matrix.container }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -41,6 +53,12 @@ jobs:
|
|||
run: make proper
|
||||
|
||||
run_common_test:
|
||||
strategy:
|
||||
matrix:
|
||||
otp_release:
|
||||
- "erlang23"
|
||||
- "erlang24"
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
|
@ -73,15 +91,15 @@ jobs:
|
|||
up -d --build
|
||||
- name: run eunit
|
||||
run: |
|
||||
docker exec -i erlang bash -c "make eunit"
|
||||
docker exec -i ${{ matrix.otp_release }} bash -c "make eunit"
|
||||
- name: run common test
|
||||
run: |
|
||||
docker exec -i erlang bash -c "make ct"
|
||||
docker exec -i ${{ matrix.otp_release }} bash -c "make ct"
|
||||
- name: run cover
|
||||
run: |
|
||||
printenv > .env
|
||||
docker exec -i erlang bash -c "make cover"
|
||||
docker exec --env-file .env -i erlang bash -c "make coveralls"
|
||||
docker exec -i ${{ matrix.otp_release }} bash -c "make cover"
|
||||
docker exec --env-file .env -i ${{ matrix.otp_release }} bash -c "make coveralls"
|
||||
- name: cat rebar.crashdump
|
||||
if: failure()
|
||||
run: if [ -f 'rebar3.crashdump' ];then cat 'rebar3.crashdump'; fi
|
||||
|
|
|
@ -1 +1 @@
|
|||
erlang 24.0.1-emqx-1
|
||||
erlang 24.0.5-emqx-1
|
||||
|
|
|
@ -19,6 +19,6 @@
|
|||
[{test,
|
||||
[{deps,
|
||||
[
|
||||
{emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.2.3"}}}]}
|
||||
{emqtt, {git, "https://github.com/emqx/emqtt", {tag, "1.4.0"}}}]}
|
||||
]}
|
||||
]}.
|
||||
|
|
16
bin/emqx
16
bin/emqx
|
@ -302,9 +302,19 @@ bootstrapd() {
|
|||
# check if a PID is down
|
||||
is_down() {
|
||||
PID="$1"
|
||||
if kill -s 0 "$PID" 2>/dev/null; then
|
||||
if ps -p "$PID" >/dev/null; then
|
||||
# still around
|
||||
# shellcheck disable=SC2009 # this grep pattern is not a part of the progra names
|
||||
if ps -p "$PID" | grep -q 'defunct'; then
|
||||
# zombie state, print parent pid
|
||||
parent="$(ps -o ppid= -p "$PID" | tr -d ' ')"
|
||||
echo "WARN: $PID is marked <defunct>, parent:"
|
||||
ps -p "$parent"
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
fi
|
||||
# it's gone
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -484,12 +494,12 @@ case "$1" in
|
|||
exit 1
|
||||
fi
|
||||
WAIT_TIME="${WAIT_FOR_ERLANG_STOP:-60}"
|
||||
if ! wait_for "$WAIT_TIME" is_down "$PID"; then
|
||||
if ! wait_for "$WAIT_TIME" 'is_down' "$PID"; then
|
||||
msg="dangling after ${WAIT_TIME} seconds"
|
||||
# also log to syslog
|
||||
logger -t "${REL_NAME}[${PID}]" "STOP: $msg"
|
||||
# log to user console
|
||||
echoerr "STOP: $msg"
|
||||
echoerr "stop failed, $msg"
|
||||
exit 1
|
||||
fi
|
||||
logger -t "${REL_NAME}[${PID}]" "STOP: OK"
|
||||
|
|
Loading…
Reference in New Issue