run_test_cases.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. name: Run test case
  2. concurrency:
  3. group: test-${{ github.event_name }}-${{ github.ref }}
  4. cancel-in-progress: true
  5. on:
  6. push:
  7. tags:
  8. - v*
  9. - e*
  10. pull_request:
  11. jobs:
  12. run_static_analysis:
  13. strategy:
  14. matrix:
  15. emqx_builder:
  16. - 5.0-2:24.1.5-2 # run dialyzer on latest OTP
  17. runs-on: ubuntu-20.04
  18. container: "ghcr.io/emqx/emqx-builder/${{ matrix.emqx_builder }}-ubuntu20.04"
  19. steps:
  20. - uses: actions/checkout@v2
  21. - name: set git credentials
  22. run: |
  23. if make emqx-ee --dry-run > /dev/null 2>&1; then
  24. echo "https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com" > $HOME/.git-credentials
  25. git config --global credential.helper store
  26. fi
  27. - name: xref
  28. run: make xref
  29. - name: dialyzer
  30. run: make dialyzer
  31. run_proper_test:
  32. strategy:
  33. matrix:
  34. emqx_builder:
  35. - 5.0-2:24.1.5-2
  36. runs-on: ubuntu-20.04
  37. container: "ghcr.io/emqx/emqx-builder/${{ matrix.emqx_builder }}-ubuntu20.04"
  38. steps:
  39. - uses: actions/checkout@v2
  40. - name: set git credentials
  41. run: |
  42. if make emqx-ee --dry-run > /dev/null 2>&1; then
  43. echo "https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com" > $HOME/.git-credentials
  44. git config --global credential.helper store
  45. fi
  46. - name: proper
  47. run: make proper
  48. run_common_test:
  49. strategy:
  50. matrix:
  51. otp_release:
  52. - "erlang23"
  53. - "erlang24"
  54. runs-on: ubuntu-20.04
  55. steps:
  56. - uses: actions/checkout@v2
  57. - name: docker compose up
  58. env:
  59. REDIS_TAG: 6
  60. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  61. run: |
  62. docker-compose \
  63. -f .ci/docker-compose-file/docker-compose-redis-single-tcp.yaml \
  64. -f .ci/docker-compose-file/docker-compose.yaml \
  65. up -d --build
  66. - name: run eunit
  67. run: |
  68. docker exec -i ${{ matrix.otp_release }} bash -c "make eunit"
  69. - name: run common test
  70. run: |
  71. docker exec -i ${{ matrix.otp_release }} bash -c "make ct"
  72. - name: run cover
  73. run: |
  74. printenv > .env
  75. docker exec -i ${{ matrix.otp_release }} bash -c "DIAGNOSTIC=1 make cover"
  76. docker exec --env-file .env -i ${{ matrix.otp_release }} bash -c "DIAGNOSTIC=1 make coveralls"
  77. - name: cat rebar.crashdump
  78. if: failure()
  79. run: if [ -f 'rebar3.crashdump' ];then cat 'rebar3.crashdump'; fi
  80. - uses: actions/upload-artifact@v1
  81. if: failure()
  82. with:
  83. name: logs_${{ matrix.otp_release }}
  84. path: _build/test/logs
  85. - uses: actions/upload-artifact@v1
  86. with:
  87. name: cover_${{ matrix.otp_release }}
  88. path: _build/test/cover
  89. finish:
  90. needs: run_common_test
  91. runs-on: ubuntu-20.04
  92. steps:
  93. - name: Coveralls Finished
  94. env:
  95. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  96. run: |
  97. curl -v -k https://coveralls.io/webhook \
  98. --header "Content-Type: application/json" \
  99. --data "{\"repo_name\":\"$GITHUB_REPOSITORY\",\"repo_token\":\"$GITHUB_TOKEN\",\"payload\":{\"build_num\":$GITHUB_RUN_ID,\"status\":\"done\"}}" || true