test.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: Test
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - release-v*
  7. pull_request: {}
  8. workflow_dispatch: {}
  9. jobs:
  10. test:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v2
  14. - uses: actions/setup-node@v2
  15. with:
  16. node-version: 10.x
  17. - uses: actions/cache@v2
  18. id: cache
  19. with:
  20. path: '**/node_modules'
  21. key: npm-v2-${{ hashFiles('**/package-lock.json') }}
  22. restore-keys: npm-v2-
  23. - run: npm ci
  24. if: steps.cache.outputs.cache-hit != 'true'
  25. - run: npm run lint
  26. - run: npm run test
  27. coverage:
  28. runs-on: ubuntu-latest
  29. steps:
  30. - uses: actions/checkout@v2
  31. with:
  32. fetch-depth: 2
  33. - uses: actions/setup-node@v2
  34. with:
  35. node-version: 10.x
  36. - uses: actions/cache@v2
  37. id: cache
  38. with:
  39. path: '**/node_modules'
  40. key: npm-v2-${{ hashFiles('**/package-lock.json') }}
  41. restore-keys: npm-v2-
  42. - run: npm ci
  43. if: steps.cache.outputs.cache-hit != 'true'
  44. - run: npm run coverage
  45. env:
  46. NODE_OPTIONS: --max_old_space_size=4096
  47. - uses: codecov/codecov-action@v1