Skip to content
Latchkey

CI workflow (jsdom/jsdom)

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

D

CI health: D - needs work

Point runs-on at Latchkey and get caching, run de-duplication, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: jsdom/jsdom.github/workflows/jsdom-ci.ymlLicense MITView source

What it does

This is the CI workflow from the jsdom/jsdom 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:
  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          submodules: 'recursive'
      - uses: actions/setup-node@v6
        with:
          node-version: 22
      - name: Install dependencies
        run: npm ci
      - name: Run ESLint
        run: npm run lint
  build-with-canvas:
    name: Tests with node-canvas
    env:
      TEST_SUITE: 'node-canvas'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          submodules: recursive
      - uses: actions/setup-node@v6
        with:
          node-version: 22
      - name: Install required image manipulation packages with APT
        run: sudo apt-get update && sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
      - name: Setup hosts file for web platform tests server
        run: ./test/web-platform-tests/tests/wpt make-hosts-file | sudo tee -a /etc/hosts
      - name: Install dependencies and canvas
        run: npm ci && npm i canvas@3
      - name: Run tests
        run: npm test
  build:
    name: Tests
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        node-version:
          # Explicitly test minimum Node.js versions. Keep in sync with package.json.
          - 20.19.0
          - 20
          - 22.13.0
          - 22
          - 24.0.0
          - lts/*   # currently 24
          - latest  # currently 25
    steps:
    - uses: actions/checkout@v6
      with:
        submodules: recursive
    - uses: actions/setup-node@v6
      with:
        node-version: ${{ matrix.node-version }}
    - name: Setup hosts file for web platform tests server
      run: ./test/web-platform-tests/tests/wpt make-hosts-file | sudo tee -a /etc/hosts
    - name: Install dependencies
      run: npm ci --engine-strict
    - name: Run tests
      run: npm test

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]
 
permissions:
  contents: read
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  lint:
    timeout-minutes: 30
    name: Lint
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v6
        with:
          submodules: 'recursive'
      - uses: actions/setup-node@v6
        with:
          cache: 'npm'
          node-version: 22
      - name: Install dependencies
        run: npm ci
      - name: Run ESLint
        run: npm run lint
  build-with-canvas:
    timeout-minutes: 30
    name: Tests with node-canvas
    env:
      TEST_SUITE: 'node-canvas'
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v6
        with:
          submodules: recursive
      - uses: actions/setup-node@v6
        with:
          cache: 'npm'
          node-version: 22
      - name: Install required image manipulation packages with APT
        run: sudo apt-get update && sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
      - name: Setup hosts file for web platform tests server
        run: ./test/web-platform-tests/tests/wpt make-hosts-file | sudo tee -a /etc/hosts
      - name: Install dependencies and canvas
        run: npm ci && npm i canvas@3
      - name: Run tests
        run: npm test
  build:
    timeout-minutes: 30
    name: Tests
    runs-on: latchkey-small
    strategy:
      fail-fast: false
      matrix:
        node-version:
          # Explicitly test minimum Node.js versions. Keep in sync with package.json.
          - 20.19.0
          - 20
          - 22.13.0
          - 22
          - 24.0.0
          - lts/*   # currently 24
          - latest  # currently 25
    steps:
    - uses: actions/checkout@v6
      with:
        submodules: recursive
    - uses: actions/setup-node@v6
      with:
        cache: 'npm'
        node-version: ${{ matrix.node-version }}
    - name: Setup hosts file for web platform tests server
      run: ./test/web-platform-tests/tests/wpt make-hosts-file | sudo tee -a /etc/hosts
    - name: Install dependencies
      run: npm ci --engine-strict
    - name: Run tests
      run: npm test
 

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 3 jobs (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