| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- name: Run test case
- concurrency:
- group: test-${{ github.event_name }}-${{ github.ref }}
- cancel-in-progress: true
- on:
- push:
- tags:
- - v*
- - e*
- pull_request:
- jobs:
- run_static_analysis:
- strategy:
- matrix:
- emqx_builder:
- - 5.0-2:24.1.5-2 # run dialyzer on latest OTP
- runs-on: ubuntu-20.04
- container: "ghcr.io/emqx/emqx-builder/${{ matrix.emqx_builder }}-ubuntu20.04"
- steps:
- - uses: actions/checkout@v2
- - name: xref
- run: make xref
- - name: dialyzer
- run: make dialyzer
- run_proper_test:
- strategy:
- matrix:
- emqx_builder:
- - 5.0-2:24.1.5-2
- runs-on: ubuntu-20.04
- container: "ghcr.io/emqx/emqx-builder/${{ matrix.emqx_builder }}-ubuntu20.04"
- steps:
- - uses: actions/checkout@v2
- - 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: docker compose up
- env:
- MYSQL_TAG: 8
- PGSQL_TAG: 13
- REDIS_TAG: 6
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- docker-compose \
- -f .ci/docker-compose-file/docker-compose-mysql-tcp.yaml \
- -f .ci/docker-compose-file/docker-compose-pgsql-tcp.yaml \
- -f .ci/docker-compose-file/docker-compose-redis-single-tcp.yaml \
- -f .ci/docker-compose-file/docker-compose.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
|