run_emqx_app_tests.yaml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. runner:
  11. required: true
  12. type: string
  13. builder:
  14. required: true
  15. type: string
  16. before_ref:
  17. required: true
  18. type: string
  19. after_ref:
  20. required: true
  21. type: string
  22. env:
  23. IS_CI: "yes"
  24. jobs:
  25. run_emqx_app_tests:
  26. runs-on: ${{ inputs.runner }}
  27. container: ${{ inputs.builder }}
  28. defaults:
  29. run:
  30. shell: bash
  31. steps:
  32. - uses: actions/checkout@v3
  33. with:
  34. fetch-depth: 0
  35. - name: run
  36. env:
  37. BEFORE_REF: ${{ inputs.before_ref }}
  38. AFTER_REF: ${{ inputs.after_ref }}
  39. run: |
  40. git config --global --add safe.directory "$GITHUB_WORKSPACE"
  41. changed_files="$(git diff --name-only ${BEFORE_REF} ${AFTER_REF} apps/emqx)"
  42. if [ "$changed_files" = '' ]; then
  43. echo "nothing changed in apps/emqx, ignored."
  44. exit 0
  45. fi
  46. make ensure-rebar3
  47. cp rebar3 apps/emqx/
  48. cd apps/emqx
  49. ./rebar3 xref
  50. ./rebar3 dialyzer
  51. ./rebar3 eunit -v --name 'eunit@127.0.0.1'
  52. ./rebar3 as standalone_test ct --name 'test@127.0.0.1' -v --readable=true
  53. ./rebar3 proper -d test/props
  54. - uses: actions/upload-artifact@v3
  55. if: failure()
  56. with:
  57. name: logs-${{ inputs.runner }}
  58. path: apps/emqx/_build/test/logs