build_and_test.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. name: Build & Test
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. branches:
  8. - master
  9. jobs:
  10. build:
  11. runs-on: ubuntu-latest
  12. strategy:
  13. matrix:
  14. node-version: [10.x, 12.x]
  15. env:
  16. CI: true
  17. steps:
  18. - uses: actions/checkout@v1
  19. - name: Use Node.js ${{ matrix.node-version }}
  20. uses: actions/setup-node@v1
  21. with:
  22. node-version: ${{ matrix.node-version }}
  23. # This is required for the elasticsearch-plugin e2e tests. It would be better to use the
  24. # "services" feature, but I cannot figure out how to connect to it from the test server.
  25. - name: Install elasticsearch
  26. run: |
  27. curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.4.2-linux-x86_64.tar.gz
  28. tar -xvf elasticsearch-7.4.2-linux-x86_64.tar.gz
  29. cd elasticsearch-7.4.2/bin
  30. ./elasticsearch &
  31. - name: Install & build
  32. run: |
  33. yarn install
  34. yarn bootstrap
  35. yarn build
  36. - name: Unit tests
  37. run: yarn test
  38. - name: e2e tests
  39. env:
  40. ELASTICSEARCH_PORT: 9200
  41. ELASTICSEARCH_HOST: http://localhost
  42. run: yarn e2e