@@ -11,176 +11,111 @@ jobs:
11
11
cache :
12
12
name : CI cache
13
13
runs-on : ubuntu-latest
14
- outputs :
15
- yarn-cache-key : ${{ steps.yarn-cache-key.outputs.key }}
16
14
steps :
17
15
- uses : actions/checkout@v3
16
+ - uses : pnpm/action-setup@v2.2.4
18
17
- uses : actions/setup-node@v3
19
18
with :
20
19
node-version : " 18.x"
21
- - name : Remove git auth
22
- run : git config --unset http.https://github.com/.extraheader
23
- - name : Generate yarn cache-key
24
- id : yarn-cache-key
25
- run : echo "::set-output name=key::${{ runner.os }}-yarn-ci-cache-v3-${{ hashFiles('./yarn.lock') }}-${{ hashFiles('**/yarn.lock') }}"
26
- - name : Configure Yarn cache
27
- uses : actions/cache@v3
28
- with :
29
- key : ${{ steps.yarn-cache-key.outputs.key }}
30
- path : |
31
- ~/.cache/Cypress
32
- .yarn
33
- node_modules
34
- example/node_modules
35
- - name : Install dependencies
36
- if : ${{ github.actor != 'dependabot[bot]' || github.ref == 'refs/heads/main' }}
37
- run : yarn --immutable
38
- - name : Reset yarn.lock (due to dependabot incompatibility with yarn 3)
39
- if : ${{ github.actor == 'dependabot[bot]' && github.ref != 'refs/heads/main' }}
40
- run : " git checkout HEAD~1 yarn.lock"
41
- - name : Install dependencies & update yarn.lock (dependabot)
42
- if : ${{ github.actor == 'dependabot[bot]' && github.ref != 'refs/heads/main' }}
43
- run : " yarn install && git stage yarn.lock && git commit -m 'chore: update yarn.lock' && git push"
44
- env :
45
- YARN_ENABLE_IMMUTABLE_INSTALLS : false
20
+ cache : ' pnpm'
21
+ - run : pnpm install
46
22
47
23
lint :
48
24
name : lint
49
25
runs-on : ubuntu-latest
50
26
needs : cache
51
27
steps :
52
28
- uses : actions/checkout@v3
29
+ - uses : pnpm/action-setup@v2.2.4
53
30
- uses : actions/setup-node@v3
54
31
with :
55
32
node-version : " 18.x"
56
- - name : remove git auth
57
- run : git config --unset http.https://github.com/.extraheader
58
- - name : Configure Yarn cache
59
- uses : actions/cache@v3
60
- with :
61
- key : ${{ needs.cache.outputs.yarn-cache-key }}
62
- path : |
63
- ~/.cache/Cypress
64
- .yarn
65
- node_modules
66
- example/node_modules
67
- - name : Install dependencies
68
- run : yarn --immutable
69
- - name : Lint
70
- run : yarn lint:ci
71
- - name : Prettify
72
- run : yarn prettify:ci
33
+ cache : ' pnpm'
34
+ - run : pnpm install
35
+ - run : pnpm lint:ci
36
+ - run : pnpm format:ci
73
37
74
38
test :
75
39
name : test
76
40
runs-on : ubuntu-latest
77
41
needs : cache
78
42
steps :
79
43
- uses : actions/checkout@v3
44
+ - uses : pnpm/action-setup@v2.2.4
80
45
- uses : actions/setup-node@v3
81
46
with :
82
47
node-version : " 18.x"
83
- - name : remove git auth
84
- run : git config --unset http.https://github.com/.extraheader
85
- - name : Configure Yarn cache
86
- uses : actions/cache@v3
87
- with :
88
- key : ${{ needs.cache.outputs.yarn-cache-key }}
89
- path : |
90
- ~/.cache/Cypress
91
- .yarn
92
- node_modules
93
- example/node_modules
94
- - name : Install dependencies
95
- run : yarn --immutable
96
- - name : Build plugin
97
- run : yarn build
98
- - name : Install example dependencies
99
- run : cd example && yarn --immutable
48
+ cache : ' pnpm'
49
+ - run : pnpm install && cd ./examples/webpack && pnpm cypress install
50
+ - run : pnpm --filter cypress-plugin-visual-regression-diff -r build
100
51
- name : Test e2e
101
- run : yarn test:e2e:ci
52
+ run : pnpm test:e2e:ci
102
53
- name : Test component-testing
103
- run : yarn test:ct:ci
54
+ run : pnpm test:ct:ci
104
55
105
56
test-integration-coverage :
106
57
name : test-integration-coverage
107
58
runs-on : ubuntu-latest
108
59
needs : cache
109
60
steps :
110
61
- uses : actions/checkout@v3
62
+ - uses : pnpm/action-setup@v2.2.4
111
63
- uses : actions/setup-node@v3
112
64
with :
113
65
node-version : " 18.x"
114
- - name : remove git auth
115
- run : git config --unset http.https://github.com/.extraheader
116
- - name : Configure Yarn cache
117
- uses : actions/cache@v3
118
- with :
119
- key : ${{ needs.cache.outputs.yarn-cache-key }}
120
- path : |
121
- ~/.cache/Cypress
122
- .yarn
123
- node_modules
124
- example/node_modules
125
- - name : Install dependencies
126
- run : yarn --immutable
66
+ cache : ' pnpm'
67
+ - run : pnpm install
127
68
- name : Test integration (with coverage) and upload to CodeClimate
128
69
if : ${{ github.ref == 'refs/heads/main' }}
129
70
uses : paambaati/codeclimate-action@v4.0.0
130
71
env :
131
72
CC_TEST_REPORTER_ID : ${{ secrets.CC_TEST_REPORTER_ID }}
132
73
with :
133
74
debug : true
134
- coverageCommand : yarn test:integration:ci
75
+ coverageCommand : pnpm test:integration:ci
135
76
coverageLocations : |
136
- ${{github.workspace}}/coverage/lcov.info:lcov
77
+ ${{github.workspace}}/packages/*/ coverage/lcov.info:lcov
137
78
- name : Test integration (with coverage)
138
79
if : ${{ github.ref != 'refs/heads/main' }}
139
- run : yarn test:integration:ci
80
+ run : pnpm test:integration:ci
140
81
141
- build-and -release :
142
- name : build and release
82
+ prepare -release :
83
+ name : detect changes, bump package versions, generate changelog and commit it to main branch
143
84
runs-on : ubuntu-latest
144
85
needs : [cache, lint, test, test-integration-coverage]
145
86
if : ${{ github.actor != 'dependabot[bot]' && github.ref == 'refs/heads/main' && github.event_name == 'push' }}
87
+ permissions :
88
+ contents : write
89
+ pull-requests : write
90
+ outputs :
91
+ releases_created : ${{ steps.release.outputs.releases_created }}
146
92
steps :
147
- - uses : actions/checkout@v3
93
+ - uses : google-github-actions/release-please-action@v3.7.9
94
+ id : release
148
95
with :
149
- # pulls all commits (needed for lerna / semantic release to correctly version)
150
- fetch-depth : " 0"
151
- - name : Setup git user
152
- run : |
153
- git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
154
- git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
96
+ command : manifest
97
+ default-branch : main
98
+
99
+ build-and-release :
100
+ name : build and release
101
+ runs-on : ubuntu-latest
102
+ needs : prepare-release
103
+ if : needs.prepare-release.outputs.releases_created
104
+ steps :
105
+ - uses : actions/checkout@v3
106
+ - uses : pnpm/action-setup@v2.2.4
155
107
- uses : actions/setup-node@v3
156
108
with :
157
109
node-version : " 18.x"
158
- - name : remove git auth
159
- run : git config --unset http.https://github.com/.extraheader
160
- - name : Configure Yarn cache
161
- uses : actions/cache@v3
162
- with :
163
- key : ${{ needs.cache.outputs.yarn-cache-key }}
164
- path : |
165
- ~/.cache/Cypress
166
- .yarn
167
- node_modules
168
- example/node_modules
169
- - name : Install dependencies
170
- run : yarn --immutable
171
- - name : Authenticate with Registry
172
- run : |
173
- yarn npm logout
174
- echo "registry=http://registry.npmjs.org/" >> .npmrc
175
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
176
- npm whoami
177
- env :
110
+ cache : ' pnpm'
111
+ registry-url : ' https://registry.npmjs.org'
178
112
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
179
- - name : release package
180
- if : ${{ success() }}
181
- run : yarn release:ci
113
+ - run : pnpm install
114
+ - name : Build packages to get cross-references working 🔧
115
+ run : pnpm build
116
+ - name : Release package
117
+ run : pnpm publish -r
182
118
env :
183
119
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
184
- NPM_CONFIG_REGISTRY : https://registry.npmjs.org/
185
120
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
186
121
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments