name: Check emqx app standalone # These tests are needed because we provide the `emqx` application as a standalone # dependency for plugins. concurrency: group: test-standalone-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true on: workflow_call: inputs: builder: required: true type: string before_ref: required: true type: string after_ref: required: true type: string env: IS_CI: "yes" permissions: contents: read jobs: run_emqx_app_tests: runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }} container: ${{ inputs.builder }} defaults: run: shell: bash steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: fetch-depth: 0 - name: run env: BEFORE_REF: ${{ inputs.before_ref }} AFTER_REF: ${{ inputs.after_ref }} run: | git config --global --add safe.directory "$GITHUB_WORKSPACE" changed_files="$(git diff --name-only ${BEFORE_REF} ${AFTER_REF} 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 --name 'eunit@127.0.0.1' ./rebar3 as standalone_test ct --name 'test@127.0.0.1' -v --readable=true ./rebar3 proper -d test/props - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 if: failure() with: name: logs-emqx-app-tests path: apps/emqx/_build/test/logs retention-days: 7