Skip to content

v4: move to flat config, support ESLint v9 and friends, migrate plugins, and more #3

v4: move to flat config, support ESLint v9 and friends, migrate plugins, and more

v4: move to flat config, support ESLint v9 and friends, migrate plugins, and more #3

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
concurrency:
# Pushing new changes to a branch will cancel any in-progress CI runs of this workflow
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Restrict jobs in this workflow to have no permissions by default; permissions
# should be granted per job as needed using a dedicated `permissions` block
permissions: {}
env:
# reduces noise from npm post-install scripts
DISABLE_OPENCOLLECTIVE: true
OPEN_SOURCE_CONTRIBUTOR: true
NPM_CONFIG_AUDIT: false
NPM_CONFIG_FUND: false
jobs:
commitlint:
permissions:
contents: read # to fetch code (actions/checkout)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Commit Linter
uses: wagoid/commitlint-github-action@v6
with:
configFile: './package.json'
docs:
permissions:
contents: read # to fetch code (actions/checkout)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: install
run: npm ci
- name: regenerate docs
run: npm run tools:generate-configs-list
- name: report regenerated docs
run: |
git diff --name-only \
| xargs -I '{}' bash -c \
'echo "::error file={}::This needs to be regenerated by running \`tools:generate-configs-list\`" && false'
lint:
permissions:
contents: read # to fetch code (actions/checkout)
# prettier-ignore
name: Lint on ${{ matrix.os }} with eslint v${{ matrix.eslint }}, @typescript-eslint v${{ matrix.typescript-eslint }}, and using Node.js LTS
strategy:
fail-fast: false
matrix:
eslint: [8, 9]
typescript-eslint: [7, 8]
os: [ubuntu-latest, macOS-latest]
exclude:
- eslint: 9
typescript-eslint: 7
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- run: npm ci
# prettier-ignore
- run: tools/install-eslint-dependencies.sh ${{ matrix.eslint }} ${{ matrix.typescript-eslint }}
- run: npm run lint
test:
permissions:
contents: read # to fetch code (actions/checkout)
name: Test on ${{ matrix.os }} with eslint v${{ matrix.eslint }}, @typescript-eslint v${{ matrix.typescript-eslint }}, and using Node.js LTS
strategy:
fail-fast: false
matrix:
eslint: [8, 9]
typescript-eslint: [7, 8]
os: [ubuntu-latest, macOS-latest]
exclude:
- eslint: 9
typescript-eslint: 7
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- run: npm ci
# prettier-ignore
- run: tools/install-eslint-dependencies.sh ${{ matrix.eslint }} ${{ matrix.typescript-eslint }}
- run: npm run test
typecheck:
permissions:
contents: read # to fetch code (actions/checkout)
# prettier-ignore
name: Typecheck on ${{ matrix.os }} with eslint v${{ matrix.eslint }}, @typescript-eslint v${{ matrix.typescript-eslint }}, and using Node.js LTS
strategy:
fail-fast: false
matrix:
eslint: [8, 9]
typescript-eslint: [7, 8]
os: [ubuntu-latest, macOS-latest]
exclude:
- eslint: 9
typescript-eslint: 7
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- run: npm ci
# prettier-ignore
- run: tools/install-eslint-dependencies.sh ${{ matrix.eslint }} ${{ matrix.typescript-eslint }}
- run: npm run typecheck
release:
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs:
- commitlint
- docs
- lint
- test
- typecheck
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: install
run: npm ci
- name: lint
run: npm run lint
- name: typecheck
run: npm run typecheck
- name: test
run: npm run test
- name: release
run: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}