From 1775a9a99da56de5576b817519d36f911de3f844 Mon Sep 17 00:00:00 2001 From: George <31376482+george-gca@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:38:31 -0300 Subject: [PATCH] Axe accessibility test support (#2080) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added GitHub action to do axe accessibility tests with [axe cli](https://github.com/dequelabs/axe-core-npm/tree/develop/packages/cli). I believe it is best by default to let this be run only manually, since fixing some of the issues are not straightforward (I haven't fixed them all for this template yet). --------- Signed-off-by: George Araújo --- .github/workflows/axe.yml | 61 +++++++++++++++++++++++++++++++++++++++ README.md | 11 +++++++ _includes/footer.liquid | 4 +-- _includes/header.liquid | 2 +- _layouts/default.liquid | 2 +- 5 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/axe.yml diff --git a/.github/workflows/axe.yml b/.github/workflows/axe.yml new file mode 100644 index 0000000..b3c1638 --- /dev/null +++ b/.github/workflows/axe.yml @@ -0,0 +1,61 @@ +name: Axe accessibility testing + +on: + # if you want to run this on every push uncomment the following lines + # push: + # branches: + # - master + # - main + # pull_request: + # branches: + # - master + # - main + workflow_dispatch: + inputs: + url: + description: "URL to be checked (e.g.: blog/)" + required: false + +permissions: + contents: write + +env: + URL: "" + +jobs: + check: + # available images: https://github.com/actions/runner-images#available-images + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.2.2" + bundler-cache: true + - name: Update _config.yml ⚙️ + uses: fjogeleit/yaml-update-action@v0.13.1 + with: + commitChange: false + valueFile: "_config.yml" + changes: | + { + "giscus.repo": "${{ github.repository }}", + "baseurl": "" + } + - name: Install and Build 🔧 + run: | + pip3 install --upgrade jupyter + npm install -g mermaid.cli + npm install -g purgecss + export JEKYLL_ENV=production + bundle exec jekyll build --lsi + purgecss -c purgecss.config.js + - 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 diff --git a/README.md b/README.md index 3541622..9d0a7a3 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,7 @@ Workshop on Diffusion Models (NeurIPS: +
© Copyright {{ site.time | date: '%Y' }} {{ site.first_name }} @@ -14,7 +14,7 @@
{% else %} -