run_emqx_app_tests.yaml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. name: Check emqx app standalone
  2. # These tests are needed because we provide the `emqx` application as a standalone
  3. # dependency for plugins.
  4. concurrency:
  5. group: test-standalone-${{ github.event_name }}-${{ github.ref }}
  6. cancel-in-progress: true
  7. on:
  8. workflow_call:
  9. inputs:
  10. builder:
  11. required: true
  12. type: string
  13. before_ref:
  14. required: true
  15. type: string
  16. after_ref:
  17. required: true
  18. type: string
  19. env:
  20. IS_CI: "yes"
  21. permissions:
  22. contents: read
  23. jobs:
  24. run_emqx_app_tests:
  25. runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
  26. container: ${{ inputs.builder }}
  27. defaults:
  28. run:
  29. shell: bash
  30. steps:
  31. - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
  32. with:
  33. fetch-depth: 0
  34. - name: run
  35. env:
  36. BEFORE_REF: ${{ inputs.before_ref }}
  37. AFTER_REF: ${{ inputs.after_ref }}
  38. run: |
  39. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  40. changed_files="$(git diff --name-only ${BEFORE_REF} ${AFTER_REF} apps/emqx)"
  41. if [ "$changed_files" = '' ]; then
  42. echo "nothing changed in apps/emqx, ignored."
  43. exit 0
  44. fi
  45. make ensure-rebar3
  46. cp rebar3 apps/emqx/
  47. cd apps/emqx
  48. ./rebar3 xref
  49. ./rebar3 dialyzer
  50. ./rebar3 eunit -v --name 'eunit@127.0.0.1'
  51. ./rebar3 as standalone_test ct --name 'test@127.0.0.1' -v --readable=true
  52. ./rebar3 proper -d test/props
  53. - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
  54. if: failure()
  55. with:
  56. name: logs-emqx-app-tests
  57. path: apps/emqx/_build/test/logs
  58. retention-days: 7