diff --git a/.github/workflows/check-a11y-of-changed-content.yaml b/.github/workflows/check-a11y-of-changed-content.yaml index 783b86c6ce..a36a57bf7e 100644 --- a/.github/workflows/check-a11y-of-changed-content.yaml +++ b/.github/workflows/check-a11y-of-changed-content.yaml @@ -57,14 +57,20 @@ jobs: - name: Install NPM dependencies run: npm ci + - name: Setup Chrome + uses: browser-actions/setup-chrome@v1 + id: setup-chrome + + - name: Log Chrome setup info + run: | + echo Installed chromium version: ${{ steps.setup-chrome.outputs.chrome-version }} + ${{ steps.setup-chrome.outputs.chrome-path }} --version + - name: Wait for blog to be running run: npx wait-on http://127.0.0.1:4000 --timeout 60000 - name: Find out what’s running on which ports run: sudo netstat -lp - - name: Run pa11y (for debugging) - run: npx pa11y https://blog.scottlogic.com --debug - - name: Run pa11y-ci - run: npx pa11y-ci + run: CHROMIUM_BIN=$(which chrome) npx pa11y-ci diff --git a/.pa11yci.js b/.pa11yci.js index 3a532c824d..1a096daa75 100644 --- a/.pa11yci.js +++ b/.pa11yci.js @@ -1,12 +1,17 @@ const relativeUrls = require('./pa11y-ci-urls'); +const chromiumBin = process.env.CHROMIUM_BIN; +if (!chromiumBin) { + throw new Error('CHROME_BIN environment variable is not set'); +} + const baseUrl = 'http://localhost:4000'; module.exports = { defaults: { concurrency: 1, chromeLaunchConfig: { - executablePath: '/usr/bin/google-chrome', + executablePath: chromiumBin, }, ignore: [ 'WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail', // colour contrast, which is a known issue