build_and_test.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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_USER: admin
  58. POSTGRES_PASSWORD: secret
  59. ports:
  60. - 5432
  61. options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3
  62. elastic:
  63. image: docker.elastic.co/elasticsearch/elasticsearch:7.1.1
  64. env:
  65. discovery.type: single-node
  66. bootstrap.memory_lock: true
  67. ES_JAVA_OPTS: -Xms512m -Xmx512m
  68. # Elasticsearch will force read-only mode when total available disk space is less than 5%. Since we will
  69. # be running on a shared Azure instance with 84GB SSD, we easily go below 5% available even when there are still
  70. # > 3GB free. So we set this value to an absolute one rather than a percentage to prevent all the Elasticsearch
  71. # e2e tests from failing.
  72. cluster.routing.allocation.disk.watermark.low: 500mb
  73. cluster.routing.allocation.disk.watermark.high: 200mb
  74. cluster.routing.allocation.disk.watermark.flood_stage: 100mb
  75. ports:
  76. - 9200
  77. options: --health-cmd="curl --silent --fail localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=3
  78. strategy:
  79. matrix:
  80. db: [sqljs, mysql, postgres]
  81. steps:
  82. - uses: actions/checkout@v1
  83. - name: Use Node.js ${{ env.node }}
  84. uses: actions/setup-node@v1
  85. with:
  86. node-version: ${{ env.node }}
  87. - name: Install & build
  88. run: |
  89. yarn install
  90. yarn bootstrap
  91. yarn lerna run ci
  92. - name: df
  93. run: |
  94. df -h
  95. docker system df
  96. - name: e2e tests
  97. env:
  98. E2E_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
  99. E2E_POSTGRES_PORT: ${{ job.services.postgres.ports['5432'] }}
  100. E2E_ELASTIC_PORT: ${{ job.services.elastic.ports['9200'] }}
  101. DB: ${{ matrix.db }}
  102. run: yarn e2e