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