Skip to content

Commit

Permalink
Fixed axe workflow (alshedivat#2149)
Browse files Browse the repository at this point in the history
Signed-off-by: George Araújo <george.gcac@gmail.com>
  • Loading branch information
george-gca authored and Karapost committed Jul 4, 2024
1 parent 5f3b3d4 commit 9721107
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/axe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ on:
description: "URL to be checked (e.g.: blog/)"
required: false

permissions:
contents: write

env:
URL: ""

Expand Down Expand Up @@ -53,10 +50,24 @@ jobs:
run: |
npm install -g purgecss
purgecss -c purgecss.config.js
- name: Get Chromium version 🌐
# https://github.com/GoogleChromeLabs/chrome-for-testing?tab=readme-ov-file#other-api-endpoints
run: |
CHROMIUM_VERSION=$(wget -qO- https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE | cut -d. -f1)
echo "Chromium version: $CHROMIUM_VERSION"
echo "CHROMIUM_VERSION=$CHROMIUM_VERSION" >> $GITHUB_ENV
- name: Setup Chrome 🌐
id: setup-chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: ${{ env.CHROMIUM_VERSION }}
- name: Install chromedriver 🚗
run: |
npm install -g chromedriver@$CHROMIUM_VERSION
- name: Run axe 🪓
# https://github.com/dequelabs/axe-core-npm/tree/develop/packages/cli
run: |
npm install -g @axe-core/cli
npm install -g http-server
http-server _site/ &
axe http://localhost:8080/${{ github.event.inputs.url || env.URL }} --load-delay=1500 --exit
axe --chromedriver-path $(npm root -g)/chromedriver/bin/chromedriver http://localhost:8080/${{ github.event.inputs.url || env.URL }} --load-delay=1500 --exit
3 changes: 0 additions & 3 deletions .github/workflows/broken-links-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
workflows: [Deploy site]
types: [completed]

permissions:
contents: write

jobs:
check-links-on-site:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow
Expand Down

0 comments on commit 9721107

Please sign in to comment.