diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 83459e11..f2e85639 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -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 diff --git a/.github/workflows/pa11y.sh b/.github/workflows/pa11y.sh index eee431dc..b3d5abc3 100755 --- a/.github/workflows/pa11y.sh +++ b/.github/workflows/pa11y.sh @@ -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