Continuous Integration workflow (simplistix/testfixtures)
The Continuous Integration workflow from simplistix/testfixtures, explained and optimized by Latchkey.
CI health: C - fair
Point runs-on at Latchkey and get run de-duplication, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Continuous Integration workflow from the simplistix/testfixtures 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: "Continuous Integration"
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "0 1 * * *"
jobs:
tests:
name: "tests / python ${{ matrix.python-version }} / ${{ matrix.uv-resolution }} ${{ matrix.extra}}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.11"
- "3.14"
uv-resolution:
- "lowest-direct"
- "highest"
extra:
- ""
- "--all-extras --all-groups"
include:
# Now test each of the extras individually
- python-version: "3.14"
uv-resolution: "highest"
extra: "--extra django --group django-dev"
- python-version: "3.14"
uv-resolution: "highest"
extra: "--extra mock-backport"
- python-version: "3.14"
uv-resolution: "highest"
extra: "--extra sybil"
- python-version: "3.14"
uv-resolution: "highest"
extra: "--extra loguru"
- python-version: "3.14"
uv-resolution: "highest"
extra: "--extra polars"
- python-version: "3.14"
uv-resolution: "highest"
extra: "--extra pandas --group pandas-dev"
- python-version: "3.14"
uv-resolution: "highest"
extra: "--extra numpy"
- python-version: "3.14"
uv-resolution: "highest"
extra: "--extra structlog"
- python-version: "3.14"
uv-resolution: "highest"
extra: "--extra pydantic"
- python-version: "3.14"
uv-resolution: "highest"
extra: "--extra twisted --group twisted-dev"
- python-version: "3.14"
uv-resolution: "highest"
extra: "--extra yaml"
- python-version: "3.14"
uv-resolution: "highest"
extra: "--extra toml"
steps:
- uses: cjw296/python-action/run-tests@v3
with:
python-version: ${{ matrix.python-version }}
uv-params: "--dev ${{ matrix.extra }} --resolution ${{ matrix.uv-resolution }}"
coverage:
needs: tests
runs-on: ubuntu-latest
steps:
- uses: cjw296/python-action/check-coverage@v3
typing:
name: type checking / python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.11"
- "3.14"
steps:
- uses: cjw296/python-action/check-typing@v3
with:
python-version: ${{ matrix.python-version }}
uv-params: "--all-groups --all-extras"
build-and-inspect-package:
needs:
- coverage
- tests
- typing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hynek/build-and-inspect-python-package@v2
check-package:
needs:
- build-and-inspect-package
runs-on: ubuntu-latest
strategy:
matrix:
extra:
- ""
- "django"
- "loguru"
- "polars"
- "pandas"
- "numpy"
- "sybil"
- "mock"
- "structlog"
- "pydantic"
- "twisted"
steps:
- uses: cjw296/python-action/check-distributions@v3
with:
package: "testfixtures"
python-version: "3.14"
extras: ${{ matrix.extra == 'mock' && '[mock-backport]' || (matrix.extra && format('[{0}]', matrix.extra) || '') }}
checks: ${{ matrix.extra && format('python -c "import testfixtures.{0}"', matrix.extra) || 'python -c "import testfixtures"' }}
all-green:
if: always()
needs:
- check-package
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: "Continuous Integration" on: push: branches: [main] pull_request: schedule: - cron: "0 1 * * *" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: tests: timeout-minutes: 30 name: "tests / python ${{ matrix.python-version }} / ${{ matrix.uv-resolution }} ${{ matrix.extra}}" runs-on: latchkey-small strategy: fail-fast: false matrix: python-version: - "3.11" - "3.14" uv-resolution: - "lowest-direct" - "highest" extra: - "" - "--all-extras --all-groups" include: # Now test each of the extras individually - python-version: "3.14" uv-resolution: "highest" extra: "--extra django --group django-dev" - python-version: "3.14" uv-resolution: "highest" extra: "--extra mock-backport" - python-version: "3.14" uv-resolution: "highest" extra: "--extra sybil" - python-version: "3.14" uv-resolution: "highest" extra: "--extra loguru" - python-version: "3.14" uv-resolution: "highest" extra: "--extra polars" - python-version: "3.14" uv-resolution: "highest" extra: "--extra pandas --group pandas-dev" - python-version: "3.14" uv-resolution: "highest" extra: "--extra numpy" - python-version: "3.14" uv-resolution: "highest" extra: "--extra structlog" - python-version: "3.14" uv-resolution: "highest" extra: "--extra pydantic" - python-version: "3.14" uv-resolution: "highest" extra: "--extra twisted --group twisted-dev" - python-version: "3.14" uv-resolution: "highest" extra: "--extra yaml" - python-version: "3.14" uv-resolution: "highest" extra: "--extra toml" steps: - uses: cjw296/python-action/run-tests@v3 with: python-version: ${{ matrix.python-version }} uv-params: "--dev ${{ matrix.extra }} --resolution ${{ matrix.uv-resolution }}" coverage: timeout-minutes: 30 needs: tests runs-on: latchkey-small steps: - uses: cjw296/python-action/check-coverage@v3 typing: timeout-minutes: 30 name: type checking / python ${{ matrix.python-version }} runs-on: latchkey-small strategy: matrix: python-version: - "3.11" - "3.14" steps: - uses: cjw296/python-action/check-typing@v3 with: python-version: ${{ matrix.python-version }} uv-params: "--all-groups --all-extras" build-and-inspect-package: timeout-minutes: 30 needs: - coverage - tests - typing runs-on: latchkey-small steps: - uses: actions/checkout@v4 - uses: hynek/build-and-inspect-python-package@v2 check-package: timeout-minutes: 30 needs: - build-and-inspect-package runs-on: latchkey-small strategy: matrix: extra: - "" - "django" - "loguru" - "polars" - "pandas" - "numpy" - "sybil" - "mock" - "structlog" - "pydantic" - "twisted" steps: - uses: cjw296/python-action/check-distributions@v3 with: package: "testfixtures" python-version: "3.14" extras: ${{ matrix.extra == 'mock' && '[mock-backport]' || (matrix.extra && format('[{0}]', matrix.extra) || '') }} checks: ${{ matrix.extra && format('python -c "import testfixtures.{0}"', matrix.extra) || 'python -c "import testfixtures"' }} all-green: timeout-minutes: 30 if: always() needs: - check-package runs-on: latchkey-small steps: - uses: re-actors/alls-green@release/v1 with: jobs: ${{ toJSON(needs) }}
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.
3 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.
This workflow runs 6 jobs (24 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.