Tests workflow (lowdefy/lowdefy)
The Tests workflow from lowdefy/lowdefy, explained and optimized by Latchkey.
CI health: C - fair
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the Tests workflow from the lowdefy/lowdefy 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: Tests
on:
push:
branches:
- main
- develop
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
node: [22, 24]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
if: matrix.os != 'windows-latest'
- name: Build (skip website on Windows)
run: pnpm -r --filter='!@lowdefy/website' --filter='!@lowdefy/lowdefy' build
if: matrix.os == 'windows-latest'
- run: pnpm test
- uses: codecov/codecov-action@v3
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Tests on: push: branches: - main - develop concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: test: timeout-minutes: 30 name: Test runs-on: ${{ matrix.os }} strategy: matrix: os: - ubuntu-latest - windows-latest node: [22, 24] steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} cache: 'pnpm' - run: pnpm install --frozen-lockfile - name: Build run: pnpm build if: matrix.os != 'windows-latest' - name: Build (skip website on Windows) run: pnpm -r --filter='!@lowdefy/website' --filter='!@lowdefy/lowdefy' build if: matrix.os == 'windows-latest' - run: pnpm test - uses: codecov/codecov-action@v3
What changed
- 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.
2 third-party actions are referenced by a movable tag. Pin them to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
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
This workflow runs 1 job (4 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.