@@ -11,14 +11,33 @@ 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
+ - run : pnpm install --frozen-lockfile --prefer-offline
39
+ env :
40
+ HUSKY : ' 0' # By default do not run HUSKY install
22
41
23
42
lint :
24
43
name : lint
30
49
- uses : actions/setup-node@v3
31
50
with :
32
51
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
35
66
- run : pnpm lint:ci
36
67
- run : pnpm format:ci
37
68
@@ -45,13 +76,32 @@ jobs:
45
76
- uses : actions/setup-node@v3
46
77
with :
47
78
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
50
93
- run : pnpm --filter cypress-plugin-visual-regression-diff -r build
51
94
- name : Test e2e
52
95
run : pnpm test:e2e:ci
53
96
- name : Test component-testing
54
97
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
55
105
56
106
test-integration-coverage :
57
107
name : test-integration-coverage
@@ -63,8 +113,20 @@ jobs:
63
113
- uses : actions/setup-node@v3
64
114
with :
65
115
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
68
130
- name : Test integration (with coverage) and upload to CodeClimate
69
131
if : ${{ github.ref == 'refs/heads/main' }}
70
132
@@ -100,18 +162,30 @@ jobs:
100
162
build-and-release :
101
163
name : build and release
102
164
runs-on : ubuntu-latest
103
- needs : prepare-release
165
+ needs : [cache, prepare-release]
104
166
if : needs.prepare-release.outputs.releases_created
105
167
steps :
106
168
- uses : actions/checkout@v3
107
169
108
170
- uses : actions/setup-node@v3
109
171
with :
110
172
node-version : " 18.x"
111
- cache : ' pnpm'
112
173
registry-url : ' https://registry.npmjs.org'
113
174
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
115
189
- name : Build packages to get cross-references working 🔧
116
190
run : pnpm build
117
191
- name : Release package
0 commit comments