Skip to content

Commit 1386acb

Browse files
committed
chore: test changes
Signed-off-by: Jakub Freisler <[email protected]>
1 parent 7aef7c2 commit 1386acb

File tree

4 files changed

+95
-72
lines changed

4 files changed

+95
-72
lines changed

.github/workflows/ci.yml

+90-11
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,34 @@ jobs:
1111
cache:
1212
name: CI cache
1313
runs-on: ubuntu-latest
14+
outputs:
15+
pnpm-cache: ${{ steps.vars.outputs.pnpm-cache }}
16+
key: ${{ steps.vars.outputs.key }}
1417
steps:
1518
- uses: actions/checkout@v3
1619
- uses: pnpm/[email protected]
1720
- uses: actions/setup-node@v3
1821
with:
1922
node-version: "18.x"
20-
cache: 'pnpm'
21-
- run: pnpm install
23+
- id: vars
24+
run: |
25+
echo "pnpm-cache=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
26+
echo "key=${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}" >> $GITHUB_OUTPUT
27+
- name: Cache NPM and Cypress 📦
28+
uses: actions/cache@v3
29+
id: cache
30+
with:
31+
path: |
32+
${{ steps.vars.outputs.pnpm-cache }}
33+
~/.cache/Cypress
34+
key: ${{ steps.vars.outputs.key }}
35+
restore-keys: |
36+
${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
37+
${{ runner.os }}-pnpm-
38+
- if: steps.cache.outputs.cache-hit != 'true'
39+
run: pnpm install --frozen-lockfile --prefer-offline
40+
env:
41+
HUSKY: '0' # By default do not run HUSKY install
2242

2343
lint:
2444
name: lint
@@ -30,8 +50,21 @@ jobs:
3050
- uses: actions/setup-node@v3
3151
with:
3252
node-version: "18.x"
33-
cache: 'pnpm'
34-
- run: pnpm install
53+
- name: Cache NPM and Cypress 📦
54+
uses: actions/cache@v3
55+
id: cache
56+
with:
57+
path: |
58+
${{ needs.cache.outputs.pnpm-cache }}
59+
~/.cache/Cypress
60+
key: ${{ needs.cache.outputs.key }}
61+
restore-keys: |
62+
${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
63+
${{ runner.os }}-pnpm-
64+
- if: steps.cache.outputs.cache-hit != 'true'
65+
run: pnpm install --frozen-lockfile --prefer-offline
66+
env:
67+
HUSKY: '0' # By default do not run HUSKY install
3568
- run: pnpm lint:ci
3669
- run: pnpm format:ci
3770

@@ -45,13 +78,33 @@ jobs:
4578
- uses: actions/setup-node@v3
4679
with:
4780
node-version: "18.x"
48-
cache: 'pnpm'
49-
- run: pnpm install && cd ./examples/webpack && pnpm cypress install
81+
- name: Cache NPM and Cypress 📦
82+
uses: actions/cache@v3
83+
id: cache
84+
with:
85+
path: |
86+
${{ needs.cache.outputs.pnpm-cache }}
87+
~/.cache/Cypress
88+
key: ${{ needs.cache.outputs.key }}
89+
restore-keys: |
90+
${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
91+
${{ runner.os }}-pnpm-
92+
- if: steps.cache.outputs.cache-hit != 'true'
93+
run: pnpm install --frozen-lockfile --prefer-offline
94+
env:
95+
HUSKY: '0' # By default do not run HUSKY install
5096
- run: pnpm --filter cypress-plugin-visual-regression-diff -r build
5197
- name: Test e2e
5298
run: pnpm test:e2e:ci
5399
- name: Test component-testing
54100
run: pnpm test:ct:ci
101+
- uses: actions/upload-artifact@v3
102+
with:
103+
name: test
104+
path: |
105+
examples/next/**/*.png
106+
examples/next/**/*.jpg
107+
examples/next/**/*.jpeg
55108
56109
test-integration-coverage:
57110
name: test-integration-coverage
@@ -63,8 +116,21 @@ jobs:
63116
- uses: actions/setup-node@v3
64117
with:
65118
node-version: "18.x"
66-
cache: 'pnpm'
67-
- run: pnpm install
119+
- name: Cache NPM and Cypress 📦
120+
uses: actions/cache@v3
121+
id: cache
122+
with:
123+
path: |
124+
${{ needs.cache.outputs.pnpm-cache }}
125+
~/.cache/Cypress
126+
key: ${{ needs.cache.outputs.key }}
127+
restore-keys: |
128+
${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
129+
${{ runner.os }}-pnpm-
130+
- if: steps.cache.outputs.cache-hit != 'true'
131+
run: pnpm install --frozen-lockfile --prefer-offline
132+
env:
133+
HUSKY: '0' # By default do not run HUSKY install
68134
- name: Test integration (with coverage) and upload to CodeClimate
69135
if: ${{ github.ref == 'refs/heads/main' }}
70136
uses: paambaati/[email protected]
@@ -100,18 +166,31 @@ jobs:
100166
build-and-release:
101167
name: build and release
102168
runs-on: ubuntu-latest
103-
needs: prepare-release
169+
needs: [cache, prepare-release]
104170
if: needs.prepare-release.outputs.releases_created
105171
steps:
106172
- uses: actions/checkout@v3
107173
- uses: pnpm/[email protected]
108174
- uses: actions/setup-node@v3
109175
with:
110176
node-version: "18.x"
111-
cache: 'pnpm'
112177
registry-url: 'https://registry.npmjs.org'
113178
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
114-
- run: pnpm install
179+
- name: Cache NPM and Cypress 📦
180+
uses: actions/cache@v3
181+
id: cache
182+
with:
183+
path: |
184+
${{ needs.cache.outputs.pnpm-cache }}
185+
~/.cache/Cypress
186+
key: ${{ needs.cache.outputs.key }}
187+
restore-keys: |
188+
${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
189+
${{ runner.os }}-pnpm-
190+
- if: steps.cache.outputs.cache-hit != 'true'
191+
run: pnpm install --frozen-lockfile --prefer-offline
192+
env:
193+
HUSKY: '0' # By default do not run HUSKY install
115194
- name: Build packages to get cross-references working 🔧
116195
run: pnpm build
117196
- name: Release package

examples/next/components/about-component.cy.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import AboutComponent from './about-component'
2-
/* eslint-disable */
32
// Disable ESLint to prevent failing linting inside the Next.js repo.
43
// If you're using ESLint on your project, we recommend installing the ESLint Cypress plugin instead:
54
// https://github.com/cypress-io/eslint-plugin-cypress

examples/next/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"dev": "next dev",
55
"build": "next build",
66
"start": "next start",
7-
"cypress": "cypress open --env \"pluginVisualRegressionImagesPath={spec_path}/__image_snapshots_local__\"",
8-
"cypress:ci": "cypress run --env \"pluginVisualRegressionImagesPath={spec_path}/__image_snapshots_local__\"",
7+
"cypress": "cypress open --env \"pluginVisualRegressionUpdateImages=true,pluginVisualRegressionImagesPath={spec_path}/__image_snapshots_local__\"",
8+
"cypress:ci": "cypress run --env \"pluginVisualRegressionUpdateImages=true\"",
99
"test:e2e": "start-server-and-test dev http://localhost:3000 \"pnpm cypress --e2e\"",
1010
"test:e2e:ci": "start-server-and-test dev http://localhost:3000 \"pnpm cypress:ci --e2e\"",
1111
"test:ct": "start-server-and-test dev http://localhost:3000 \"pnpm cypress --component\"",
@@ -21,7 +21,7 @@
2121
"@types/node": "18.0.6",
2222
"@types/react": "18.0.15",
2323
"@types/react-dom": "18.0.6",
24-
"cypress": "12.3.0",
24+
"cypress": "12.12.0",
2525
"start-server-and-test": "1.15.2",
2626
"typescript": "4.7.4"
2727
}

pnpm-lock.yaml

+2-57
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)