Nightly race tests workflow (pallets/click)
The Nightly race tests workflow from pallets/click, explained and optimized by Latchkey.
C
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 Nightly race tests workflow from the pallets/click repository, a real project running GitHub Actions. It is shown here with attribution under its BSD-3-Clause license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
workflow (.yml)
name: Nightly race tests
on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
permissions: {}
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
race-tests:
name: ${{ matrix.config.name }} (${{ matrix.branch }})
runs-on: ${{ matrix.config.os || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
branch: [main, stable]
config:
- {name: Random 3.14, python: '3.14', tox: random}
- {name: Random 3.14t, python: '3.14t', tox: random}
- {name: Random 3.13, python: '3.13', tox: random}
- {name: Random 3.12, python: '3.12', tox: random}
- {name: Random 3.11, python: '3.11', tox: random}
- {name: Random 3.10, python: '3.10', tox: random}
- {name: Random Windows, python: '3.14', tox: random, os: windows-latest}
- {name: Random Mac, python: '3.14', tox: random, os: macos-latest}
- {name: Stress 3.14, python: '3.14', tox: stress-py3.14}
- {name: Stress 3.14t, python: '3.14t', tox: stress-py3.14t}
- {name: Stress Mac 3.14t, python: '3.14t', tox: stress-py3.14t, os: macos-latest}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
ref: ${{ matrix.branch }}
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
enable-cache: true
prune-cache: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.config.python }}
- run: uv run --locked --no-default-groups --group dev tox run
env:
TOX_ENV: ${{ matrix.config.tox }}
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: Nightly race tests on: schedule: - cron: '0 6 * * *' workflow_dispatch: permissions: {} concurrency: group: ${{ github.workflow }} cancel-in-progress: false jobs: race-tests: timeout-minutes: 30 name: ${{ matrix.config.name }} (${{ matrix.branch }}) runs-on: ${{ matrix.config.os || 'ubuntu-latest' }} strategy: fail-fast: false matrix: branch: [main, stable] config: - {name: Random 3.14, python: '3.14', tox: random} - {name: Random 3.14t, python: '3.14t', tox: random} - {name: Random 3.13, python: '3.13', tox: random} - {name: Random 3.12, python: '3.12', tox: random} - {name: Random 3.11, python: '3.11', tox: random} - {name: Random 3.10, python: '3.10', tox: random} - {name: Random Windows, python: '3.14', tox: random, os: windows-latest} - {name: Random Mac, python: '3.14', tox: random, os: macos-latest} - {name: Stress 3.14, python: '3.14', tox: stress-py3.14} - {name: Stress 3.14t, python: '3.14t', tox: stress-py3.14t} - {name: Stress Mac 3.14t, python: '3.14t', tox: stress-py3.14t, os: macos-latest} steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false ref: ${{ matrix.branch }} - uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: enable-cache: true prune-cache: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: cache: 'pip' python-version: ${{ matrix.config.python }} - run: uv run --locked --no-default-groups --group dev tox run env: TOX_ENV: ${{ matrix.config.tox }}
What changed
- 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.
This workflow runs 1 job (22 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.