build_and_test.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. name: Build & Test
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - next
  7. pull_request:
  8. branches:
  9. - master
  10. - next
  11. env:
  12. CI: true
  13. node: 12.x
  14. jobs:
  15. build:
  16. name: build
  17. runs-on: ubuntu-latest
  18. steps:
  19. - uses: actions/checkout@v2
  20. - name: Use Node.js ${{ env.node }}
  21. uses: actions/setup-node@v1
  22. with:
  23. node-version: ${{ env.node }}
  24. - name: Install & build
  25. run: |
  26. yarn install
  27. yarn bootstrap
  28. yarn build
  29. unit-tests:
  30. name: unit tests
  31. runs-on: ubuntu-latest
  32. steps:
  33. - uses: actions/checkout@v1
  34. - name: Use Node.js ${{ env.node }}
  35. uses: actions/setup-node@v1
  36. with:
  37. node-version: ${{ env.node }}
  38. - name: Install & build
  39. run: |
  40. yarn install
  41. yarn bootstrap
  42. yarn lerna run ci
  43. - name: Unit tests
  44. run: yarn test
  45. e2e-tests:
  46. name: e2e tests
  47. runs-on: ubuntu-latest
  48. services:
  49. mysql:
  50. image: bitnami/mariadb:10.3
  51. env:
  52. ALLOW_EMPTY_PASSWORD: yes
  53. ports:
  54. - 3306
  55. options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
  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, 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_POSTGRES_PORT: ${{ job.services.postgres.ports['5432'] }}
  102. E2E_ELASTIC_PORT: ${{ job.services.elastic.ports['9200'] }}
  103. DB: ${{ matrix.db }}
  104. run: yarn e2e