test-wf workflow (plotly/Kaleido)
The test-wf workflow from plotly/Kaleido, explained and optimized by Latchkey.
CI health: F - at risk
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 test-wf workflow from the plotly/Kaleido 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
---
name: test-wf
on:
pull_request:
push:
tags-ignore:
- v*
jobs:
test-all:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ./src/py/
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- uses: actions/setup-python@v5
with:
python-version-file: "./src/py/pyproject.toml"
- name: Install dependencies
run: >
uv sync
--no-sources
--locked
--all-extras
- name: Install google-chrome-for-testing
run: uv run --no-sync kaleido_get_chrome -v
- name: Test mocker
run: >
uv run
--no-sync kaleido_mocker
--random 50
--logistro-level INFO
--n 1
--timeout 200
- name: Test
if: ${{ ! runner.debug && matrix.os != 'ubuntu-latest' }}
run: uv run --no-sync poe test
timeout-minutes: 7
- name: Test (Linux)
if: ${{ ! runner.debug && matrix.os == 'ubuntu-latest' }}
run: xvfb-run uv run --no-sync poe test
timeout-minutes: 7
- name: Test (Debug)
if: runner.debug
run: uv run --no-sync poe debug-test
- name: Test (Debug, Linux)
if: ${{ runner.debug && matrix.os == 'ubuntu-latest' }}
run: xvfb-run uv run --no-sync poe debug-test
timeout-minutes: 7
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: test-wf on: pull_request: push: tags-ignore: - v* concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: test-all: timeout-minutes: 30 strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} defaults: run: working-directory: ./src/py/ steps: - uses: actions/checkout@v4 - uses: astral-sh/setup-uv@v5 - uses: actions/setup-python@v5 with: cache: 'pip' python-version-file: "./src/py/pyproject.toml" - name: Install dependencies run: > uv sync --no-sources --locked --all-extras - name: Install google-chrome-for-testing run: uv run --no-sync kaleido_get_chrome -v - name: Test mocker run: > uv run --no-sync kaleido_mocker --random 50 --logistro-level INFO --n 1 --timeout 200 - name: Test if: ${{ ! runner.debug && matrix.os != 'ubuntu-latest' }} run: uv run --no-sync poe test timeout-minutes: 7 - name: Test (Linux) if: ${{ ! runner.debug && matrix.os == 'ubuntu-latest' }} run: xvfb-run uv run --no-sync poe test timeout-minutes: 7 - name: Test (Debug) if: runner.debug run: uv run --no-sync poe debug-test - name: Test (Debug, Linux) if: ${{ runner.debug && matrix.os == 'ubuntu-latest' }} run: xvfb-run uv run --no-sync poe debug-test timeout-minutes: 7
What changed
- Cancel superseded runs when a branch or PR gets a newer push.
- Cache dependency installs on the setup step so they are served from cache.
- Add a job timeout so a hung step cannot burn hours of runner time.
1 third-party action is referenced by a movable tag. Pin it to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
This workflow runs 1 job (3 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.