build_and_test.yml 3.6 KB

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