build_and_test.yml 3.1 KB

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