Skip to content

Commit 6d9ce8a

Browse files
committed
feat(video): add audits recording litemode option (#47)
* feat(video): add audits recording litemode option * chore(cli): fix recording env
1 parent 1a0c776 commit 6d9ce8a

File tree

3 files changed

+56
-52
lines changed

3 files changed

+56
-52
lines changed

.github/workflows/action.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ jobs:
1010
uses: ./
1111
with:
1212
WEBSITE_URL: https://a11ywatch.com
13-
FAIL_TOTAL_COUNT: 10
13+
FAIL_TOTAL_COUNT: 100
1414
EXTERNAL: false
1515
SITE_WIDE: true
1616
SITEMAP: true
1717
SUBDOMAINS: true
1818
TLD: true
1919
LIST: true
2020
UPGRADE: true
21+
RECORD: recordings

README.md

+7-48
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: recordings
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 |
@@ -56,61 +58,18 @@ All inputs are **optional** except $WEBSITE_URL.
5658
| -------- | -------------------------- | ------- |
5759
| `issues` | The amount of issues found | |
5860

59-
## Benches
6061

61-
The hardware specs for results:
62+
## Performance
6263

63-
```sh
64-
----------------------
65-
linux ubuntu-latest
66-
2-core CPU
67-
7 GB of RAM memory
68-
14 GB of SSD disk space
69-
-----------------------
70-
```
71-
72-
### Benchmark Results
73-
74-
The results for crawling a website that is small - large.
75-
76-
#### crawl-speed
77-
78-
Test url: `https://a11ywatch.com`
79-
80-
25 pages
81-
82-
runs with 10 samples:
83-
84-
| | `libraries` |
85-
| :--------------------- | :--------------------- |
86-
| **`A11yWatch: crawl`** | `0.4 s` (✅ **1.00x**) |
87-
| **`Pa11y-CI: crawl`** | `45 s` (✅ **1.00x**) |
88-
| **`Axe: crawl`** | `N/A` (✅ **1.00x**) |
89-
90-
#### crawl-speed (Large Website)
91-
92-
Test url: `https://www.hbo.com`
93-
94-
7500 pages.
95-
96-
runs with 10 samples:
97-
98-
| | `libraries` |
99-
| :--------------------- | :------------------------ |
100-
| **`A11yWatch: crawl`** | `2.5 mins` (✅ **1.00x**) |
101-
| **`Pa11y-CI: crawl`** | `50+ hr` (✅ **1.00x**) |
102-
| **`Axe: crawl`** | `N/A` (✅ **1.00x**) |
103-
104-
### Benchmark Info
105-
106-
On a larger website A11yWatch action runs over 60x-10,000x+ faster depending on CPUs/hardware.
64+
On a larger website A11yWatch action runs over 60x-10,000x+ faster depending on CPUs/hardware. After the first installation you should have faster setup time between runs.
65+
You can expect to handle at least 1k pages per minute on a 2-core CPU 7 GB of RAM memory shared github action. If you enable `RECORD` the output time may increase a bit.
10766

10867
When `AI_DISABLED` is set to true the run for `A11yWatch` may increase.
10968

11069
## Common Issues
11170

112-
If you experience issues on your CI you may have to toggle the `UPGRADE` input to true in order to get the latest docker images.
113-
We need docker in order to build the appliciation in quickly since we have some services that need to compile that may take awhile.
71+
If you experience issues on your CI you may have to toggle the `UPGRADE` input to true in order to get the latest installs. If you see
72+
a playwright error try adding `PLAYWRIGHT_VERSION` env variable with the newest version to install chrome.
11473

11574
## CLI
11675

action.yml

+47-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author: A11yWatch
88
branding:
99
icon: "shield"
1010
color: "gray-dark"
11-
description: Powerful web accessibility testing.
11+
description: Fast and feature-packed web accessibility testing.
1212
inputs:
1313
WEBSITE_URL:
1414
description: Website domain to scan
@@ -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
@@ -85,6 +89,9 @@ outputs:
8589
issues:
8690
description: "The amount of issues found on the page"
8791
value: ${{ steps.a11ywatch-results-generator.outputs.issues }}
92+
recording_dir:
93+
description: "The directory that holds recordings of audits. Only enabled when inputs.RECORD is set."
94+
value: ${{ steps.a11ywatch-recordings-directory.outputs.recording_dir }}
8895
runs:
8996
using: composite
9097
steps:
@@ -108,6 +115,15 @@ runs:
108115
restore-keys: |
109116
${{ runner.os }}-yarn-
110117
118+
- name: Cache playwright binaries
119+
if: ${{ inputs.EXTERNAL == 'false' }}
120+
uses: actions/cache@v3
121+
id: playwright-cache
122+
with:
123+
path: |
124+
~/.cache/ms-playwright
125+
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
126+
111127
- name: Cache cargo crates
112128
uses: actions/cache@v3
113129
id: cache-cargo
@@ -135,15 +151,15 @@ runs:
135151
uses: baptiste0928/cargo-install@v1
136152
with:
137153
crate: a11ywatch_cli
138-
version: "0.10.4"
154+
version: "0.10.8"
139155
features: "grpc"
140156

141157
- name: A11yWatch CLI Install
142158
if: ${{ inputs.SLIM == 'false' }}
143159
uses: baptiste0928/cargo-install@v1
144160
with:
145161
crate: a11ywatch_cli
146-
version: "0.10.4"
162+
version: "0.10.8"
147163

148164
- name: Configure CLI creds
149165
if: ${{ inputs.A11YWATCH_TOKEN }}
@@ -160,11 +176,27 @@ runs:
160176
shell: bash
161177
run: a11ywatch --set-cv-url ${{ inputs.COMPUTER_VISION_ENDPOINT }}
162178

179+
- name: Configure Recording
180+
if: ${{ inputs.RECORD }}
181+
shell: bash
182+
run: a11ywatch --set-recording ${{ inputs.RECORD }}
183+
184+
- uses: FedericoCarboni/setup-ffmpeg@v2
185+
if: ${{ inputs.RECORD && inputs.RECORD != 'false' }}
186+
163187
- name: Build A11yWatch Service
164188
if: ${{ inputs.EXTERNAL == 'false' }}
165189
shell: bash
166190
run: a11ywatch build --standalone --local ${{ inputs.UPGRADE == 'true' && '--upgrade' || '' }}
167191

192+
- run: npx playwright install --with-deps
193+
if: ${{ inputs.EXTERNAL == 'false' && steps.playwright-cache.outputs.cache-hit != 'true' }}
194+
shell: bash
195+
196+
- run: npx playwright install-deps
197+
if: ${{ inputs.EXTERNAL == 'false' && steps.playwright-cache.outputs.cache-hit != 'true' }}
198+
shell: bash
199+
168200
- name: Start A11yWatch Service
169201
if: ${{ inputs.EXTERNAL == 'false' }}
170202
shell: bash
@@ -273,6 +305,18 @@ runs:
273305
message: "fix(accessibility): add recommendations from scan"
274306
committer_name: GitHub Actions
275307

308+
- name: Get recording directory
309+
id: a11ywatch-recordings-directory
310+
if: ${{ inputs.RECORD && inputs.RECORD != 'false' && failure() || success() }}
311+
shell: bash
312+
run: echo "recording_dir=$( echo "$(a11ywatch --find-tmp-dir)""$inputs.RECORD" )" >> $GITHUB_OUTPUT
313+
314+
- uses: actions/upload-artifact@v3
315+
if: ${{ inputs.RECORD && inputs.RECORD != 'false' && failure() || success() }}
316+
with:
317+
name: Recordings
318+
path: ${{ steps.a11ywatch-recordings-directory.outputs.recording_dir }}
319+
276320
- name: Stop A11yWatch Service
277321
if: ${{ !inputs.EXTERNAL }}
278322
shell: bash

0 commit comments

Comments
 (0)