-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
993d77d
commit b7427ff
Showing
3 changed files
with
76 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,59 @@ | ||
# Checks website for accessiblity issues | ||
name: Website a11y | ||
|
||
on: | ||
pull_request: | ||
branches: ["*"] | ||
paths: | ||
- docs/** | ||
- .github/workflows/test-website-a11y.yml | ||
|
||
env: | ||
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- "docs/**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
name: test | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
BUNDLE_GEMFILE: ${{github.workspace}}/docs/GemFile | ||
defaults: | ||
run: | ||
working-directory: docs | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
working-directory: docs | ||
ruby-version: 3.3 | ||
dotnet-version: '9.x' | ||
|
||
- name: Install GEMs | ||
working-directory: docs | ||
run: | | ||
pwd | ||
bundle install | ||
- name: Build site | ||
working-directory: docs | ||
run: bundle exec jekyll build | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
|
||
- name: Serve site | ||
working-directory: docs | ||
run: bundle exec jekyll serve --detach | ||
- name: Install dependencies | ||
run: | | ||
dotnet tool install -g docfx | ||
npm install -g pa11y-ci | ||
- name: Show environment | ||
working-directory: docs | ||
run: npx pa11y --environment | ||
- name: Build and serve site | ||
run: | | ||
docfx build --serve --port 4000 --detach | ||
echo "Waiting up to 30s for server to start..." | ||
timeout=30 | ||
until curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:4000 | grep -q "200"; do | ||
if [ $timeout -le 0 ]; then | ||
echo "Server failed to start after ${timeout}s" | ||
exit 1 | ||
fi | ||
timeout=$((timeout-1)) | ||
sleep 1 | ||
done | ||
- name: Test accessibility | ||
working-directory: docs | ||
run: | | ||
npx pa11y-ci \ | ||
--sitemap http://127.0.0.1:4000/sitemap.xml \ | ||
--sitemap-exclude "/*.pdf" | ||
run: > | ||
pa11y-ci | ||
--sitemap http://127.0.0.1:4000/sitemap.xml | ||
--config ./.pa11yci | ||
--threshold 10 | ||
- name: Kill site (failsafe) | ||
if: always() | ||
run: pkill -f jekyll | ||
run: pkill -f docfx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
{ | ||
"defaults": { | ||
"concurrency": 1, | ||
"timeout": 30000, | ||
"wait": 1000, | ||
"standard": "WCAG2AA", | ||
"runners": ["htmlcs"], | ||
"hideElements": "#searchzone" | ||
"hideElements": "#searchzone", | ||
"port": 4000 | ||
} | ||
} |