| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- name: Check emqx app standalone
- ## apps/emqx can be used as a rebar/mix dependency
- ## in other project, so we need to make sure apps/emqx
- ## as an Erlang/Elixir app works standalone
- on:
- pull_request:
- jobs:
- run_emqx_app_tests:
- strategy:
- matrix:
- otp:
- - 24.2.1-1
- # no need to use more than 1 version of Elixir, since tests
- # run using only Erlang code. This is needed just to specify
- # the base image.
- elixir:
- - 1.13.4
- os:
- - ubuntu20.04
- arch:
- - amd64
- runs-on: aws-amd64
- container: "ghcr.io/emqx/emqx-builder/5.0-16:${{ matrix.elixir}}-${{ matrix.otp }}-${{ matrix.os }}"
- defaults:
- run:
- shell: bash
- steps:
- - uses: actions/checkout@v2
- with:
- fetch-depth: 0
- - name: Get deps git refs for cache
- id: deps-refs
- run: |
- PATH=$PATH:./ scripts/get-dep-refs.sh
- make clean-all
- - name: load quicer cache
- uses: actions/cache@v2
- with:
- path: _build/default/lib/quicer/
- key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ steps.deps-refs.outputs.DEP_QUICER_REF }}
- - name: run
- run: |
- git config --global --add safe.directory "$GITHUB_WORKSPACE"
- echo "git diff base: $GITHUB_BASE_REF"
- if [[ "$GITHUB_BASE_REF" =~ [0-9a-f]{8,40} ]]; then
- # base is a commit sha1
- compare_base="$GITHUB_BASE_REF"
- else
- repo="${GITHUB_REPOSITORY}"
- git remote -v
- remote="$(git remote -v | grep -E "github\.com(:|/)$repo((\.git)|(\s))" | grep fetch | awk '{print $1}')"
- git fetch "$remote" "$GITHUB_BASE_REF"
- compare_base="$remote/$GITHUB_BASE_REF"
- fi
- changed_files="$(git diff --name-only ${compare_base} HEAD apps/emqx)"
- if [ "$changed_files" = '' ]; then
- echo "nothing changed in apps/emqx, ignored."
- exit 0
- fi
- make ensure-rebar3
- cp rebar3 apps/emqx/
- cd apps/emqx
- ./rebar3 xref
- ./rebar3 dialyzer
- ./rebar3 eunit -v
- ./rebar3 ct -v
- ./rebar3 proper -d test/props
- - uses: actions/upload-artifact@v1
- if: failure()
- with:
- name: logs
- path: apps/emqx/_build/test/logs
- allgood_emqx_app_tests:
- runs-on: ubuntu-latest
- needs:
- - run_emqx_app_tests
- steps:
- - name: Check if all emqx app tests succeeded
- uses: re-actors/alls-green@release/v1
- with:
- #allowed-failures:
- #allowed-skips:
- jobs: ${{ toJSON(needs) }}
|