run_test_cases.yaml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. name: Run test case
  2. on:
  3. push:
  4. tags:
  5. - v*
  6. release:
  7. types:
  8. - published
  9. pull_request:
  10. workflow_dispatch:
  11. repository_dispatch:
  12. types: [run_actions]
  13. jobs:
  14. run_test_case:
  15. runs-on: ubuntu-20.04
  16. steps:
  17. - uses: actions/checkout@v2
  18. - name: set up
  19. env:
  20. MYSQL_TAG: 8
  21. REDIS_TAG: 6
  22. MONGO_TAG: 4
  23. PGSQL_TAG: 13
  24. LDAP_TAG: 2.4.50
  25. run: |
  26. cp -f apps/emqx_auth_ldap/emqx.io.ldif .ci/apps_tests/emqx_ldap/schema
  27. cp -f apps/emqx_auth_ldap/emqx.schema .ci/apps_tests/emqx_ldap/schema
  28. cp -f apps/emqx_auth_ldap/test/certs/* .ci/apps_tests/emqx_ldap/certs
  29. docker-compose -f .ci/apps_tests/docker-compose.yaml build --no-cache
  30. docker-compose -f .ci/apps_tests/docker-compose.yaml up -d
  31. - name: set config files
  32. run: |
  33. sed -i "/auth.mysql.server/c auth.mysql.server = mysql_server:3306" apps/emqx_auth_mysql/etc/emqx_auth_mysql.conf
  34. sed -i "/auth.redis.server/c auth.redis.server = redis_server:6379" apps/emqx_auth_redis/etc/emqx_auth_redis.conf
  35. sed -i "/auth.mongo.server/c auth.mongo.server = mongo_server:27017" apps/emqx_auth_mongo/etc/emqx_auth_mongo.conf
  36. sed -i "/auth.pgsql.server/c auth.pgsql.server = pgsql_server:5432" apps/emqx_auth_pgsql/etc/emqx_auth_pgsql.conf
  37. sed -i "/auth.ldap.servers/c auth.ldap.servers = ldap_server" apps/emqx_auth_ldap/etc/emqx_auth_ldap.conf
  38. - name: run tests
  39. run: |
  40. docker exec -i erlang bash -c "make ct"
  41. docker exec -i erlang bash -c "make cover"
  42. - uses: actions/upload-artifact@v1
  43. if: failure()
  44. with:
  45. name: logs
  46. path: _build/test/logs
  47. - uses: actions/upload-artifact@v1
  48. with:
  49. name: cover
  50. path: _build/test/cover