build_and_test.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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@v1
  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. ports:
  68. - 9200
  69. options: --health-cmd="curl --silent --fail localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=3
  70. strategy:
  71. matrix:
  72. db: [sqljs, mysql, postgres]
  73. steps:
  74. - uses: actions/checkout@v1
  75. - name: Use Node.js ${{ env.node }}
  76. uses: actions/setup-node@v1
  77. with:
  78. node-version: ${{ env.node }}
  79. - name: Install & build
  80. run: |
  81. yarn install
  82. yarn bootstrap
  83. yarn lerna run ci
  84. - name: e2e tests
  85. env:
  86. E2E_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
  87. E2E_POSTGRES_PORT: ${{ job.services.postgres.ports['5432'] }}
  88. E2E_ELASTIC_PORT: ${{ job.services.elastic.ports['9200'] }}
  89. DB: ${{ matrix.db }}
  90. run: yarn e2e