Skip to content
Latchkey LogoLatchkey home

CI workflow (eslint/eslint)

The CI workflow from eslint/eslint, explained and optimized by Latchkey.

Source: eslint/eslint.github/workflows/ci.ymlLicense MITView source
F
CI health grade
40/100
Health score
6
Jobs per trigger
4
Fixes in the optimized version

In short

  1. CI health: F (at risk)
  2. The optimized version below points runs-on at Latchkey managed runners and adds run de-duplication, caching, and job timeouts.

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

workflow (.yml)
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.

workflow (.yml), optimized
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: ubuntu-latest
        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 }}
        runs-on: latchkey-small
        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: ubuntu-latest
        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: ubuntu-latest
        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: ubuntu-latest
        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

  1. Run on Latchkey managed runners with one line (runs-on), which apply the fixes below automatically and self-heal transient failures. Each Linux x64 job moves to the Latchkey size matching its vCPU count, latchkey-small for a standard 2 vCPU runner; macOS, Windows and arm64 jobs stay as written.
  2. Cancel superseded runs when a branch or PR gets a newer push.
  3. Cache dependency installs on the setup step so they are served from cache.
  4. 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. 9 of the 10 run on a standard GitHub-hosted Linux x64 runner, which in a private repository bills $0.006 a minute against $0.0025 on latchkey-small, 58% lower; in a public repository like this one they are free. Estimate the monthly difference with your own run counts.

Actions used in this workflow

  • actions/checkout
  • actions/setup-go
  • actions/setup-node
  • eslint/workflows/.github/workflows/ci-package-manager.yml
  • pnpm/action-setup

Frequently asked questions

What does the CI workflow (eslint/eslint) workflow do?
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.
What CI health grade does this workflow get?
This Node.js workflow grades F. Paste your own workflow into the Latchkey grader to see its grade and the exact fixes.
How can I improve this Node.js workflow?
Add run de-duplication, caching, and job timeouts. Latchkey applies these automatically on managed runners when you point runs-on at Latchkey.

References