Skip to content

Explicitly set chromedriver version #70

Explicitly set chromedriver version

Explicitly set chromedriver version #70

Workflow file for this run

on: [push]
name: CI
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "16"
cache: npm
- name: Restore cache
uses: actions/cache@v3
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- name: Install dependencies
run: npm ci
# run eslint
- name: Lint
run: npm run lint
# start server so we can run lighthouse against it
- name: Start server in bg
run: |
npm run dev &
# give enough time for the server to start and be ready to accept
# connections... can get fancier but this should do
sleep 3
- name: Run Lighthouse Audit and assert 100% accessibility
# https://github.com/treosh/lighthouse-ci-action
uses: treosh/lighthouse-ci-action@v9
with:
urls: |
http://localhost:3000/
uploadArtifacts: true
temporaryPublicStorage: true
configPath: ".github/lighthouse/lighthouserc.yml"
- name: Run axe
run: |
# I have to keep setting the chromedriver version to whatever version
# is present on the CI box, eventually I should figure out how to pin
# the version of chrome that I'm using, or to pull it dynamically and
# insert it here
npm install -g @axe-core/[email protected] [email protected]
# https://github.com/dequelabs/axe-core-npm/issues/679#issuecomment-1456590620
axe --chromedriver-path $(npm root -g)/chromedriver/bin/chromedriver http://localhost:3000 --exit