test.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. env:
  28. FORCE_COLOR: 1
  29. ENABLE_GAS_REPORT: true
  30. - name: Print gas report
  31. run: cat gas-report.txt
  32. coverage:
  33. runs-on: ubuntu-latest
  34. steps:
  35. - uses: actions/checkout@v2
  36. with:
  37. fetch-depth: 2
  38. - uses: actions/setup-node@v2
  39. with:
  40. node-version: 10.x
  41. - uses: actions/cache@v2
  42. id: cache
  43. with:
  44. path: '**/node_modules'
  45. key: npm-v2-${{ hashFiles('**/package-lock.json') }}
  46. restore-keys: npm-v2-
  47. - run: npm ci
  48. if: steps.cache.outputs.cache-hit != 'true'
  49. - run: npm run coverage
  50. env:
  51. NODE_OPTIONS: --max_old_space_size=4096
  52. - uses: codecov/codecov-action@v1