config.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. workflows:
  79. version: 2
  80. everything:
  81. jobs:
  82. - build
  83. - lint:
  84. requires:
  85. - build
  86. - test:
  87. requires:
  88. - build
  89. - coverage:
  90. requires:
  91. - build