add junit annotations

This commit is contained in:
Jonathan Wren 2020-11-07 16:13:18 -08:00
parent 7251cda893
commit 01b4165dfb
No known key found for this signature in database
GPG key ID: 43D5FF8722E7F68A
2 changed files with 12 additions and 4 deletions

View file

@ -7,7 +7,7 @@ on:
branches: [ develop ]
jobs:
test:
accessibility:
runs-on: ubuntu-latest
steps:
@ -32,7 +32,7 @@ jobs:
pip install poetry
poetry config --local virtualenvs.in-project true
poetry install --no-root --remove-untracked
npm install pa11y
npm install pa11y pa11y-reporter-junit
- name: Start docs server
run: poetry run mkdocs serve &
@ -40,3 +40,11 @@ jobs:
- name: Accessibility testing (Pa11y)
run: poetry run .github/workflows/pa11y.sh
- name: Junit Report to Annotations
uses: ashley-taylor/junit-report-annotations-action@1.3
if: always()
with:
access-token: ${{ secrets.GITHUB_TOKEN }}
path: reports/pa11y/*.xml
includeSummary: true
numFailures: 10

View file

@ -9,11 +9,11 @@ mkdocs build
mkdir -p "$reports_dir"
printf -- 'scanning: /\n'
./node_modules/.bin/pa11y "$site_url" || exit_code=2
./node_modules/.bin/pa11y "$site_url" --reporter junit > "$reports_dir/root.xml" || exit_code=2
for file in $(xq '.urlset.url[].loc' site/sitemap.xml -r | sed -r 's!https://jrnl.sh/(.*?)/$!\1!'); do
printf -- 'scanning: /%s\n' "$file"
./node_modules/.bin/pa11y "$site_url/$file" || exit_code=2
./node_modules/.bin/pa11y "$site_url/$file" --reporter junit > "$reports_dir/$file.xml" || exit_code=2
done
exit $exit_code