1
1
name : Test-all
2
- run-name : All tests with extension build ${{ inputs.CLIENTS_BRANCH }} by @${{ github.actor }}
2
+ run-name : All tests with extension build ${{ inputs.CLIENTS_BRANCH || github.event.client_payload.origin_branch }} by @${{ github.actor }}
3
3
on :
4
4
push :
5
5
branches :
6
6
- " main"
7
+ repository_dispatch :
8
+ types : [trigger-bit-tests]
7
9
pull_request :
8
10
workflow_dispatch :
9
11
inputs :
24
26
id-token : write
25
27
contents : read
26
28
packages : read
29
+ pull-requests : write
27
30
steps :
28
31
- name : Checkout
29
32
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
64
67
github_token : ${{ secrets.GITHUB_TOKEN }}
65
68
workflow : build-browser.yml
66
69
workflow_conclusion : " "
67
- branch : ${{ inputs.CLIENTS_BRANCH || 'main' }}
70
+ branch : ${{ github.event.client_payload.origin_branch || inputs.CLIENTS_BRANCH || 'main' }}
68
71
name : ^dist-chrome-MV3-\w{7}\.zip$
69
72
name_is_regexp : true
70
73
repo : bitwarden/clients
@@ -129,14 +132,15 @@ jobs:
129
132
npm ci
130
133
131
134
- name : Run all tests
135
+ id : playwright-tests
132
136
run : npm run test:static:ci
133
137
134
138
- name : Update job summary
135
139
if : always()
136
140
run : echo "$(<./test-summary/test-summary.md)" >> $GITHUB_STEP_SUMMARY
137
141
138
142
- name : Upload results as artifact
139
- uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
143
+ uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
140
144
if : always()
141
145
with :
142
146
name : test-summary
@@ -145,3 +149,49 @@ jobs:
145
149
./test-summary
146
150
./tests-out/videos
147
151
./tests-out/screenshots
152
+
153
+ - name : Communicate BIT success on originating issue
154
+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
155
+ if : failure() && github.event.client_payload.origin_issue
156
+ with :
157
+ github-token : ${{ secrets.CROSS_REPO_TOKEN }}
158
+ script : |
159
+ const owner = 'bitwarden';
160
+ const message = `⚠️ **Files have been modified in this PR that impact the Autofill experience** ⚠️
161
+
162
+ [BIT](https://github.com/${owner}/browser-interactions-testing) was run to verify no regressions have been introduced to the core Autofill experience.
163
+
164
+ ❌ Unfortunately, one or more of the BIT tests failed. 😞
165
+
166
+ Please resolve the failure before merging; reach out to `@bitwarden/team-autofill-dev` if you need help.
167
+
168
+ You can view the detailed results of the tests [here](https://github.com/${owner}/browser-interactions-testing/actions/runs/${context.runId}).`;
169
+
170
+ github.rest.issues.createComment({
171
+ issue_number: context.payload.client_payload.origin_issue,
172
+ owner: owner,
173
+ repo: 'clients',
174
+ body: message
175
+ });
176
+
177
+ - name : Communicate BIT failure on originating issue
178
+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
179
+ if : success() && github.event.client_payload.origin_issue
180
+ with :
181
+ github-token : ${{ secrets.CROSS_REPO_TOKEN }}
182
+ script : |
183
+ const owner = 'bitwarden';
184
+ const message = `⚠️ **Files have been modified in this PR that impact the Autofill experience** ⚠️
185
+
186
+ [BIT](https://github.com/${owner}/browser-interactions-testing) was run to verify no regressions have been introduced to the core Autofill experience.
187
+
188
+ ✅ Fortunately, the BIT tests have passed! 🎉
189
+
190
+ You can view the detailed results of the tests [here](https://github.com/${owner}/browser-interactions-testing/actions/runs/${context.runId}).`;
191
+
192
+ github.rest.issues.createComment({
193
+ issue_number: context.payload.client_payload.origin_issue,
194
+ owner: owner,
195
+ repo: 'clients',
196
+ body: message
197
+ });
0 commit comments