Skip to content

Accessibility Code Checker #34

Accessibility Code Checker

Accessibility Code Checker #34

Workflow file for this run

# This workflow demonstrates the use of Siteimprove Accessibility Code Checker in a CI/CD pipeline.
# It is intended to fail since the tested page is purposely inaccessible. This demonstrates how the
# failures are shown both in the console and in the Page Report in Siteimprove Intelligence Platform.
# See https://alfa.siteimprove.com/code-checker
# Note that even if the code checker step by itself fails, the full workflow doesn't.
# This reduces noise, and ensure that other problems in the workflow will still be reported.
name: Accessibility Code Checker (this workflow *should* fail!)
on:
push:
branches:
- main
workflow_dispatch:
schedule:
# Run weekly, on Monday morning at 05:00 UTC.
# Problems are reported to the latest editor of the script,
# currently https://github.com/Jym77
- cron: '0 5 * * 1'
jobs:
build:
name: Accessibility Code Checker
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v4
with:
path: .yarn/cache
key: yarn-${{ hashFiles('yarn.lock') }}
- run: >
yarn config set
npmScopes.siteimprove.npmAuthToken
${{ secrets.GITHUB_TOKEN }}
- run: yarn install --immutable
- run: yarn playwright install
- run: yarn dedupe --check
- run: yarn build
- run: yarn code-checker:start &
- run: yarn code-checker:test
env:
SI_USER_EMAIL: ${{ secrets.SI_USER_EMAIL }}
SI_API_KEY: ${{ secrets.SI_API_KEY }}
- name: Expect failure of previous step
if: ${{ failure() }}
run: echo "Code Checker failed as expected"