Skip to content

Commit dfd31e4

Browse files
Merge branch 'master' into patch-1
2 parents 4cdb4da + e81963e commit dfd31e4

File tree

8 files changed

+270
-417
lines changed

8 files changed

+270
-417
lines changed

.circleci/config.yml

+71-77
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
version: 2.1
33
orbs:
44
# https://github.com/cypress-io/circleci-orb
5-
cypress: cypress-io/cypress@1.29.0 # used to run e2e tests
6-
win: circleci/windows@2 # run a test job on Windows
5+
cypress: cypress-io/cypress@3.0.0 # used to run e2e tests
6+
win: circleci/windows@5.0.0 # run a test job on Windows
77

88
jobs:
99
lint:
1010
description: Checks the code formatting
1111
docker:
12-
- image: cimg/node:16.9.1
12+
- image: cimg/node:16.16.0
1313
environment:
1414
# we don't need Cypress to check code styl
1515
CYPRESS_INSTALL_BINARY: '0'
@@ -20,11 +20,70 @@ jobs:
2020
name: Code style check 🧹
2121
command: npm run format:check
2222
- run: npm run check:markdown
23+
24+
install_and_persist:
25+
executor: cypress/default
26+
steps:
27+
- cypress/install
28+
- run:
29+
name: Install deps for test-apps/old-cypress-config
30+
command: npm ci
31+
working_directory: test-apps/old-cypress-config
32+
- run:
33+
name: Install deps for test-apps/new-cypress-config
34+
command: npm ci
35+
working_directory: test-apps/new-cypress-config
36+
- run: npm run check:markdown
37+
- persist_to_workspace:
38+
paths:
39+
- .cache/Cypress
40+
- project
41+
root: ~/
42+
43+
windows_test:
44+
executor:
45+
# executor comes from the "windows" orb
46+
name: win/default
47+
shell: bash.exe
48+
steps:
49+
- checkout
50+
- run:
51+
name: Install node 16
52+
command: nvm install 16.16.0
53+
- run:
54+
name: Use node 16
55+
command: nvm use 16.16.0
56+
- run:
57+
name: Install deps for code coverage
58+
command: npm ci
59+
- run:
60+
name: Install deps for test-apps/old-cypress-config
61+
command: npm ci
62+
working_directory: test-apps/old-cypress-config
63+
- cypress/run-tests:
64+
# no-workspace: true
65+
start-command: npm run start:windows --prefix test-apps/old-cypress-config/all-files
66+
# wait-on: 'http://localhost:1234'
67+
cypress-command: npx cypress run --project test-apps/old-cypress-config/all-files
68+
# store screenshots and videos
69+
# store_artifacts: true
70+
- run:
71+
# make sure the examples captures 100% of code
72+
name: Verify Code Coverage
73+
command: npm run coverage:verify
74+
working_directory: test-apps/old-cypress-config/all-files
75+
- run:
76+
name: Check code coverage files 📈
77+
# we will check the final coverage report
78+
# to make sure it only has files we are interested in
79+
# because there are files covered at 0 in the report
80+
command: npm i -D check-code-coverage && npm run coverage:check-files:windows
81+
working_directory: test-apps/old-cypress-config/all-files
2382

2483
publish:
2584
description: Publishes the new version of the plugin to NPM
2685
docker:
27-
- image: cimg/node:16.9.1
86+
- image: cimg/node:16.16.0
2887
environment:
2988
# we don't need Cypress to do the release
3089
CYPRESS_INSTALL_BINARY: '0'
@@ -40,7 +99,7 @@ jobs:
4099

41100
cyrun:
42101
docker:
43-
- image: cypress/base:16.13.2
102+
- image: cypress/base:16.18.1
44103
parameters:
45104
jobname:
46105
type: string
@@ -66,13 +125,10 @@ jobs:
66125

67126
test-code-coverage-plugin:
68127
docker:
69-
- image: cypress/base:16.13.2
128+
- image: cypress/base:16.18.1
70129
steps:
71130
- attach_workspace:
72131
at: ~/
73-
- run:
74-
name: Install deps
75-
command: npm ci
76132
- run:
77133
command: npm run test
78134
- store_artifacts:
@@ -84,34 +140,19 @@ jobs:
84140
workflows:
85141
build:
86142
jobs:
87-
- cypress/install:
88-
cache-key: 'cache-{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }}'
89-
pre-steps:
90-
- run: npm i -g npm@latest
91-
post-install:
92-
- run:
93-
name: Install deps for test-apps/old-cypress-config
94-
command: npm ci
95-
working_directory: test-apps/old-cypress-config
96-
- run:
97-
name: Install deps for test-apps/new-cypress-config
98-
command: npm ci
99-
working_directory: test-apps/new-cypress-config
100-
post-steps:
101-
- run: npm run check:markdown
102-
143+
- install_and_persist
103144
- lint:
104145
requires:
105-
- cypress/install
146+
- install_and_persist
106147

107148
- test-code-coverage-plugin:
108149
requires:
109-
- cypress/install
150+
- install_and_persist
110151

111152
- cyrun:
112153
name: test-<< matrix.jobname>>
113154
requires:
114-
- cypress/install
155+
- install_and_persist
115156
matrix:
116157
parameters:
117158
jobname:
@@ -142,54 +183,7 @@ workflows:
142183
- new-cypress-config/ts-example
143184
- new-cypress-config/unit-tests-js
144185
- new-cypress-config/use-webpack
145-
146-
- cypress/run:
147-
name: Windows test
148-
executor:
149-
# executor comes from the "windows" orb
150-
name: win/default
151-
shell: bash.exe
152-
no-workspace: true
153-
start: npm run start:windows --prefix test-apps/old-cypress-config/all-files
154-
wait-on: 'http://localhost:1234'
155-
command: npx cypress run --project test-apps/old-cypress-config/all-files
156-
# store screenshots and videos
157-
store_artifacts: true
158-
cache-key: 'cache-{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }}'
159-
post-checkout:
160-
- run:
161-
name: Install node 16
162-
command: nvm install 16.13.2
163-
- run:
164-
name: Use node 16
165-
command: nvm use 16.13.2
166-
- run:
167-
name: Install deps for code coverage
168-
command: npm ci
169-
post-install:
170-
- run:
171-
name: Install deps for test-apps/old-cypress-config
172-
command: npm ci
173-
working_directory: test-apps/old-cypress-config
174-
post-steps:
175-
# store the created coverage report folder
176-
# you can click on it in the CircleCI UI
177-
# to see live static HTML site
178-
- store_artifacts:
179-
path: test-apps/old-cypress-config/all-files/coverage
180-
# make sure the examples captures 100% of code
181-
- run:
182-
name: Verify Code Coverage
183-
command: npm run coverage:verify
184-
working_directory: test-apps/old-cypress-config/all-files
185-
- run:
186-
name: Check code coverage files 📈
187-
# we will check the final coverage report
188-
# to make sure it only has files we are interested in
189-
# because there are files covered at 0 in the report
190-
command: npm i -D check-code-coverage && npm run coverage:check-files:windows
191-
working_directory: test-apps/old-cypress-config/all-files
192-
186+
- windows_test
193187
- publish:
194188
filters:
195189
branches:
@@ -228,4 +222,4 @@ workflows:
228222
- test-new-cypress-config/ts-example
229223
- test-new-cypress-config/unit-tests-js
230224
- test-new-cypress-config/use-webpack
231-
- Windows test
225+
- windows_test
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: 'Add issue/PR to Triage Board'
2+
on:
3+
issues:
4+
types:
5+
- opened
6+
pull_request_target:
7+
types:
8+
- opened
9+
jobs:
10+
add-to-triage-project-board:
11+
uses: cypress-io/cypress/.github/workflows/triage_add_to_project.yml@develop
12+
secrets: inherit

.github/workflows/snyk_sca_scan.yaml

+10-18
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
name: Snyk Software Composition Analysis Scan
2-
# This git workflow leverages Snyk actions to perform a Software Composition
3-
# Analysis scan on our Opensource libraries upon Pull Requests to Master &
4-
# Develop branches. We use this as a control to prevent vulnerable packages
5-
# from being introduced into the codebase.
62
on:
7-
pull_request_target:
8-
types:
9-
- opened
10-
branches:
3+
pull_request:
4+
branches:
115
- master
126
- develop
137
jobs:
@@ -17,17 +11,15 @@ jobs:
1711
matrix:
1812
node-version: [16.x]
1913
steps:
20-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
2115
- name: Setting up Node
22-
uses: actions/setup-node@v1
16+
#- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v3
2318
with:
2419
node-version: ${{ matrix.node-version }}
25-
- name: Installing snyk-delta and dependencies
26-
run: npm i -g snyk-delta
27-
- uses: snyk/actions/setup@master
28-
- name: Perform SCA Scan
29-
continue-on-error: false
30-
run: |
31-
snyk test --all-projects --detection-depth=4 --exclude=docker,Dockerfile --severity-threshold=critical
20+
- name: Run Snyk to check for opensource vulnerabilities
21+
uses: snyk/actions/node@master
3222
env:
33-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
23+
SNYK_TOKEN: ${{ secrets.SNYK_API_TOKEN }}
24+
with:
25+
args: --all-projects --strict-out-of-sync=false --detection-depth=6 --exclude=docker,Dockerfile --severity-threshold=critical
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,19 @@
11
name: Snyk Static Analysis Scan
2-
# This git workflow leverages Snyk actions to perform a Static Application
3-
# Testing scan (SAST) on our first-party code upon Pull Requests to Master &
4-
# Develop branches. We use this as a control to prevent vulnerabilities
5-
# from being introduced into the codebase.
2+
# This SAST (Static Application Security Testing) scan is used to scan
3+
# our first-party code for security vulnerabilities
64
on:
7-
pull_request_target:
8-
types:
9-
- opened
10-
branches:
5+
pull_request:
6+
branches:
117
- master
128
- develop
139
jobs:
14-
Snyk_SAST_Scan :
10+
Snyk_SAST_Scan:
1511
runs-on: ubuntu-latest
1612
steps:
17-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1814
- uses: snyk/actions/setup@master
1915
- name: Perform Static Analysis Test
20-
continue-on-error: true
21-
run: |
22-
snyk code test --all-projects --detection-depth=4 --exclude=docker,Dockerfile --severity-threshold=high
2316
env:
24-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
25-
# The Following Requires Advanced Security License
26-
# - name: Upload results to Github Code Scanning
27-
# uses: github/codeql-action/upload-sarif@v1
28-
# with:
29-
# sarif_file: snyk_sarif
17+
SNYK_TOKEN: ${{ secrets.SNYK_API_TOKEN }}
18+
continue-on-error: true
19+
run: snyk code test --all-projects --strict-out-of-sync=false --detection-depth=6 --exclude=docker,Dockerfile --severity-threshold=high
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: 'Closed Issue Comment'
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
jobs:
7+
closed-issue-comment:
8+
uses: cypress-io/cypress/.github/workflows/triage_closed_issue_comment.yml@develop
9+
secrets: inherit

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ Full examples we use for testing in this repository:
413413
- [test-apps/fullstack](test-apps/new-cypress-config/fullstack) instruments and merges backend, e2e and unit test coverage into a single report
414414
- [test-apps/before-all-visit](test-apps/new-cypress-config/before-all-visit) checks if code coverage works when `cy.visit` is made once in the `before` hook
415415
- [test-apps/before-each-visit](test-apps/new-cypress-config/before-each-visit) checks if code coverage correctly keeps track of code when doing `cy.visit` before each test
416-
- [test-apps/one-spec.js](test-apps/new-cypress-config/one-spec.js) confirms that coverage is collected and filtered correctly if the user only executes a single Cypress test
416+
- [test-apps/one-spec](test-apps/new-cypress-config/one-spec) confirms that coverage is collected and filtered correctly if the user only executes a single Cypress test
417417
- [test-apps/ts-example](test-apps/new-cypress-config/ts-example) uses Babel + Parcel to instrument and serve TypeScript file
418418
- [test-apps/use-webpack](test-apps/new-cypress-config/use-webpack) shows Webpack build with source maps and Babel
419419
- [test-apps/unit-tests-js](test-apps/new-cypress-config/unit-tests-js) runs just the unit tests and reports code coverage (JavaScript source code)

0 commit comments

Comments
 (0)