chore(CI): update build workflows

This commit is contained in:
zhanghongtong 2021-05-08 11:54:40 +08:00 committed by Rory Z
parent 1ddcffa32d
commit 934d3c405d
4 changed files with 78 additions and 8 deletions

View File

@ -7,6 +7,8 @@ COPY . /emqx
WORKDIR /emqx
RUN make ${EMQX_NAME}-zip || cat rebar3.crashdump
RUN make ${EMQX_NAME}-pkg || cat rebar3.crashdump
RUN /emqx/.ci/build_packages/tests.sh

View File

@ -123,6 +123,8 @@ jobs:
strategy:
matrix:
profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
erl_otp:
- 23.2.7.2
exclude:
- profile: emqx-edge
@ -141,12 +143,12 @@ jobs:
- name: build erlang
timeout-minutes: 60
run: |
kerl build 23.2.7
kerl install 23.2.7 $HOME/.kerl/23.2.7
kerl build ${{ matrix.erl_otp }}
kerl install ${{ matrix.erl_otp }} $HOME/.kerl/${{ matrix.erl_otp }}
- name: build
run: |
. $HOME/.kerl/23.2.7/activate
make -C source ${{ matrix.profile }}-pkg
. $HOME/.kerl/${{ matrix.erl_otp }}/activate
make -C source ${{ matrix.profile }}-zip
- name: test
run: |
cd source

View File

@ -1,8 +1,12 @@
name: Build slim packages
on:
- pull_request
- workflow_dispatch
push:
tags:
- v*
- e*
pull_request:
workflow_dispatch:
jobs:
build:
@ -30,7 +34,9 @@ jobs:
else
echo "EMQX_NAME=emqx" >> $GITHUB_ENV
fi
- name: build packages
- name: build zip packages
run: make ${EMQX_NAME}-zip
- name: build deb/rpm packages
run: make ${EMQX_NAME}-pkg
- name: pakcages test
run: |
@ -40,3 +46,64 @@ jobs:
with:
name: ${{ matrix.os }}
path: _packages/**/*.zip
mac:
runs-on: macos-10.15
strategy:
matrix:
erl_otp:
- 23.2.7.2
steps:
- uses: actions/checkout@v1
- name: prepare
run: |
if make emqx-ee --dry-run > /dev/null 2>&1; then
echo "https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com" > $HOME/.git-credentials
git config --global credential.helper store
echo "${{ secrets.CI_GIT_TOKEN }}" >> ./scripts/git-token
echo "EMQX_NAME=emqx-ee" >> $GITHUB_ENV
else
echo "EMQX_NAME=emqx" >> $GITHUB_ENV
fi
- name: prepare
run: |
brew install curl zip unzip gnu-sed kerl unixodbc freetds
echo "/usr/local/bin" >> $GITHUB_PATH
git config --global credential.helper store
- name: build erlang
timeout-minutes: 60
run: |
kerl build ${{ matrix.erl_otp }}
kerl install ${{ matrix.erl_otp }} $HOME/.kerl/${{ matrix.erl_otp }}
- name: build
run: |
. $HOME/.kerl/${{ matrix.erl_otp }}/activate
make ${EMQX_NAME}-zip
- name: test
run: |
pkg_name=$(basename _packages/emqx/emqx-*.zip)
unzip _packages/emqx/$pkg_name
gsed -i '/emqx_telemetry/d' ./emqx/data/loaded_plugins
./emqx/bin/emqx start || cat emqx/log/erlang.log.1
ready='no'
for i in {1..10}; do
if curl -fs 127.0.0.1:18083 > /dev/null; then
ready='yes'
break
fi
sleep 1
done
if [ "$ready" != "yes" ]; then
echo "Timed out waiting for emqx to be ready"
cat emqx/log/erlang.log.1
exit 1
fi
./emqx/bin/emqx_ctl status
./emqx/bin/emqx stop
rm -rf emqx
- uses: actions/upload-artifact@v1
with:
name: macos
path: _packages/emqx/.

1
build
View File

@ -134,7 +134,6 @@ case "$ARTIFACT" in
;;
pkg)
if [ -z "${PKGERDIR:-}" ]; then
make_zip
log "Skipped making deb/rpm package for $SYSTEM"
exit 0
fi