config.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. version: 2
  2. # 2.1 does not yet support local run
  3. # unless with workaround. For simplicity just use it.
  4. # https://github.com/CircleCI-Public/circleci-cli/issues/79
  5. jobs:
  6. build:
  7. docker:
  8. - image: circleci/node:8
  9. working_directory: ~/project
  10. steps:
  11. - checkout
  12. - attach_workspace:
  13. at: ~/project
  14. # Download and cache dependencies
  15. - restore_cache:
  16. keys:
  17. - v1-dependencies-{{ checksum "package-lock.json" }}
  18. # fallback to using the latest cache if no exact match is found
  19. - v1-dependencies-
  20. - run:
  21. name: Install npm dependencies
  22. command: npm install
  23. - save_cache:
  24. paths:
  25. - node_modules
  26. key: v1-dependencies-{{ checksum "package-lock.json" }}
  27. lint:
  28. docker:
  29. - image: circleci/node:8
  30. working_directory: ~/project
  31. steps:
  32. - checkout
  33. - attach_workspace:
  34. at: ~/project
  35. - restore_cache:
  36. keys:
  37. - v1-dependencies-{{ checksum "package-lock.json" }}
  38. # fallback to using the latest cache if no exact match is found
  39. - v1-dependencies-
  40. - run:
  41. name: Linter
  42. command: npm run lint
  43. test:
  44. docker:
  45. - image: circleci/node:8
  46. working_directory: ~/project
  47. steps:
  48. - checkout
  49. - attach_workspace:
  50. at: ~/project
  51. - restore_cache:
  52. keys:
  53. - v1-dependencies-{{ checksum "package-lock.json" }}
  54. # fallback to using the latest cache if no exact match is found
  55. - v1-dependencies-
  56. - run:
  57. name: Unit tests
  58. command: npm run test
  59. coverage:
  60. docker:
  61. - image: circleci/node:8
  62. working_directory: ~/project
  63. steps:
  64. - checkout
  65. - attach_workspace:
  66. at: ~/project
  67. - restore_cache:
  68. keys:
  69. - v1-dependencies-{{ checksum "package-lock.json" }}
  70. # fallback to using the latest cache if no exact match is found
  71. - v1-dependencies-
  72. - run:
  73. name: Unit tests with coverage report
  74. command: npm run test
  75. environment:
  76. SOLIDITY_COVERAGE: true
  77. # TODO(xinbenlv, #1839): run SOLC_NIGHTLY to be run but allow it to fail.
  78. # TODO(xinbenlv, #1839): requires SLACK WEBHOOK to be setup by repo owner.
  79. workflows:
  80. version: 2
  81. everything:
  82. jobs:
  83. - build
  84. - lint:
  85. requires:
  86. - build
  87. - test:
  88. requires:
  89. - build
  90. - coverage:
  91. requires:
  92. - build