Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue #677]: Add accessibility checks against pr preview env #84

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
7d9f20c
initial commit
rylew1 Jul 2, 2024
94b95b2
add package.json targets
rylew1 Jul 2, 2024
e04c891
updates to workflow file
rylew1 Jul 2, 2024
26c864a
move files to app dir
rylew1 Jul 2, 2024
9a04a14
add targest to app dir package.json
rylew1 Jul 2, 2024
e54ff5a
update a11y workflow file
rylew1 Jul 2, 2024
8763389
call a11y tests from pr env update
rylew1 Jul 2, 2024
39f293c
fix shellcheck
rylew1 Jul 2, 2024
eba0a0f
save service endpoint to file
rylew1 Jul 2, 2024
2d56288
attempt shell fixes
rylew1 Jul 2, 2024
736ba34
bash shell and quoting
rylew1 Jul 2, 2024
4dac90a
format
rylew1 Jul 2, 2024
eb86f5b
update accessibility job
rylew1 Jul 2, 2024
ed93fa4
double quote fix
rylew1 Jul 3, 2024
4102734
add debug steps
rylew1 Jul 3, 2024
76f9a6e
debug service endpoint url
rylew1 Jul 3, 2024
08ebf2e
update
rylew1 Jul 3, 2024
59e3613
update url
rylew1 Jul 3, 2024
2a0c57c
cat updated config
rylew1 Jul 3, 2024
70f96f1
add outputs
rylew1 Jul 3, 2024
6da1354
add actionlint make target
rylew1 Jul 3, 2024
5977ac0
add env on a11y job
rylew1 Jul 3, 2024
60448cb
add back in comments
rylew1 Jul 3, 2024
abd3dc7
get-service-endpoint
rylew1 Jul 3, 2024
fc53114
revert GH_TOKEN
rylew1 Jul 3, 2024
479a56b
rename to accessibility-scans
rylew1 Jul 5, 2024
844de9c
split desktop / mobile into parallel jobs
rylew1 Jul 5, 2024
acf36b7
share var b/w jobs
rylew1 Jul 5, 2024
4e14352
install in each step
rylew1 Jul 5, 2024
9e95374
update service_endpoint reference
rylew1 Jul 6, 2024
7c0e855
screenshots output
rylew1 Jul 6, 2024
688e5f1
switch back to npm run
rylew1 Jul 6, 2024
10c3bc7
add npm ci back in
rylew1 Jul 6, 2024
bf873a4
screenshot output folder name
rylew1 Jul 6, 2024
1b4df3e
remove debug step
rylew1 Jul 6, 2024
1327465
revert app folder package.json
rylew1 Jul 6, 2024
2c058d7
update ci to use accessibility folder
rylew1 Jul 6, 2024
8dd3a47
move config to accessibility folder
rylew1 Jul 6, 2024
b86493c
remove setup step
rylew1 Jul 6, 2024
1f66a21
fix naming
rylew1 Jul 6, 2024
5e4fea4
remove gitignore space change
rylew1 Jul 8, 2024
9f29e2c
remove extra package.json
rylew1 Jul 9, 2024
d3cfce7
refactor json to js
rylew1 Jul 9, 2024
5984d53
try update config with node call
rylew1 Jul 9, 2024
75f364a
resolve path correctly
rylew1 Jul 9, 2024
f986fad
add update-config comments
rylew1 Jul 9, 2024
2ed792b
add explaining comments on pa11y config files
rylew1 Jul 9, 2024
8a27271
add missing bracket
rylew1 Jul 9, 2024
e172c18
add optional app_name param
rylew1 Jul 9, 2024
a1cbe57
try more universally applicable actions
rylew1 Jul 9, 2024
2dede8d
remove wait for document to be ready
rylew1 Jul 9, 2024
bda839d
try env var
rylew1 Jul 9, 2024
d45abd0
switch to dotenv for localhost
rylew1 Jul 9, 2024
ecede82
DRY files with a base config
rylew1 Jul 9, 2024
a210e7e
add WCAG standard
rylew1 Jul 9, 2024
ef5eb71
start docs
rylew1 Jul 10, 2024
891388a
add conditional for multiple app config
rylew1 Jul 10, 2024
af8e2bd
fix link
rylew1 Jul 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/ci-app-accessibility-tests.yml
rylew1 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI App Accessibility Tests

on:
pull_request:
paths:
- app/**
- .github/workflows/ci-a11y.yml

jobs:
build:
rylew1 marked this conversation as resolved.
Show resolved Hide resolved
name: Accessibility
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./app

env:
NODE_VERSION: 20
LOCKFILE_PATH: ./app/package-lock.json
PACKAGE_MANAGER: npm
rylew1 marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache-dependency-path: ${{ env.LOCKFILE_PATH }}
cache: ${{ env.PACKAGE_MANAGER }}

- name: Install dependencies
run: npm ci

- name: Create screenshots directory
run: mkdir -p screenshots-output

- name: Build project
run: npm run build

- name: Start server and log output
run: npm run start &

- name: Wait for frontend to be ready
run: |
# Ensure the server wait script is executable
chmod +x ./bin/wait-for-frontend.sh
./bin/wait-for-frontend.sh
- name: Run pa11y-ci
run: |
set -e # Ensure the script fails if any command fails
npm run test:pa11y-desktop
npm run test:pa11y-mobile
rylew1 marked this conversation as resolved.
Show resolved Hide resolved
echo "pa11y-ci tests finished."
- name: Upload screenshots to artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: screenshots
path: ./app/screenshots-output
lorenyu marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ignore Terraform lock files
# As of Feb 2023, Terraform lock files, while well intentioned, have a tendency
# to get into a confusing state that requires recreating the lock file, which
# to get into a confusing state that requires recreating the lock file, which
# defeats the purpose. Moreover, lock files are per environment, which can make
# it difficult for people to upgrade dependencies (e.g. upgrade an AWS provider)
# across environments if certain environments are locked down (e.g. production).
Expand All @@ -15,3 +15,6 @@
# Ignore local environment variables which can contain environment secrets
.env
.envrc

# Root level node_modules
node_modules/*
16 changes: 16 additions & 0 deletions .pa11yci-desktop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"defaults": {
"timeout": 240000,
"runners": ["axe"],
"ignore": ["color-contrast"],
"concurrency": 1,
"chromeLaunchConfig": {
"ignoreHTTPSErrors": true,
"args": ["--disable-dev-shm-usage", "--no-sandbox"]
},
"actions": [
"wait for element #main-content to be visible",
"screen capture screenshots-output/desktop-main-view.png"
]
}
}
23 changes: 23 additions & 0 deletions .pa11yci-mobile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"defaults": {
"timeout": 240000,
"runners": ["axe"],
"ignore": ["color-contrast"],
"concurrency": 1,
"chromeLaunchConfig": {
"ignoreHTTPSErrors": true,
"args": ["--disable-dev-shm-usage", "--no-sandbox"]
},
"viewport": {
"width": 390,
"height": 844,
"mobile": true
},
"actions": [
"wait for element #main-content to be visible",
"screen capture screenshots-output/mobile-main-view.png",
"click element .usa-navbar button",
"screen capture screenshots-output/mobile-expand-menu.png"
]
}
}
Loading
Loading