1
0

build_and_test.yml 3.5 KB

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