@@ -11,14 +11,34 @@ jobs:
11
11
cache :
12
12
name : CI cache
13
13
runs-on : ubuntu-latest
14
+ outputs :
15
+ pnpm-cache : ${{ steps.vars.outputs.pnpm-cache }}
16
+ key : ${{ steps.vars.outputs.key }}
14
17
steps :
15
18
- uses : actions/checkout@v3
16
19
17
20
- uses : actions/setup-node@v3
18
21
with :
19
22
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
22
42
23
43
lint :
24
44
name : lint
30
50
- uses : actions/setup-node@v3
31
51
with :
32
52
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
35
68
- run : pnpm lint:ci
36
69
- run : pnpm format:ci
37
70
@@ -45,13 +78,33 @@ jobs:
45
78
- uses : actions/setup-node@v3
46
79
with :
47
80
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
50
96
- run : pnpm --filter cypress-plugin-visual-regression-diff -r build
51
97
- name : Test e2e
52
98
run : pnpm test:e2e:ci
53
99
- name : Test component-testing
54
100
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
55
108
56
109
test-integration-coverage :
57
110
name : test-integration-coverage
@@ -63,8 +116,21 @@ jobs:
63
116
- uses : actions/setup-node@v3
64
117
with :
65
118
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
68
134
- name : Test integration (with coverage) and upload to CodeClimate
69
135
if : ${{ github.ref == 'refs/heads/main' }}
70
136
@@ -100,18 +166,31 @@ jobs:
100
166
build-and-release :
101
167
name : build and release
102
168
runs-on : ubuntu-latest
103
- needs : prepare-release
169
+ needs : [cache, prepare-release]
104
170
if : needs.prepare-release.outputs.releases_created
105
171
steps :
106
172
- uses : actions/checkout@v3
107
173
108
174
- uses : actions/setup-node@v3
109
175
with :
110
176
node-version : " 18.x"
111
- cache : ' pnpm'
112
177
registry-url : ' https://registry.npmjs.org'
113
178
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
115
194
- name : Build packages to get cross-references working 🔧
116
195
run : pnpm build
117
196
- name : Release package
0 commit comments