Skip to content

Commit 1bbc720

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

File tree

4 files changed

+90
-72
lines changed

4 files changed

+90
-72
lines changed

.github/workflows/ci.yml

+85-11
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,33 @@ 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+
- run: pnpm install --frozen-lockfile --prefer-offline
39+
env:
40+
HUSKY: '0' # By default do not run HUSKY install
2241

2342
lint:
2443
name: lint
@@ -30,8 +49,20 @@ jobs:
3049
- uses: actions/setup-node@v3
3150
with:
3251
node-version: "18.x"
33-
cache: 'pnpm'
34-
- run: pnpm install
52+
- name: Cache NPM and Cypress 📦
53+
uses: actions/cache@v3
54+
id: cache
55+
with:
56+
path: |
57+
${{ needs.cache.outputs.pnpm-cache }}
58+
~/.cache/Cypress
59+
key: ${{ needs.cache.outputs.key }}
60+
restore-keys: |
61+
${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
62+
${{ runner.os }}-pnpm-
63+
- run: pnpm install --frozen-lockfile --prefer-offline
64+
env:
65+
HUSKY: '0' # By default do not run HUSKY install
3566
- run: pnpm lint:ci
3667
- run: pnpm format:ci
3768

@@ -45,13 +76,32 @@ jobs:
4576
- uses: actions/setup-node@v3
4677
with:
4778
node-version: "18.x"
48-
cache: 'pnpm'
49-
- run: pnpm install && cd ./examples/webpack && pnpm cypress install
79+
- name: Cache NPM and Cypress 📦
80+
uses: actions/cache@v3
81+
id: cache
82+
with:
83+
path: |
84+
${{ needs.cache.outputs.pnpm-cache }}
85+
~/.cache/Cypress
86+
key: ${{ needs.cache.outputs.key }}
87+
restore-keys: |
88+
${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
89+
${{ runner.os }}-pnpm-
90+
- run: pnpm install --frozen-lockfile --prefer-offline
91+
env:
92+
HUSKY: '0' # By default do not run HUSKY install
5093
- run: pnpm --filter cypress-plugin-visual-regression-diff -r build
5194
- name: Test e2e
5295
run: pnpm test:e2e:ci
5396
- name: Test component-testing
5497
run: pnpm test:ct:ci
98+
- uses: actions/upload-artifact@v3
99+
with:
100+
name: test
101+
path: |
102+
examples/next/**/*.png
103+
examples/next/**/*.jpg
104+
examples/next/**/*.jpeg
55105
56106
test-integration-coverage:
57107
name: test-integration-coverage
@@ -63,8 +113,20 @@ jobs:
63113
- uses: actions/setup-node@v3
64114
with:
65115
node-version: "18.x"
66-
cache: 'pnpm'
67-
- run: pnpm install
116+
- name: Cache NPM and Cypress 📦
117+
uses: actions/cache@v3
118+
id: cache
119+
with:
120+
path: |
121+
${{ needs.cache.outputs.pnpm-cache }}
122+
~/.cache/Cypress
123+
key: ${{ needs.cache.outputs.key }}
124+
restore-keys: |
125+
${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
126+
${{ runner.os }}-pnpm-
127+
- run: pnpm install --frozen-lockfile --prefer-offline
128+
env:
129+
HUSKY: '0' # By default do not run HUSKY install
68130
- name: Test integration (with coverage) and upload to CodeClimate
69131
if: ${{ github.ref == 'refs/heads/main' }}
70132
uses: paambaati/[email protected]
@@ -100,18 +162,30 @@ jobs:
100162
build-and-release:
101163
name: build and release
102164
runs-on: ubuntu-latest
103-
needs: prepare-release
165+
needs: [cache, prepare-release]
104166
if: needs.prepare-release.outputs.releases_created
105167
steps:
106168
- uses: actions/checkout@v3
107169
- uses: pnpm/[email protected]
108170
- uses: actions/setup-node@v3
109171
with:
110172
node-version: "18.x"
111-
cache: 'pnpm'
112173
registry-url: 'https://registry.npmjs.org'
113174
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
114-
- run: pnpm install
175+
- name: Cache NPM and Cypress 📦
176+
uses: actions/cache@v3
177+
id: cache
178+
with:
179+
path: |
180+
${{ needs.cache.outputs.pnpm-cache }}
181+
~/.cache/Cypress
182+
key: ${{ needs.cache.outputs.key }}
183+
restore-keys: |
184+
${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }}
185+
${{ runner.os }}-pnpm-
186+
- run: pnpm install --frozen-lockfile --prefer-offline
187+
env:
188+
HUSKY: '0' # By default do not run HUSKY install
115189
- name: Build packages to get cross-references working 🔧
116190
run: pnpm build
117191
- 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)