Get started
Building with GitHub

UserWay Continuous-Accessibility integrates into your GitHub workflow through a custom GitHub Action. The main purpose of the action is to collect accessibility reports generated during e2e tests execution and to trigger analysis via Continuous-Accessibility API.

1. Add a Repository secret

In your GitHub repository, go to Settings > Secrets and variables > Actions and create a new Repository secret

  • For the Name field, enter USERWAY_TOKEN
  • For the Secret field, paste project token found on your Continuous-Accessibility project settings page. Keep checked the Secured checkbox, then click on the Add secret button

2. Install @userway/cicd-cli npm package

Install the @userway/cicd-cli package in the root of your website project. This package is a command line interface tool but it provides Typescript types for your convenience during editing of configuration files. Installing of this package will allow you to trigger a11y analysis from your local dev machine, not only from GitHub pipeline environment.

npm install --save-dev @userway/cicd-cli

For more information about @userway/cicd-cli package refer to the npm package documentation (opens in a new tab)

3. Create file userway.config.ts

Project metadata, including the location of the reports to be analyzed, must be declared in the file userway.config.js (or userway.config.ts) in the the root of your project

userway.config.ts
import type { Config } from '@userway/cicd-core'
export default {
  organization: 'your-organization-slug-name',
  project: 'your-project-name',
  token: process.env.USERWAY_TOKEN,
  reportPaths: ['./uw-a11y-reports'],
} satisfies Config

4. Update your .github/workflows/build.yml

Update the script section to add the following commands, after e2e test execution. Add invocation of GitHub Action after your e2e tests

.github/workflows/build.yml
- name: UserWay Accessibility Analysis
  uses: UserWayOrg/cicd-action@main
  with:
    token: ${{ secrets.USERWAY_TOKEN }}

Check out one of our sample repository for a working example

To learn more about UserWay cicd-bitbucket pipe please refer to documentation (opens in a new tab)

5. Verify configuration

It is always a good idea to validate changes made in the steps above before committing them into repository. In order to verify if your GitHub action configuration is correct - there are are few steps which can be performed on local developer environment:

  • Make all necessary changes described above
  • Run e2e tests locally (this section)
  • Run command in terminal
export USERWAY_TOKEN=YOUR-PROJECT-TOKEN
npx userway

For more information about troubleshooting of your GitHub build configuration refer to the documentation

Prerequisites

  • Node.js v18.19.0 or higher is required