Skip to content
Latchkey

CI workflow (beautifier/js-beautify)

The CI workflow from beautifier/js-beautify, explained and optimized by Latchkey.

D

CI health: D - needs work

Run this on Latchkey for self-healing, caching, and up to 58% lower cost.

Grade your own workflow free or run it on Latchkey →
Source: beautifier/js-beautify.github/workflows/main.ymlLicense MITView source

What it does

This is the CI workflow from the beautifier/js-beautify 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


jobs:
  build:
    name: Build ${{ matrix.os }} (Node ${{ matrix.node-version }}, Python ${{ matrix.python-version }} )
    runs-on: ${{ matrix.os }}-latest
    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu, windows, macos ]
        python-version: [3.11, 3.12, 3.14]
        include:
          - python-version: 3.11 
            node-version: 22
          - python-version: 3.12
            node-version: 24
          - python-version: 3.14
            node-version: 26
    steps:
      - uses: actions/checkout@v7
      - name: Set up Node ${{ matrix.node-version }}
        uses: actions/setup-node@v6
        with:
          node-version: ${{ matrix.node-version }}
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v6
        with:
          python-version: ${{ matrix.python-version }}
      - name: Cached node_modules
        uses: actions/cache@v6
        with:
          path: node_modules
          key: ${{ runner.os }}-node-${{ hashFiles('**/package*.json') }}
          restore-keys: |
            ${{ runner.os }}-node-
      - name: Make all (Windows)
        if: matrix.os == 'windows'
        run: make all
      - name: Make CI (Non-windows)
        if: matrix.os != 'windows'
        run: make ci

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
 
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  build:
    timeout-minutes: 30
    name: Build ${{ matrix.os }} (Node ${{ matrix.node-version }}, Python ${{ matrix.python-version }} )
    runs-on: ${{ matrix.os }}-latest
    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu, windows, macos ]
        python-version: [3.11, 3.12, 3.14]
        include:
          - python-version: 3.11 
            node-version: 22
          - python-version: 3.12
            node-version: 24
          - python-version: 3.14
            node-version: 26
    steps:
      - uses: actions/checkout@v7
      - name: Set up Node ${{ matrix.node-version }}
        uses: actions/setup-node@v6
        with:
          cache: 'npm'
          node-version: ${{ matrix.node-version }}
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v6
        with:
          python-version: ${{ matrix.python-version }}
      - name: Cached node_modules
        uses: actions/cache@v6
        with:
          path: node_modules
          key: ${{ runner.os }}-node-${{ hashFiles('**/package*.json') }}
          restore-keys: |
            ${{ runner.os }}-node-
      - name: Make all (Windows)
        if: matrix.os == 'windows'
        run: make all
      - name: Make CI (Non-windows)
        if: matrix.os != 'windows'
        run: make ci
 

What changed

This workflow runs 1 job (9 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow