From b6c4b69cda04e0abc6a215b37251b737de4f331e Mon Sep 17 00:00:00 2001 From: Jeff Mendez Date: Mon, 23 Jan 2023 13:24:44 -0500 Subject: [PATCH] feat(sitemap): add sitemap crawl option (#40) --- .github/workflows/action.yml | 1 + .github/workflows/bench-axe.yml | 19 ------------------- .github/workflows/bench-pa11y.yml | 31 ------------------------------- README.md | 10 +++++----- action.yml | 8 ++++++-- 5 files changed, 12 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/bench-axe.yml delete mode 100644 .github/workflows/bench-pa11y.yml diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index 3295d19..beade83 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -13,6 +13,7 @@ jobs: FAIL_TOTAL_COUNT: 10000 EXTERNAL: false SITE_WIDE: true + SITEMAP: true SUBDOMAINS: true TLD: true LIST: true diff --git a/.github/workflows/bench-axe.yml b/.github/workflows/bench-axe.yml deleted file mode 100644 index 488e90e..0000000 --- a/.github/workflows/bench-axe.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Bench Axe - -on: - pull_request: - branches-ignore: - - main -jobs: - axe: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Use Node.js 16.x - uses: actions/setup-node@v1 - with: - node-version: 16.x - - run: npm install -g @axe-core/cli - - name: Run axe - run: | - axe https://a11ywatch.com diff --git a/.github/workflows/bench-pa11y.yml b/.github/workflows/bench-pa11y.yml deleted file mode 100644 index 26eb6a8..0000000 --- a/.github/workflows/bench-pa11y.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Bench Pa11y-CI -on: [pull_request] -jobs: - build: - name: Bench Website Test - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Install pa11y-ci dependencies. - run: npm install pa11y-ci -g - - - name: Run Pa11y-CI. - run: pa11y-ci --sitemap https://a11ywatch.com/sitemap.xml | tee pa11y_output.txt - - - name: Read pa11y_output file. - id: pa11y_output - uses: juliangruber/read-file-action@v1 - with: - path: ./pa11y_output.txt - - - name: Comment on pull request. - uses: thollander/actions-comment-pull-request@v1 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - message: '
Pa11y testing results - - -```${{ steps.pa11y_output.outputs.content }}``` - -
' \ No newline at end of file diff --git a/README.md b/README.md index 2e30369..6a16cb4 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,15 @@ Some of the primary features include pass/fail testing, code fixes, and detailed ### Usage ```yaml -- uses: a11ywatch/github-action@v1.12.3 +- uses: a11ywatch/github-action@v1.13.0 with: WEBSITE_URL: ${{ secrets.WEBSITE_URL }} SUBDOMAINS: true - TLD: true + TLD: false + SITEMAP: true FAIL_ERRORS_COUNT: 15 LIST: true - FIX: true + FIX: false UPGRADE: false COMPUTER_VISION_SUBSCRIPTION_KEY: ${{ secrets.COMPUTER_VISION_SUBSCRIPTION_KEY }} COMPUTER_VISION_ENDPOINT: ${{ secrets.COMPUTER_VISION_SUBSCRIPTION_KEY }} @@ -32,6 +33,7 @@ All inputs are **optional** except $WEBSITE_URL. | `SITE_WIDE` | Site-wide scanning across all pages. | false | | `FIX` | Attempt to apply recommendations to code and commit to github. | false | | `SUBDOMAINS` | Include all subdomains (required SITE_WIDE=true). | true | +| `SITEMAP` | Extend crawl with sitemap links (required SITE_WIDE=true). | true | | `TLD` | Include all tld extensions (required SITE_WIDE=true). | true | | `LIST` | Report the results to github as a pass or fail list or detailed report. | false | | `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 | @@ -103,8 +105,6 @@ On a larger website A11yWatch action runs over 60x-10,000x+ faster depending on When `AI_DISABLED` is set to true the run for `A11yWatch` may increase. -Pa11y-CI could not finish the crawl as it exceeds the github action free limits at 6 hours. It handled around 1000 pages before failing at the 6 hour mark. - ## Common Issues 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. diff --git a/action.yml b/action.yml index 8e4ab32..c3c06d4 100644 --- a/action.yml +++ b/action.yml @@ -25,6 +25,10 @@ inputs: description: Perform a site-wide scan. required: false default: false + SITEMAP: + description: Extend crawl with sitemap links. + required: false + default: false SUBDOMAINS: description: Include all subdomains. required: false @@ -170,12 +174,12 @@ runs: - name: A11yWatch Crawl [Local] if: ${{ inputs.EXTERNAL == 'false' && inputs.SITE_WIDE == 'true' }} shell: bash - run: a11ywatch crawl --url ${{ inputs.WEBSITE_URL }} ${{ inputs.SUBDOMAINS == 'true' && '--subdomains' || '' }} ${{ inputs.TLD == 'true' && '--tld' || ''}} --save ${{ inputs.FIX == 'true' && '--fix' || '' }} + run: a11ywatch crawl --url ${{ inputs.WEBSITE_URL }} ${{ inputs.SUBDOMAINS == 'true' && '--subdomains' || '' }} ${{ inputs.TLD == 'true' && '--tld' || ''}} ${{ inputs.SITEMAP == 'true' && '--sitemap' || '' }} --save ${{ inputs.FIX == 'true' && '--fix' || '' }} - name: A11yWatch Crawl [External] if: ${{ inputs.EXTERNAL == 'true' && inputs.SITE_WIDE == 'true' }} shell: bash - run: a11ywatch crawl --url ${{ inputs.WEBSITE_URL }} ${{ inputs.SUBDOMAINS == 'true' && '--subdomains' || '' }} ${{ inputs.TLD == 'true' && '--tld' || ''}} --external --save ${{ inputs.FIX == 'true' && '--fix' || '' }} + run: a11ywatch crawl --url ${{ inputs.WEBSITE_URL }} ${{ inputs.SUBDOMAINS == 'true' && '--subdomains' || '' }} ${{ inputs.TLD == 'true' && '--tld' || ''}} ${{ inputs.SITEMAP == 'true' && '--sitemap' || '' }} --external --save ${{ inputs.FIX == 'true' && '--fix' || '' }} - name: Scan Results Check id: a11ywatch-results-generator