Skip to content
Latchkey

CI workflow (kayak/pypika)

The CI workflow from kayak/pypika, explained and optimized by Latchkey.

F

CI health: F - at risk

Point runs-on at Latchkey and get caching, run de-duplication, job timeouts, SHA-pinned actions, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: kayak/pypika.github/workflows/ci.ymlLicense Apache-2.0View source

What it does

This is the CI workflow from the kayak/pypika 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

workflow (.yml)
name: CI

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-python@v6
      - uses: pre-commit/action@v3.0.0

  test:
    name: Unit tests on Python ${{ matrix.python-version }} on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]
        python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.9", "pypy3.10", "pypy3.11"]

    steps:
      - uses: actions/checkout@v5

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v6
        with:
          python-version: ${{ matrix.python-version }}
          allow-prereleases: true

      - name: Install dependencies
        run: python -m pip install -U pip -r requirements-dev.txt

      - name: Run test suite
        run: python -m unittest discover

      - name: Install coverage dependencies
        if: matrix.python-version == '3.14' && matrix.os == 'ubuntu-latest'
        run: pip install coveralls

      - name: Run coverage
        if: matrix.python-version == '3.14' && matrix.os == 'ubuntu-latest'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
        run: |
          coverage run -m unittest discover
          coverage xml
          coveralls --service=github

  mypy:
    name: Type Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-python@v6
        with:
          python-version: "3.12"
      - run: |
          pip install mypy
          mypy .

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: CI
 
on:
  push:
  pull_request:
  workflow_dispatch:
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  lint:
    timeout-minutes: 30
    name: Lint
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-python@v6
        with:
          cache: 'pip'
      - uses: pre-commit/action@v3.0.0
 
  test:
    timeout-minutes: 30
    name: Unit tests on Python ${{ matrix.python-version }} on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]
        python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.9", "pypy3.10", "pypy3.11"]
 
    steps:
      - uses: actions/checkout@v5
 
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v6
        with:
          cache: 'pip'
          python-version: ${{ matrix.python-version }}
          allow-prereleases: true
 
      - name: Install dependencies
        run: python -m pip install -U pip -r requirements-dev.txt
 
      - name: Run test suite
        run: python -m unittest discover
 
      - name: Install coverage dependencies
        if: matrix.python-version == '3.14' && matrix.os == 'ubuntu-latest'
        run: pip install coveralls
 
      - name: Run coverage
        if: matrix.python-version == '3.14' && matrix.os == 'ubuntu-latest'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
        run: |
          coverage run -m unittest discover
          coverage xml
          coveralls --service=github
 
  mypy:
    timeout-minutes: 30
    name: Type Check
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v5
      - uses: actions/setup-python@v6
        with:
          cache: 'pip'
          python-version: "3.12"
      - run: |
          pip install mypy
          mypy .
 

What changed

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.

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:

This workflow runs 3 jobs (22 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow