let setup-node handle caching #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: [push] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
- 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/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
- 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/restore@v3 | |
with: | |
path: axe.js | |
key: axe-build-${{ github.sha }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
- run: npm ci | |
- run: xvfb-run --auto-servernum 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/restore@v3 | |
with: | |
path: axe.js | |
key: axe-build-${{ github.sha }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
- run: npm ci | |
- run: npx browser-driver-manager install chromedriver --verbose | |
- run: xvfb-run --auto-servernum npm run test:integration:${{ matrix.browser }} |