127 lines
4.0 KiB
YAML
127 lines
4.0 KiB
YAML
name: Run test case
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
- e*
|
|
pull_request:
|
|
|
|
jobs:
|
|
run_static_analysis:
|
|
strategy:
|
|
matrix:
|
|
otp:
|
|
- "23.2.7.2-emqx-2"
|
|
- "24.0.5-emqx-1"
|
|
|
|
runs-on: ubuntu-20.04
|
|
container: "ghcr.io/emqx/emqx-builder-helper/5.0:${{ matrix.otp }}-ubuntu20.04"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: set git credentials
|
|
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
|
|
fi
|
|
- name: xref
|
|
run: make xref
|
|
- name: dialyzer
|
|
run: make dialyzer
|
|
|
|
run_proper_test:
|
|
strategy:
|
|
matrix:
|
|
otp:
|
|
- "23.2.7.2-emqx-2"
|
|
- "24.0.5-emqx-1"
|
|
|
|
runs-on: ubuntu-20.04
|
|
container: "ghcr.io/emqx/emqx-builder-helper/5.0:${{ matrix.otp }}-ubuntu20.04"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: set git credentials
|
|
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
|
|
fi
|
|
- name: proper
|
|
run: make proper
|
|
|
|
run_common_test:
|
|
strategy:
|
|
matrix:
|
|
otp_release:
|
|
- "erlang23"
|
|
- "erlang24"
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: set edition
|
|
id: set_edition
|
|
run: |
|
|
if make emqx-ee --dry-run > /dev/null 2>&1; then
|
|
echo "EDITION=enterprise" >> $GITHUB_ENV
|
|
else
|
|
echo "EDITION=opensource" >> $GITHUB_ENV
|
|
fi
|
|
- name: docker compose up
|
|
if: env.EDITION == 'opensource'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
docker-compose \
|
|
-f .ci/docker-compose-file/docker-compose.yaml \
|
|
up -d --build
|
|
- name: docker compose up
|
|
if: env.EDITION == 'enterprise'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
timeout-minutes: 20
|
|
run: |
|
|
docker-compose \
|
|
-f .ci/docker-compose-file/docker-compose.yaml \
|
|
-f .ci/docker-compose-file/docker-compose-enterprise.yaml \
|
|
up -d --build
|
|
- name: run eunit
|
|
run: |
|
|
docker exec -i ${{ matrix.otp_release }} bash -c "make eunit"
|
|
- name: run common test
|
|
run: |
|
|
docker exec -i ${{ matrix.otp_release }} bash -c "make ct"
|
|
- name: run cover
|
|
run: |
|
|
printenv > .env
|
|
docker exec -i ${{ matrix.otp_release }} bash -c "DIAGNOSTIC=1 make cover"
|
|
docker exec --env-file .env -i ${{ matrix.otp_release }} bash -c "DIAGNOSTIC=1 make coveralls"
|
|
- name: cat rebar.crashdump
|
|
if: failure()
|
|
run: if [ -f 'rebar3.crashdump' ];then cat 'rebar3.crashdump'; fi
|
|
- uses: actions/upload-artifact@v1
|
|
if: failure()
|
|
with:
|
|
name: logs_${{ matrix.otp_release }}
|
|
path: _build/test/logs
|
|
- uses: actions/upload-artifact@v1
|
|
with:
|
|
name: cover_${{ matrix.otp_release }}
|
|
path: _build/test/cover
|
|
|
|
finish:
|
|
needs: run_common_test
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Coveralls Finished
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
curl -v -k https://coveralls.io/webhook \
|
|
--header "Content-Type: application/json" \
|
|
--data "{\"repo_name\":\"$GITHUB_REPOSITORY\",\"repo_token\":\"$GITHUB_TOKEN\",\"payload\":{\"build_num\":$GITHUB_RUN_ID,\"status\":\"done\"}}" || true
|