1
1
version : 2.1
2
2
orbs :
3
- cypress :
cypress-io/[email protected]
3
+ cypress :
cypress-io/[email protected] # used to run e2e tests
4
+ node :
circleci/[email protected] # used to publish new NPM version
5
+
6
+ jobs :
7
+ publish :
8
+ executor :
9
+ name : node/default
10
+ tag : ' 12'
11
+ steps :
12
+ - checkout
13
+ - node/with-cache :
14
+ steps :
15
+ - run : npm ci
16
+ - run : npm run semantic-release
17
+
4
18
workflows :
5
19
build :
6
20
jobs :
21
+ - cypress/install
7
22
- cypress/run :
23
+ name : frontend coverage
24
+ requires :
25
+ - cypress/install
8
26
# we need to start the web application
9
27
start : npm start
10
28
# there are no jobs to follow this one
@@ -23,5 +41,31 @@ workflows:
23
41
- run : npx nyc report --check-coverage true --lines 100 --include cypress/about.js
24
42
# make sure unit tests are covered
25
43
- run : npx nyc report --check-coverage true --lines 100 --include cypress/unit.js
26
- # publish new version if necessary
27
- - run : npm run semantic-release
44
+
45
+ - cypress/run :
46
+ name : backend coverage
47
+ requires :
48
+ - cypress/install
49
+
50
+ start : npm run start:test:backend
51
+ command : npx cypress run --config-file cypress-backend.json
52
+
53
+ # there are no jobs to follow this one
54
+ # so no need to save the workspace files (saves time)
55
+ no-workspace : true
56
+ post-steps :
57
+ # store the created coverage report folder
58
+ # you can click on it in the CircleCI UI
59
+ # to see live static HTML site
60
+ - store_artifacts :
61
+ path : coverage
62
+ # print code coverage summary to the terminal
63
+ # and make sure there the coverage is above certain limit
64
+ - run : npx nyc report --check-coverage true --lines 85
65
+ # and look at the server index file - should be fully covered
66
+ - run : npx nyc report --check-coverage true --lines 100 --include test-backend/index.js
67
+
68
+ - publish :
69
+ requires :
70
+ - frontend coverage
71
+ - backend coverage
0 commit comments