Skip to content

ci: Run PR tests via GitHub Actions #1

ci: Run PR tests via GitHub Actions

ci: Run PR tests via GitHub Actions #1

Workflow file for this run

name: Tests
on: [push]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: node_modules
key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run eslint
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: node_modules
key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run build
- uses: actions/cache/save@v3
with:
path: axe.js
key: axe-build-${{ github.sha }}
test_unit:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
browser: [Chrome, Firefox]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: node_modules
key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- uses: actions/cache/restore@v3
with:
path: axe.js
key: axe-build-${{ github.sha }}
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run test -- --browsers ${{ matrix.browser }}
test_integration:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
browser: [chrome, firefox]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: node_modules
key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- uses: actions/cache/restore@v3
with:
path: axe.js
key: axe-build-${{ github.sha }}
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm ci
- run: npm run test:integration:${{ matrix.browser }}