run_emqx_app_tests.yaml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. name: Check emqx app standalone
  2. ## apps/emqx can be used as a rebar/mix dependency
  3. ## in other project, so we need to make sure apps/emqx
  4. ## as an Erlang/Elixir app works standalone
  5. on:
  6. pull_request:
  7. jobs:
  8. run_emqx_app_tests:
  9. strategy:
  10. matrix:
  11. otp:
  12. - 23.3.4.9-4
  13. - 24.2.1-1
  14. # no need to use more than 1 version of Elixir, since tests
  15. # run using only Erlang code. This is needed just to specify
  16. # the base image.
  17. elixir:
  18. - 1.13.3
  19. os:
  20. - ubuntu20.04
  21. arch:
  22. - amd64
  23. runs-on: aws-amd64
  24. container: "ghcr.io/emqx/emqx-builder/5.0-10:${{ matrix.elixir}}-${{ matrix.otp }}-${{ matrix.os }}"
  25. defaults:
  26. run:
  27. shell: bash
  28. steps:
  29. - uses: actions/checkout@v2
  30. with:
  31. fetch-depth: 0
  32. - name: Get deps git refs for cache
  33. id: deps-refs
  34. run: |
  35. PATH=$PATH:./ scripts/get-dep-refs.sh
  36. make clean-all
  37. - name: load quicer cache
  38. uses: actions/cache@v2
  39. with:
  40. path: _build/default/lib/quicer/
  41. key: ${{ matrix.os }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ steps.deps-refs.outputs.DEP_QUICER_REF }}
  42. - name: run
  43. run: |
  44. echo "git diff base: $GITHUB_BASE_REF"
  45. if [[ "$GITHUB_BASE_REF" =~ [0-9a-f]{8,40} ]]; then
  46. # base is a commit sha1
  47. compare_base="$GITHUB_BASE_REF"
  48. else
  49. compare_base="origin/$GITHUB_BASE_REF"
  50. fi
  51. changed_files="$(git diff --name-only ${compare_base}...HEAD apps/emqx)"
  52. if [ "$changed_files" = '' ]; then
  53. echo "nothing changed in apps/emqx, ignored."
  54. exit 0
  55. fi
  56. make ensure-rebar3
  57. cp rebar3 apps/emqx/
  58. cd apps/emqx
  59. ./rebar3 xref
  60. ./rebar3 dialyzer
  61. ./rebar3 eunit -v
  62. ./rebar3 ct -v
  63. ./rebar3 proper -d test/props
  64. - uses: actions/upload-artifact@v1
  65. if: failure()
  66. with:
  67. name: logs
  68. path: apps/emqx/_build/test/logs
  69. allgood_emqx_app_tests:
  70. runs-on: ubuntu-latest
  71. needs:
  72. - run_emqx_app_tests
  73. steps:
  74. - name: Check if all emqx app tests succeeded
  75. uses: re-actors/alls-green@release/v1
  76. with:
  77. #allowed-failures:
  78. #allowed-skips:
  79. jobs: ${{ toJSON(needs) }}