# CI workflow (eslint/eslint)

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

Source: https://latchkey.dev/workflows/eslint-eslint-ci  
Upstream: [eslint/eslint](https://github.com/eslint/eslint/blob/main/.github/workflows/ci.yml) (.github/workflows/ci.yml), licence MIT

## 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

```yaml
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
```

## FAQ

### 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.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
