build_and_test.yml 3.5 KB

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