11version : 2.1
22orbs :
3- cypress : cypress-io/cypress@1.13.0
3+ cypress : cypress-io/cypress@1.13.0 # used to run e2e tests
4+ node : circleci/node@1.1.6 # 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+
418workflows :
519 build :
620 jobs :
21+ - cypress/install
722 - cypress/run :
23+ name : frontend coverage
24+ requires :
25+ - cypress/install
826 # we need to start the web application
927 start : npm start
1028 # there are no jobs to follow this one
@@ -23,5 +41,31 @@ workflows:
2341 - run : npx nyc report --check-coverage true --lines 100 --include cypress/about.js
2442 # make sure unit tests are covered
2543 - 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