Skip to content
Latchkey

CI workflow (CamDavidsonPilon/lifelines)

The CI workflow from CamDavidsonPilon/lifelines, explained and optimized by Latchkey.

D

CI health: D - needs work

Run this on Latchkey for self-healing, caching, and up to 58% lower cost.

Grade your own workflow free or run it on Latchkey →
Source: CamDavidsonPilon/lifelines.github/workflows/ci.yamlLicense MITView source

What it does

This is the CI workflow from the CamDavidsonPilon/lifelines 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

workflow (.yml)
name: CI

on:
  pull_request:
  push:
    branches:
      - master
  workflow_dispatch:

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: ["ubuntu-latest"]
        python-version: ["3.11", "3.12", "3.13", "3.14"]
        numpy-version: ["2.2.6", "2.3.5", "2.4.2"]
        exclude:
          - python-version: "3.14"
            numpy-version: "2.2.6"

    steps:
      - name: Checkout source
        uses: actions/checkout@v6

      - name: Setup python
        uses: actions/setup-python@v6
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install
        run: |
          pip install "numpy==${{ matrix.numpy-version }}"
          pip install -e .
          pip install -r reqs/dev-requirements.txt

      - name: Run tests
        run: pytest lifelines/tests/ -vv

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:
  pull_request:
  push:
    branches:
      - master
  workflow_dispatch:
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  test:
    timeout-minutes: 30
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: ["ubuntu-latest"]
        python-version: ["3.11", "3.12", "3.13", "3.14"]
        numpy-version: ["2.2.6", "2.3.5", "2.4.2"]
        exclude:
          - python-version: "3.14"
            numpy-version: "2.2.6"
 
    steps:
      - name: Checkout source
        uses: actions/checkout@v6
 
      - name: Setup python
        uses: actions/setup-python@v6
        with:
          cache: 'pip'
          python-version: ${{ matrix.python-version }}
 
      - name: Install
        run: |
          pip install "numpy==${{ matrix.numpy-version }}"
          pip install -e .
          pip install -r reqs/dev-requirements.txt
 
      - name: Run tests
        run: pytest lifelines/tests/ -vv
 

What changed

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 1 job (12 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