Verify changes workflow (style-dictionary/style-dictionary)
The Verify changes workflow from style-dictionary/style-dictionary, explained and optimized by Latchkey.
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.
What it does
This is the Verify changes workflow from the style-dictionary/style-dictionary repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: Verify changes
on: pull_request
jobs:
verify:
name: Verify changes
strategy:
matrix:
# latest node & minimum node according to pkg.json engines
node-version: [22.0, lts/*]
os: [ubuntu-latest, windows-latest]
runs-on: ${{matrix.os}}
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v4
- name: Setup Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Linting & Formatting
run: npm run lint
- name: Node tests
run: npm run test:node
- name: Install chromium
run: npx playwright install --with-deps chromium
- name: Browser tests
run: npm run test
- name: Performance tests
run: npm run test:perf
verify-strip-types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node 22.6.0
uses: actions/setup-node@v4
with:
node-version: 22.6.0
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Node Strip types tests
run: npm run test:strip-types
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Verify changes on: pull_request concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: verify: timeout-minutes: 30 name: Verify changes strategy: matrix: # latest node & minimum node according to pkg.json engines node-version: [22.0, lts/*] os: [ubuntu-latest, windows-latest] runs-on: ${{matrix.os}} steps: - name: Set git to use LF run: | git config --global core.autocrlf false git config --global core.eol lf - uses: actions/checkout@v4 - name: Setup Node ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'npm' - name: Install Dependencies run: npm ci - name: Linting & Formatting run: npm run lint - name: Node tests run: npm run test:node - name: Install chromium run: npx playwright install --with-deps chromium - name: Browser tests run: npm run test - name: Performance tests run: npm run test:perf verify-strip-types: timeout-minutes: 30 runs-on: latchkey-small steps: - uses: actions/checkout@v4 - name: Setup Node 22.6.0 uses: actions/setup-node@v4 with: node-version: 22.6.0 cache: 'npm' - name: Install Dependencies run: npm ci - name: Node Strip types tests run: npm run test:strip-types
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Cancel superseded runs when a branch or PR gets a newer push.
- Add a job timeout so a hung step cannot burn hours of runner time.
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:
- Dependency installs
- End-to-end and browser tests
This workflow runs 2 jobs (5 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.