test.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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: 12.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. - run: npm run test:inheritance
  31. - name: Print gas report
  32. run: cat gas-report.txt
  33. coverage:
  34. runs-on: ubuntu-latest
  35. steps:
  36. - uses: actions/checkout@v2
  37. with:
  38. fetch-depth: 2
  39. - uses: actions/setup-node@v2
  40. with:
  41. node-version: 12.x
  42. - uses: actions/cache@v2
  43. id: cache
  44. with:
  45. path: '**/node_modules'
  46. key: npm-v2-${{ hashFiles('**/package-lock.json') }}
  47. restore-keys: npm-v2-
  48. - run: npm ci
  49. if: steps.cache.outputs.cache-hit != 'true'
  50. - run: npm run coverage
  51. env:
  52. NODE_OPTIONS: --max_old_space_size=4096
  53. - uses: codecov/codecov-action@v2
  54. slither:
  55. runs-on: ubuntu-latest
  56. steps:
  57. - uses: actions/checkout@v2
  58. - uses: actions/setup-node@v2
  59. with:
  60. node-version: 12.x
  61. - uses: actions/cache@v2
  62. id: cache
  63. with:
  64. path: '**/node_modules'
  65. key: npm-v2-${{ hashFiles('**/package-lock.json') }}
  66. restore-keys: npm-v2-
  67. - run: npm ci
  68. if: steps.cache.outputs.cache-hit != 'true'
  69. - name: Set up Python
  70. uses: actions/setup-python@v2
  71. - name: Install dependencies
  72. run: pip3 install slither-analyzer
  73. - name: Summary of static analysis
  74. run: npm run slither