run_emqx_app_tests.yaml 2.3 KB

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