run_emqx_app_tests.yaml 1.6 KB

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