build_and_test.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. name: Build & Test
  2. on: push
  3. env:
  4. CI: true
  5. node: 12.x
  6. jobs:
  7. build:
  8. name: build
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v2
  12. - name: Use Node.js ${{ env.node }}
  13. uses: actions/setup-node@v1
  14. with:
  15. node-version: ${{ env.node }}
  16. - name: Install & build
  17. run: |
  18. yarn install
  19. yarn bootstrap
  20. yarn build
  21. unit-tests:
  22. name: unit tests
  23. runs-on: ubuntu-latest
  24. steps:
  25. - uses: actions/checkout@v1
  26. - name: Use Node.js ${{ env.node }}
  27. uses: actions/setup-node@v1
  28. with:
  29. node-version: ${{ env.node }}
  30. - name: Install & build
  31. run: |
  32. yarn install
  33. yarn bootstrap
  34. yarn lerna run ci
  35. - name: Unit tests
  36. run: yarn test
  37. e2e-tests:
  38. name: e2e tests
  39. runs-on: ubuntu-latest
  40. services:
  41. mariadb:
  42. image: bitnami/mariadb:10.3
  43. env:
  44. ALLOW_EMPTY_PASSWORD: yes
  45. ports:
  46. - 3306
  47. options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
  48. mysql:
  49. image: bitnami/mysql:8.0
  50. env:
  51. ALLOW_EMPTY_PASSWORD: yes
  52. MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
  53. ports:
  54. - 3306
  55. options: --health-cmd="mysqladmin ping --silent" --health-interval=10s --health-timeout=20s --health-retries=10
  56. postgres:
  57. image: postgres:12
  58. env:
  59. POSTGRES_USER: admin
  60. POSTGRES_PASSWORD: secret
  61. ports:
  62. - 5432
  63. options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3
  64. elastic:
  65. image: docker.elastic.co/elasticsearch/elasticsearch:7.1.1
  66. env:
  67. discovery.type: single-node
  68. bootstrap.memory_lock: true
  69. ES_JAVA_OPTS: -Xms512m -Xmx512m
  70. # Elasticsearch will force read-only mode when total available disk space is less than 5%. Since we will
  71. # be running on a shared Azure instance with 84GB SSD, we easily go below 5% available even when there are still
  72. # > 3GB free. So we set this value to an absolute one rather than a percentage to prevent all the Elasticsearch
  73. # e2e tests from failing.
  74. cluster.routing.allocation.disk.watermark.low: 500mb
  75. cluster.routing.allocation.disk.watermark.high: 200mb
  76. cluster.routing.allocation.disk.watermark.flood_stage: 100mb
  77. ports:
  78. - 9200
  79. options: --health-cmd="curl --silent --fail localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=3
  80. strategy:
  81. matrix:
  82. db: [sqljs, mariadb, mysql, postgres]
  83. steps:
  84. - uses: actions/checkout@v1
  85. - name: Use Node.js ${{ env.node }}
  86. uses: actions/setup-node@v1
  87. with:
  88. node-version: ${{ env.node }}
  89. - name: Install & build
  90. run: |
  91. yarn install
  92. yarn bootstrap
  93. yarn lerna run ci
  94. - name: df
  95. run: |
  96. df -h
  97. docker system df
  98. - name: e2e tests
  99. env:
  100. E2E_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
  101. E2E_MARIADB_PORT: ${{ job.services.mariadb.ports['3306'] }}
  102. E2E_POSTGRES_PORT: ${{ job.services.postgres.ports['5432'] }}
  103. E2E_ELASTIC_PORT: ${{ job.services.elastic.ports['9200'] }}
  104. DB: ${{ matrix.db }}
  105. run: yarn e2e