config.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. version: 2
  2. defaults: &defaults
  3. working_directory: ~/project/vue
  4. docker:
  5. - image: circleci/node:6-browsers
  6. jobs:
  7. install:
  8. <<: *defaults
  9. steps:
  10. - checkout
  11. - restore_cache:
  12. keys:
  13. - v1-vue-{{ .Branch }}-{{ checksum "package-lock.json" }}
  14. - v1-vue-{{ .Branch }}-
  15. - v1-vue-
  16. - run: npm install
  17. - save_cache:
  18. key: v1-vue-{{ .Branch }}-{{ checksum "package-lock.json" }}
  19. paths:
  20. - node_modules/
  21. - persist_to_workspace:
  22. root: ~/project
  23. paths:
  24. - vue
  25. lint-flow-types:
  26. <<: *defaults
  27. steps:
  28. - attach_workspace:
  29. at: ~/project
  30. - run: npm run lint
  31. - run: npm run flow
  32. - run: npm run test:types
  33. test-cover:
  34. <<: *defaults
  35. steps:
  36. - attach_workspace:
  37. at: ~/project
  38. - run: npm run test:cover
  39. - run:
  40. name: report coverage stats for non-PRs
  41. command: |
  42. if [[ -z $CI_PULL_REQUEST ]]; then
  43. cat ./coverage/lcov.info | ./node_modules/.bin/codecov
  44. fi
  45. test-e2e:
  46. <<: *defaults
  47. steps:
  48. - attach_workspace:
  49. at: ~/project
  50. - run: npm run test:e2e -- --env phantomjs
  51. test-ssr-weex:
  52. <<: *defaults
  53. steps:
  54. - attach_workspace:
  55. at: ~/project
  56. - run: npm run test:ssr
  57. - run: npm run test:weex
  58. workflows:
  59. version: 2
  60. install-and-parallel-test:
  61. jobs:
  62. - install
  63. - test-cover:
  64. requires:
  65. - install
  66. - lint-flow-types:
  67. requires:
  68. - install
  69. - test-e2e:
  70. requires:
  71. - install
  72. - test-ssr-weex:
  73. requires:
  74. - install