Skip to content

Commit a5a9664

Browse files
authored
chore: adding CI test on Windows (cypress-io#359)
1 parent 6159ac1 commit a5a9664

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

.circleci/config.yml

+40-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# https://circleci.com/docs/2.0/configuration-reference/
22
version: 2.1
33
orbs:
4-
cypress: cypress-io/[email protected] # used to run e2e tests
4+
# https://github.com/cypress-io/circleci-orb
5+
cypress: cypress-io/[email protected] # used to run e2e tests
56
node: circleci/[email protected] # used to publish new NPM version
7+
win: circleci/windows@2 # run a test job on Windows
68

79
jobs:
810
unit:
@@ -484,6 +486,42 @@ workflows:
484486
../../node_modules/.bin/only-covered main.js
485487
working_directory: examples/one-spec
486488

489+
- cypress/run:
490+
name: Windows test
491+
executor:
492+
# executor comes from the "windows" orb
493+
name: win/default
494+
shell: bash.exe
495+
no-workspace: true
496+
start: npm run start:windows --prefix examples/all-files
497+
wait-on: 'http://localhost:1234'
498+
command: npx cypress run --project examples/all-files
499+
# store screenshots and videos
500+
store_artifacts: true
501+
post-steps:
502+
- run: cat examples/all-files/.nyc_output/out.json
503+
- run: cat examples/all-files/coverage/coverage-final.json
504+
# store the created coverage report folder
505+
# you can click on it in the CircleCI UI
506+
# to see live static HTML site
507+
- store_artifacts:
508+
path: examples/all-files/coverage
509+
# make sure the examples captures 100% of code
510+
- run:
511+
command: npx nyc report --check-coverage true --lines 100
512+
working_directory: examples/all-files
513+
- run:
514+
name: Check code coverage 📈
515+
# we will check the final coverage report
516+
# to make sure it only has files we are interested in
517+
# because there are files covered at 0 in the report
518+
command: |
519+
../../node_modules/.bin/check-coverage main.js
520+
../../node_modules/.bin/check-coverage second.js
521+
../../node_modules/.bin/check-coverage not-covered.js
522+
../../node_modules/.bin/only-covered --from coverage/coverage-final.json main.js second.js not-covered.js
523+
working_directory: examples/all-files
524+
487525
- publish:
488526
filters:
489527
branches:
@@ -506,3 +544,4 @@ workflows:
506544
- example-docker-paths
507545
- example-use-webpack
508546
- example-all-files
547+
- Windows test

examples/all-files/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"description": "Report all files",
44
"scripts": {
55
"start": "../../node_modules/.bin/parcel serve index.html",
6+
"start:windows": "npx bin-up parcel serve index.html",
67
"cy:open": "../../node_modules/.bin/cypress open",
78
"cy:run": "../../node_modules/.bin/cypress run",
89
"dev": "../../node_modules/.bin/start-test 1234 cy:open",

0 commit comments

Comments
 (0)