run_test_cases.yaml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. name: Run test case
  2. on:
  3. push:
  4. tags:
  5. - v*
  6. release:
  7. types:
  8. - published
  9. pull_request:
  10. jobs:
  11. run_static_analysis:
  12. runs-on: ubuntu-20.04
  13. container: emqx/build-env:erl23.2.7-ubuntu20.04
  14. steps:
  15. - uses: actions/checkout@v2
  16. - name: set git credentials
  17. run: |
  18. if make emqx-ee --dry-run > /dev/null 2>&1; then
  19. echo "https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com" > $HOME/.git-credentials
  20. git config --global credential.helper store
  21. fi
  22. - name: xref
  23. run: make xref
  24. - name: dialyzer
  25. run: make dialyzer
  26. run_common_test:
  27. runs-on: ubuntu-20.04
  28. steps:
  29. - uses: actions/checkout@v2
  30. - name: set edition
  31. id: set_edition
  32. run: |
  33. if make emqx-ee --dry-run > /dev/null 2>&1; then
  34. echo "EDITION=enterprise" >> $GITHUB_ENV
  35. else
  36. echo "EDITION=opensource" >> $GITHUB_ENV
  37. fi
  38. - name: docker compose up
  39. if: env.EDITION == 'opensource'
  40. env:
  41. MYSQL_TAG: 8
  42. REDIS_TAG: 6
  43. MONGO_TAG: 4
  44. PGSQL_TAG: 13
  45. LDAP_TAG: 2.4.50
  46. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  47. run: |
  48. docker-compose -f .ci/apps_tests/docker-compose.yaml build --no-cache
  49. docker-compose -f .ci/apps_tests/docker-compose.yaml up -d
  50. - name: docker compose up
  51. if: env.EDITION == 'enterprise'
  52. env:
  53. MYSQL_TAG: 8
  54. REDIS_TAG: 6
  55. MONGO_TAG: 4
  56. PGSQL_TAG: 13
  57. LDAP_TAG: 2.4.50
  58. OPENTSDB_TAG: latest
  59. INFLUXDB_TAG: 1.7.6
  60. DYNAMODB_TAG: 1.11.477
  61. TIMESCALE_TAG: latest-pg11
  62. CASSANDRA_TAG: 3.11.6
  63. RABBITMQ_TAG: 3.7
  64. KAFKA_TAG: 2.5.0
  65. PULSAR_TAG: 2.3.2
  66. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  67. run: |
  68. docker-compose -f .ci/apps_tests/docker-compose.yaml -f .ci/apps_tests/docker-compose.enterprise.yaml build --no-cache
  69. docker-compose -f .ci/apps_tests/docker-compose.yaml -f .ci/apps_tests/docker-compose.enterprise.yaml up -d
  70. docker exec -i erlang bash -c "echo \"https://ci%40emqx.io:${{ secrets.CI_GIT_TOKEN }}@github.com\" > /root/.git-credentials && git config --global credential.helper store"
  71. while [ $(docker ps -a --filter name=client --filter exited=0 | wc -l) \
  72. != $(docker ps -a --filter name=client | wc -l) ]; do
  73. sleep 5
  74. done
  75. - name: run eunit
  76. run: |
  77. docker exec -i erlang bash -c "make eunit"
  78. - name: run common test
  79. run: |
  80. docker exec -i erlang bash -c "make ct"
  81. - name: run cover
  82. run: |
  83. docker exec -i erlang bash -c "make cover"
  84. docker exec -i erlang bash -c "make coveralls"
  85. - uses: actions/upload-artifact@v1
  86. if: failure()
  87. with:
  88. name: logs
  89. path: _build/test/logs
  90. - uses: actions/upload-artifact@v1
  91. with:
  92. name: cover
  93. path: _build/test/cover