CI workflow (eslint/eslint)
The CI workflow from eslint/eslint, explained and optimized by Latchkey.
CI health: F - at risk
Point runs-on at Latchkey and get caching, run de-duplication, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the CI workflow from the eslint/eslint repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
verify_files:
name: Verify Files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version: "stable"
- uses: actions/setup-node@v6
with:
node-version: "lts/*"
- name: Lint GitHub Actions workflows
run: |
go install github.com/rhysd/actionlint/cmd/actionlint@v1.7.10
actionlint -color -shellcheck= -pyflakes=
- name: Install Packages
run: npm install
- name: Install Docs Packages
working-directory: docs
run: npm install
- name: Lint Files
run: node Makefile lint
- name: Check Rule Files
run: node Makefile checkRuleFiles
- name: Check Licenses
run: node Makefile checkLicenses
- name: Lint Docs JS Files
run: node Makefile lintDocsJS
- name: Check Rule Examples
run: node Makefile checkRuleExamples
- name: Check Rule Types
run: npm run lint:rule-types
- name: Lint Files, Dependencies, & Exports
run: npm run lint:unused
- name: Check Formatting
run: npm run fmt:check
test_on_node:
name: Test
strategy:
matrix:
os: [ubuntu-latest]
node: [26.x, 24.x, 22.x, 20.x, "20.19.0"]
NODE_OPTIONS: [""]
include:
- os: windows-latest
node: "lts/*"
- os: macOS-latest
node: "lts/*"
- os: ubuntu-latest
node: 24.x
# `--experimental-strip-types` is enabled by default in Node.js 24.x.
# This additional environment is necessary only to test `--experimental-transform-types`,
# as it is not enabled by default in any Node.js version yet.
NODE_OPTIONS: "--experimental-transform-types"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Install Packages
run: npm install
- name: Test
env:
NODE_OPTIONS: ${{ matrix.NODE_OPTIONS }}
run: node Makefile mocha
- name: Fuzz Test
run: node Makefile fuzz
- name: Test EMFILE Handling
run: npm run test:emfile
test_on_browser:
name: Browser Test
runs-on: ubuntu-latest
env:
TERM: xterm-256color
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: "24" # Should be the same as the version used on Netlify to build the ESLint Playground
- name: Install Packages
run: npm install
- name: Test
run: node Makefile cypress
- name: Fuzz Test
run: node Makefile fuzz
test_types:
name: Test Types
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: "lts/*"
- name: Install Packages
run: npm install
- name: Test types (eslint)
run: npx tsc -p tests/lib/types/tsconfig.json
- name: Test types (eslint-config-eslint)
run: npm run test:types -w packages/eslint-config-eslint
- name: Test types (@eslint/js)
run: npm run test:types -w packages/js
- name: Check types compile (TypeScript 5.3)
run: npm run test:types:5.3
- name: Check types compile (TypeScript 5.x)
run: npm run test:types:5.x
- name: Check types compile (TypeScript 7 preview)
run: npm run test:types:7.x
test_package_manager:
name: Test Package Managers
uses: eslint/workflows/.github/workflows/ci-package-manager.yml@main
pnpm_test:
name: Test pnpm Type Support
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: latest
- uses: actions/setup-node@v6
with:
node-version: "lts/*"
- name: Run pnpm test
run: npm run test:pnpm
The same workflow, on Latchkey
Estimated ~20% faster on cache hits, plus fewer wasted runs and a safer supply chain. Added and changed lines are highlighted.
name: CI on: push: branches: [main] pull_request: branches: [main] permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: verify_files: timeout-minutes: 30 name: Verify Files runs-on: latchkey-small steps: - uses: actions/checkout@v7 - uses: actions/setup-go@v6 with: go-version: "stable" - uses: actions/setup-node@v6 with: cache: 'npm' node-version: "lts/*" - name: Lint GitHub Actions workflows run: | go install github.com/rhysd/actionlint/cmd/actionlint@v1.7.10 actionlint -color -shellcheck= -pyflakes= - name: Install Packages run: npm install - name: Install Docs Packages working-directory: docs run: npm install - name: Lint Files run: node Makefile lint - name: Check Rule Files run: node Makefile checkRuleFiles - name: Check Licenses run: node Makefile checkLicenses - name: Lint Docs JS Files run: node Makefile lintDocsJS - name: Check Rule Examples run: node Makefile checkRuleExamples - name: Check Rule Types run: npm run lint:rule-types - name: Lint Files, Dependencies, & Exports run: npm run lint:unused - name: Check Formatting run: npm run fmt:check test_on_node: timeout-minutes: 30 name: Test strategy: matrix: os: [ubuntu-latest] node: [26.x, 24.x, 22.x, 20.x, "20.19.0"] NODE_OPTIONS: [""] include: - os: windows-latest node: "lts/*" - os: macOS-latest node: "lts/*" - os: ubuntu-latest node: 24.x # `--experimental-strip-types` is enabled by default in Node.js 24.x. # This additional environment is necessary only to test `--experimental-transform-types`, # as it is not enabled by default in any Node.js version yet. NODE_OPTIONS: "--experimental-transform-types" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v6 with: cache: 'npm' node-version: ${{ matrix.node }} - name: Install Packages run: npm install - name: Test env: NODE_OPTIONS: ${{ matrix.NODE_OPTIONS }} run: node Makefile mocha - name: Fuzz Test run: node Makefile fuzz - name: Test EMFILE Handling run: npm run test:emfile test_on_browser: timeout-minutes: 30 name: Browser Test runs-on: latchkey-small env: TERM: xterm-256color steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v6 with: cache: 'npm' node-version: "24" # Should be the same as the version used on Netlify to build the ESLint Playground - name: Install Packages run: npm install - name: Test run: node Makefile cypress - name: Fuzz Test run: node Makefile fuzz test_types: timeout-minutes: 30 name: Test Types runs-on: latchkey-small steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v6 with: cache: 'npm' node-version: "lts/*" - name: Install Packages run: npm install - name: Test types (eslint) run: npx tsc -p tests/lib/types/tsconfig.json - name: Test types (eslint-config-eslint) run: npm run test:types -w packages/eslint-config-eslint - name: Test types (@eslint/js) run: npm run test:types -w packages/js - name: Check types compile (TypeScript 5.3) run: npm run test:types:5.3 - name: Check types compile (TypeScript 5.x) run: npm run test:types:5.x - name: Check types compile (TypeScript 7 preview) run: npm run test:types:7.x test_package_manager: timeout-minutes: 30 name: Test Package Managers uses: eslint/workflows/.github/workflows/ci-package-manager.yml@main pnpm_test: timeout-minutes: 30 name: Test pnpm Type Support runs-on: latchkey-small steps: - uses: actions/checkout@v7 - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 with: version: latest - uses: actions/setup-node@v6 with: cache: 'npm' node-version: "lts/*" - name: Run pnpm test run: npm run test:pnpm
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Cancel superseded runs when a branch or PR gets a newer push.
- Cache dependency installs on the setup step so they are served from cache.
- Add a job timeout so a hung step cannot burn hours of runner time.
1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- Dependency installs
- End-to-end and browser tests
This workflow runs 6 jobs (10 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.