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: 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: 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: 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: docker compose up env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | docker-compose \ -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