Skip to content

chore: adding CI test on Windows #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# https://circleci.com/docs/2.0/configuration-reference/
version: 2.1
orbs:
cypress: cypress-io/[email protected] # used to run e2e tests
# https://github.com/cypress-io/circleci-orb
cypress: cypress-io/[email protected] # used to run e2e tests
node: circleci/[email protected] # used to publish new NPM version
win: circleci/windows@2 # run a test job on Windows

jobs:
unit:
Expand Down Expand Up @@ -484,6 +486,42 @@ workflows:
../../node_modules/.bin/only-covered main.js
working_directory: examples/one-spec

- cypress/run:
name: Windows test
executor:
# executor comes from the "windows" orb
name: win/default
shell: bash.exe
no-workspace: true
start: npm run start:windows --prefix examples/all-files
wait-on: 'http://localhost:1234'
command: npx cypress run --project examples/all-files
# store screenshots and videos
store_artifacts: true
post-steps:
- run: cat examples/all-files/.nyc_output/out.json
- run: cat examples/all-files/coverage/coverage-final.json
# store the created coverage report folder
# you can click on it in the CircleCI UI
# to see live static HTML site
- store_artifacts:
path: examples/all-files/coverage
# make sure the examples captures 100% of code
- run:
command: npx nyc report --check-coverage true --lines 100
working_directory: examples/all-files
- run:
name: Check code coverage 📈
# we will check the final coverage report
# to make sure it only has files we are interested in
# because there are files covered at 0 in the report
command: |
../../node_modules/.bin/check-coverage main.js
../../node_modules/.bin/check-coverage second.js
../../node_modules/.bin/check-coverage not-covered.js
../../node_modules/.bin/only-covered --from coverage/coverage-final.json main.js second.js not-covered.js
working_directory: examples/all-files

- publish:
filters:
branches:
Expand All @@ -506,3 +544,4 @@ workflows:
- example-docker-paths
- example-use-webpack
- example-all-files
- Windows test
1 change: 1 addition & 0 deletions examples/all-files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"description": "Report all files",
"scripts": {
"start": "../../node_modules/.bin/parcel serve index.html",
"start:windows": "npx bin-up parcel serve index.html",
"cy:open": "../../node_modules/.bin/cypress open",
"cy:run": "../../node_modules/.bin/cypress run",
"dev": "../../node_modules/.bin/start-test 1234 cy:open",
Expand Down