File tree Expand file tree Collapse file tree 2 files changed +75
-24
lines changed Expand file tree Collapse file tree 2 files changed +75
-24
lines changed Original file line number Diff line number Diff line change 1+ version : 2
2+ jobs :
3+ build :
4+ docker :
5+ - image : circleci/node:7.10
6+ steps :
7+ - checkout
8+ - restore_cache :
9+ keys :
10+ - v1-dependencies-{{ checksum "package.json" }}
11+ - v1-dependencies-
12+ - run :
13+ command : npm install
14+ - save_cache :
15+ key : v1-dependencies-{{ checksum "package.json" }}
16+ paths :
17+ - node_modules
18+ - run :
19+ command : npm run build
20+ test :
21+ docker :
22+ - image : circleci/node:7.10
23+ steps :
24+ - checkout
25+ - restore_cache :
26+ keys :
27+ - v1-dependencies-{{ checksum "package.json" }}
28+ - v1-dependencies-
29+ - run :
30+ command : npm run build
31+ - run :
32+ command : npm run test
33+ workflows :
34+ version : 2
35+ build-and-deploy :
36+ jobs :
37+ - build
38+ - test :
39+ filters :
40+ branches :
41+ only : master
Original file line number Diff line number Diff line change 1- # JavaScript Node CircleCI 2.0 configuration file
2- #
3- # Check https://circleci.com/docs/2.0/language-javascript/ for more details
4- #
51version : 2.1
6- jobs :
7- build :
8- docker :
9- # specify the version you desire here
10- - image : circleci/node:7.10
11-
12- # Specify service dependencies here if necessary
13- # CircleCI maintains a library of pre-built images
14- # documented at https://circleci.com/docs/2.0/circleci-images/
15- # - image: circleci/mongo:3.4.4
162
17- working_directory : ~/repo
3+ executors :
4+ nodejs :
5+ docker :
6+ - image : circleci/node:7.10
187
8+ commands :
9+ ceckout-and-restore-cache :
10+ description : " restore cache by package.json"
1911 steps :
2012 - checkout
21-
22- # Download and cache dependencies
2313 - restore_cache :
2414 keys :
2515 - v1-dependencies-{{ checksum "package.json" }}
26- # fallback to using the latest cache if no exact match is found
2716 - v1-dependencies-
28-
29- - run : npm install
30-
17+ save-node-modules-cache :
18+ steps :
3119 - save_cache :
20+ key : v1-dependencies-{{ checksum "package.json" }}
3221 paths :
3322 - node_modules
34- key : v1-dependencies-{{ checksum "package.json" }}
3523
36- # run tests!
24+ jobs :
25+ build :
26+ executor : nodejs
27+ steps :
28+ - ceckout-and-restore-cache
29+ - run : npm install
30+ - save-node-modules-cache
3731 - run : npm run build
38- - run : npm test
32+
33+ test :
34+ executor : nodejs
35+ steps :
36+ - ceckout-and-restore-cache
37+ - run : npm run build
38+ - run : npm run test
39+
40+ workflows :
41+ version : 2.1
42+ build-and-deploy :
43+ jobs :
44+ - build
45+ - test :
46+ filters :
47+ branches :
48+ only : master
You can’t perform that action at this time.
0 commit comments