Skip to content
Latchkey

Regression Test workflow (svg/svgo)

The Regression Test workflow from svg/svgo, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get 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: svg/svgo.github/workflows/regression.ymlLicense MITView source

What it does

This is the Regression Test workflow from the svg/svgo 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: Regression Test

env:
  # For debugging, you can override this to your fork to test.
  REPO: 'svg/svgo'

on:
  pull_request:
    branches:
      - main

permissions:
  contents: read

jobs:
  regression:
    runs-on: ubuntu-latest
    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}
      cancel-in-progress: true
    steps:
      - uses: actions/checkout@v6
      - run: corepack enable
      - uses: actions/setup-node@v6
        with:
          node-version: 24
          cache: yarn
      - run: yarn install
      - run: yarn playwright install --with-deps chromium
      - run: yarn test:regression
      # We use upload/artifacts instead of outputs because our regression test
      # report can exceed 1 MB which is a limit GitHub imposes.
      - uses: actions/upload-artifact@v7
        if: success() || failure()
        with:
          name: svgo-test-report-${{ github.sha }}
          path: /tmp/svgo.${{ github.sha }}/svgo-test-report.json
          if-no-files-found: error
          retention-days: 1
  delta:
    if: success() || failure()
    runs-on: ubuntu-latest
    needs:
      - regression
    env:
      GH_TOKEN: ${{ github.token }}
    steps:
      - uses: actions/checkout@v6
      - run: corepack enable
      - uses: actions/setup-node@v6
        with:
          node-version: 24
          cache: yarn
      - run: yarn install
      - run: gh run download -R ${{ env.REPO }} -n svgo-test-report-${{ github.sha }} -D /tmp/svgo.${{ github.sha }}/
      - run: gh run download -R ${{ env.REPO }} -n svgo-test-report -D /tmp/svgo.main/
      - run: ./test/regression/delta.js /tmp/svgo.main/svgo-test-report.json /tmp/svgo.${{ github.sha }}/svgo-test-report.json

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: Regression Test
 
env:
  # For debugging, you can override this to your fork to test.
  REPO: 'svg/svgo'
 
on:
  pull_request:
    branches:
      - main
 
permissions:
  contents: read
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  regression:
    timeout-minutes: 30
    runs-on: latchkey-small
    concurrency:
      group: ${{ github.workflow }}-${{ github.ref }}
      cancel-in-progress: true
    steps:
      - uses: actions/checkout@v6
      - run: corepack enable
      - uses: actions/setup-node@v6
        with:
          node-version: 24
          cache: yarn
      - run: yarn install
      - run: yarn playwright install --with-deps chromium
      - run: yarn test:regression
      # We use upload/artifacts instead of outputs because our regression test
      # report can exceed 1 MB which is a limit GitHub imposes.
      - uses: actions/upload-artifact@v7
        if: success() || failure()
        with:
          name: svgo-test-report-${{ github.sha }}
          path: /tmp/svgo.${{ github.sha }}/svgo-test-report.json
          if-no-files-found: error
          retention-days: 1
  delta:
    timeout-minutes: 30
    if: success() || failure()
    runs-on: latchkey-small
    needs:
      - regression
    env:
      GH_TOKEN: ${{ github.token }}
    steps:
      - uses: actions/checkout@v6
      - run: corepack enable
      - uses: actions/setup-node@v6
        with:
          node-version: 24
          cache: yarn
      - run: yarn install
      - run: gh run download -R ${{ env.REPO }} -n svgo-test-report-${{ github.sha }} -D /tmp/svgo.${{ github.sha }}/
      - run: gh run download -R ${{ env.REPO }} -n svgo-test-report -D /tmp/svgo.main/
      - run: ./test/regression/delta.js /tmp/svgo.main/svgo-test-report.json /tmp/svgo.${{ github.sha }}/svgo-test-report.json
 

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 2 jobs per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow