Skip to content

Commit 91d92d2

Browse files
committed
feat(video): add audits recording litemode option
1 parent 1a0c776 commit 91d92d2

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

.github/workflows/action.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ jobs:
1818
TLD: true
1919
LIST: true
2020
UPGRADE: true
21+
RECORD: /recordings

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ When running locally the action uses A11yWatch Lite.
2121
LIST: true
2222
FIX: false
2323
UPGRADE: false
24+
RECORD: false
2425
COMPUTER_VISION_SUBSCRIPTION_KEY: ${{ secrets.COMPUTER_VISION_SUBSCRIPTION_KEY }}
2526
COMPUTER_VISION_ENDPOINT: ${{ secrets.COMPUTER_VISION_ENDPOINT }}
2627
```
@@ -38,6 +39,7 @@ All inputs are **optional** except $WEBSITE_URL.
3839
| `SITEMAP` | Extend crawl with sitemap links (required SITE_WIDE=true). | true |
3940
| `TLD` | Include all tld extensions (required SITE_WIDE=true). | true |
4041
| `LIST` | Report the results to github as a pass or fail list or detailed report. | false |
42+
| `RECORD` | Record the audit as video to a directory. | |
4143
| `FAIL_TOTAL_COUNT` | Determine whether to fail the CI if total issues warnings and errors exceed the counter. Takes precedence over the other FAIL inputs. | 0 |
4244
| `FAIL_ERRORS_COUNT` | Determine whether to fail the CI if total issues with errors exceed the counter. | 0 |
4345
| `FAIL_WARNINGS_COUNT` | Determine whether to fail the CI if total issues with warnings exceed the counter. | 0 |

action.yml

+42-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ inputs:
3737
description: Include all TLD extensions.
3838
required: false
3939
default: false
40+
RECORD:
41+
description: Enable video recording audits to a directory location.
42+
required: false
43+
default: ""
4044
FAIL_TOTAL_COUNT:
4145
description: Use to fail the CI if the amount of issues of type errors and warnings is greater than the count.
4246
required: false
@@ -108,6 +112,15 @@ runs:
108112
restore-keys: |
109113
${{ runner.os }}-yarn-
110114
115+
- name: Cache playwright binaries
116+
if: ${{ inputs.EXTERNAL == 'false' }}
117+
uses: actions/cache@v3
118+
id: playwright-cache
119+
with:
120+
path: |
121+
~/.cache/ms-playwright
122+
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
123+
111124
- name: Cache cargo crates
112125
uses: actions/cache@v3
113126
id: cache-cargo
@@ -135,15 +148,15 @@ runs:
135148
uses: baptiste0928/cargo-install@v1
136149
with:
137150
crate: a11ywatch_cli
138-
version: "0.10.4"
151+
version: "0.10.7"
139152
features: "grpc"
140153

141154
- name: A11yWatch CLI Install
142155
if: ${{ inputs.SLIM == 'false' }}
143156
uses: baptiste0928/cargo-install@v1
144157
with:
145158
crate: a11ywatch_cli
146-
version: "0.10.4"
159+
version: "0.10.7"
147160

148161
- name: Configure CLI creds
149162
if: ${{ inputs.A11YWATCH_TOKEN }}
@@ -160,11 +173,32 @@ runs:
160173
shell: bash
161174
run: a11ywatch --set-cv-url ${{ inputs.COMPUTER_VISION_ENDPOINT }}
162175

176+
- name: Configure Recording
177+
if: ${{ inputs.RECORD }}
178+
shell: bash
179+
run: a11ywatch --set-recording ${{ inputs.RECORD && inputs.RECORD != 'true' && inputs.RECORD || '/recordings' }}
180+
181+
- name: Configure Recording
182+
if: ${{ inputs.RECORD }}
183+
shell: bash
184+
run: a11ywatch --set-recording ${{ inputs.RECORD }}
185+
186+
- uses: FedericoCarboni/setup-ffmpeg@v2
187+
if: ${{ inputs.RECORD && inputs.RECORD != 'false' }}
188+
163189
- name: Build A11yWatch Service
164190
if: ${{ inputs.EXTERNAL == 'false' }}
165191
shell: bash
166192
run: a11ywatch build --standalone --local ${{ inputs.UPGRADE == 'true' && '--upgrade' || '' }}
167193

194+
- run: npx playwright install --with-deps
195+
if: ${{ inputs.EXTERNAL == 'false' && steps.playwright-cache.outputs.cache-hit != 'true' }}
196+
shell: bash
197+
198+
- run: npx playwright install-deps
199+
if: ${{ inputs.EXTERNAL == 'false' && steps.playwright-cache.outputs.cache-hit != 'true' }}
200+
shell: bash
201+
168202
- name: Start A11yWatch Service
169203
if: ${{ inputs.EXTERNAL == 'false' }}
170204
shell: bash
@@ -273,6 +307,12 @@ runs:
273307
message: "fix(accessibility): add recommendations from scan"
274308
committer_name: GitHub Actions
275309

310+
- uses: actions/upload-artifact@v3
311+
if: ${{ inputs.RECORD && inputs.RECORD != 'false' && failure() || success() }}
312+
with:
313+
name: Recordings
314+
path: ${{ inputs.RECORD && inputs.RECORD != 'false' && inputs.RECORD || '/recordings' }}
315+
276316
- name: Stop A11yWatch Service
277317
if: ${{ !inputs.EXTERNAL }}
278318
shell: bash

0 commit comments

Comments
 (0)