config.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. aliases:
  6. - &defaults
  7. docker:
  8. - image: circleci/node:10
  9. - &cache_key_node_modules
  10. key: v1-node_modules-{{ checksum "package-lock.json" }}
  11. jobs:
  12. dependencies:
  13. <<: *defaults
  14. steps:
  15. - checkout
  16. - restore_cache:
  17. <<: *cache_key_node_modules
  18. - run:
  19. name: Install npm dependencies and prepare
  20. command: |
  21. if [ ! -d node_modules ]; then
  22. npm ci
  23. else
  24. npm run prepare
  25. fi
  26. - persist_to_workspace:
  27. root: .
  28. paths:
  29. - node_modules
  30. - build
  31. - save_cache:
  32. paths:
  33. - node_modules
  34. <<: *cache_key_node_modules
  35. lint:
  36. <<: *defaults
  37. steps:
  38. - checkout
  39. - attach_workspace:
  40. at: .
  41. - run:
  42. name: Linter
  43. command: npm run lint
  44. test:
  45. <<: *defaults
  46. steps:
  47. - checkout
  48. - attach_workspace:
  49. at: .
  50. - run:
  51. name: Unit tests
  52. command: npm run test
  53. coverage:
  54. <<: *defaults
  55. steps:
  56. - checkout
  57. - attach_workspace:
  58. at: .
  59. - run:
  60. name: Unit tests with coverage report
  61. command: npm run coverage
  62. # TODO(xinbenlv, #1839): run SOLC_NIGHTLY to be run but allow it to fail.
  63. workflows:
  64. version: 2
  65. everything:
  66. jobs:
  67. - dependencies
  68. - lint:
  69. requires:
  70. - dependencies
  71. - test:
  72. requires:
  73. - dependencies
  74. - coverage:
  75. requires:
  76. - dependencies