Skip to content
Latchkey

CI workflow (mrmlnc/fast-glob)

The CI workflow from mrmlnc/fast-glob, 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: mrmlnc/fast-glob.github/workflows/main.ymlLicense MITView source

What it does

This is the CI workflow from the mrmlnc/fast-glob 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: ['master', 'releases/*']
  pull_request:
    branches: ['*']

env:
  SNAPSHOT_SKIP_PRUNING: 1

jobs:
  test:
    name: Node.js ${{ matrix.node_version }} on ${{ matrix.os }}
    concurrency:
      group: ${{ github.workflow }}-build-${{ matrix.os }}-${{ matrix.node_version }}-${{ github.ref }}
      cancel-in-progress: true
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        node_version: [18.18.0, 18, 20, 22]
        os:
          - ubuntu-latest
          - macos-latest
          - windows-latest
    steps:
      - name: Setup repository
        uses: actions/checkout@v4
      - name: Setup environment
        uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node_version }}
      - name: Install dependencies
        run: npm install
      - name: Run Hygiene Checks
        run: npm run lint
      - name: Compile
        run: npm run compile
      - name: Run unit tests
        run: npm run test
      - name: Run e2e tests (sync)
        run: npm run test:e2e:sync
      - name: Run e2e tests (async)
        run: npm run test:e2e:async
      - name: Run e2e tests (stream)
        run: npm run test:e2e:stream

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: ['master', 'releases/*']
  pull_request:
    branches: ['*']
 
env:
  SNAPSHOT_SKIP_PRUNING: 1
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  test:
    timeout-minutes: 30
    name: Node.js ${{ matrix.node_version }} on ${{ matrix.os }}
    concurrency:
      group: ${{ github.workflow }}-build-${{ matrix.os }}-${{ matrix.node_version }}-${{ github.ref }}
      cancel-in-progress: true
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        node_version: [18.18.0, 18, 20, 22]
        os:
          - ubuntu-latest
          - macos-latest
          - windows-latest
    steps:
      - name: Setup repository
        uses: actions/checkout@v4
      - name: Setup environment
        uses: actions/setup-node@v4
        with:
          cache: 'npm'
          node-version: ${{ matrix.node_version }}
      - name: Install dependencies
        run: npm install
      - name: Run Hygiene Checks
        run: npm run lint
      - name: Compile
        run: npm run compile
      - name: Run unit tests
        run: npm run test
      - name: Run e2e tests (sync)
        run: npm run test:e2e:sync
      - name: Run e2e tests (async)
        run: npm run test:e2e:async
      - name: Run e2e tests (stream)
        run: npm run test:e2e:stream
 

What changed

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:

This workflow runs 1 job (12 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