File tree 2 files changed +63
-23
lines changed
2 files changed +63
-23
lines changed Original file line number Diff line number Diff line change 1
1
version : 2
2
2
jobs :
3
- build :
3
+ build_and_test :
4
4
working_directory : ~/mern-starter
5
5
# The primary container is an instance of the first image listed. The job's commands run in this container.
6
6
docker :
20
20
key : dependency-cache-{{ checksum "package-lock.json" }}
21
21
paths :
22
22
- node_modules
23
- test :
24
- docker :
25
- - image : circleci/node:latest
26
- steps :
27
- - checkout
28
- # needed to add here also as both install and test are different docker instances and need to do same thing again in different instance
29
- - run :
30
- name : Update npm
31
- command : ' sudo npm install -g npm@latest'
32
- - restore_cache :
33
- key : dependency-cache-{{ checksum "package-lock.json" }}
34
- - run :
35
- name : Install npm dependencies
36
- command : npm install
37
- - save_cache :
38
- key : dependency-cache-{{ checksum "package-lock.json" }}
39
- paths :
40
- - node_modules
41
23
- run :
42
24
name : Test
43
25
command : npm test
@@ -55,7 +37,4 @@ workflows:
55
37
version : 2
56
38
build_and_test :
57
39
jobs :
58
- - build
59
- - test :
60
- requires :
61
- - build
40
+ - build_and_test
Original file line number Diff line number Diff line change
1
+ version : 2
2
+ jobs :
3
+ build :
4
+ working_directory : ~/mern-starter
5
+ # The primary container is an instance of the first image listed. The job's commands run in this container.
6
+ docker :
7
+ - image : circleci/node:latest
8
+ # The secondary container is an instance of the second listed image which is run in a common network where ports exposed on the primary container are available on localhost.
9
+ steps :
10
+ - checkout
11
+ - run :
12
+ name : Update npm
13
+ command : ' sudo npm install -g npm@latest'
14
+ - restore_cache :
15
+ key : dependency-cache-{{ checksum "package-lock.json" }}
16
+ - run :
17
+ name : Install npm dependencies
18
+ command : npm install
19
+ - save_cache :
20
+ key : dependency-cache-{{ checksum "package-lock.json" }}
21
+ paths :
22
+ - node_modules
23
+ test :
24
+ docker :
25
+ - image : circleci/node:latest
26
+ steps :
27
+ - checkout
28
+ # needed to add here also as both install and test are different docker instances and need to do same thing again in different instance
29
+ - run :
30
+ name : Update npm
31
+ command : ' sudo npm install -g npm@latest'
32
+ - restore_cache :
33
+ key : dependency-cache-{{ checksum "package-lock.json" }}
34
+ - run :
35
+ name : Install npm dependencies
36
+ command : npm install
37
+ - save_cache :
38
+ key : dependency-cache-{{ checksum "package-lock.json" }}
39
+ paths :
40
+ - node_modules
41
+ - run :
42
+ name : Test
43
+ command : npm test
44
+ - run :
45
+ name : Generate code coverage
46
+ command : ' ./node_modules/.bin/nyc report --reporter=text-lcov'
47
+ - store_artifacts :
48
+ path : test-results.xml
49
+ prefix : tests
50
+ - store_artifacts :
51
+ path : coverage
52
+ prefix : coverage
53
+
54
+ workflows :
55
+ version : 2
56
+ build_and_test :
57
+ jobs :
58
+ - build
59
+ - test :
60
+ requires :
61
+ - build
You can’t perform that action at this time.
0 commit comments