Skip to content

Tests

Tests #434

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches:
- main
schedule:
# Every sunday at midnight
- cron: "0 0 * * 0"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run format
- run: node tools/toc.js check
# markdown-link-check disabled until https://github.com/tcort/markdown-link-check/issues/304
# is fixed
# - run: npx markdown-link-check -p README.md
integration:
runs-on: ${{ matrix.os }}
needs: lint
strategy:
matrix:
os: [ubuntu-latest]
eslint: ["4.7", latest, next]
include:
# Windows support
- os: windows-latest
eslint: latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: npm
- run: npm ci
- run: bash tools/integration-tests.bash ${{ matrix.eslint }}
test:
runs-on: ${{ matrix.os }}
needs: lint
strategy:
matrix:
os: [ubuntu-latest]
node: [18, 20]
eslint: [latest]
include:
# ESLint 4.7 support: lowest version supported
- os: ubuntu-latest
node: 20
eslint: "4.7"
# ESLint 5 support: lowest version we can use to test external html plugins support
- os: ubuntu-latest
node: 20
eslint: "5.0"
# Upcoming ESLint major version support
- os: ubuntu-latest
node: 20
eslint: next
# Node 16 support: use ESLint v8 becacuse they dropped node 16 support in v9. Will be
# dropped in next major.
- os: ubuntu-latest
node: 16
eslint: "8"
# Windows support
- os: windows-latest
node: 20
eslint: latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npm install eslint@${{ matrix.eslint }}
- run: npm test