# babel-loader workflow (babel/babel-loader)

> The babel-loader workflow from babel/babel-loader, explained and optimized by Latchkey.

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

## What it does

This is the babel-loader workflow from the babel/babel-loader 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: babel-loader

on: [push, pull_request]

permissions:
  contents: read #  to fetch code (actions/checkout)

jobs:
  test:
    name: Test - ${{ matrix.os }} - Node ${{ matrix.node-version }}, Babel ${{ matrix.babel-version }}, Webpack ${{ matrix.webpack-version }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
        node-version: [22, 24]
        babel-version: ["7", "8"]
        webpack-version: ["5"]
        include:
          - node-version: "20"
            webpack-version: "5"
            babel-version: "7"
            os: ubuntu-latest
          - node-version: "18"
            webpack-version: "5"
            babel-version: "7"
            os: ubuntu-latest
          - node-version: "18"
            webpack-version: "5"
            babel-version: "7"
            os: windows-latest
          - node-version: "18.20.0" # The minimum supported node version
            webpack-version: "5.61.0" # The minimum supported webpack version
            babel-version: "7"
            os: ubuntu-latest
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}
          cache: "yarn"
      - name: Install dependencies
        run: yarn
      - name: Install webpack ${{ matrix.webpack-version }}
        run: yarn add -D webpack@${{ matrix.webpack-version }}
      - name: Downgrade to Babel 7
        if: matrix.babel-version == '7'
        run: yarn up @babel/*@^7
      - name: Build babel-loader
        run: yarn run build
      - name: Run tests for webpack version ${{ matrix.webpack-version }}
        run: yarn test-only

  lint-coverage:
    name: Lint and Coverage - ${{ matrix.os }} - Node ${{ matrix.node-version }}, Webpack 5
    strategy:
      matrix:
        os: [ubuntu-latest]
        node-version: [latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v3
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}
          cache: "yarn"
      - name: Install dependencies
        run: yarn
      - name: Run tsc
        run: yarn tsc
      - name: Run lint and coverage tests
        run: yarn test
      - name: Submit coverage data to codecov
        uses: codecov/codecov-action@v3
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
```

## FAQ

### What does the babel-loader workflow (babel/babel-loader) workflow do?

This is the babel-loader workflow from the babel/babel-loader 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 C. 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 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
