Skip to content
Latchkey

CI workflow (mwaskom/seaborn)

The CI workflow from mwaskom/seaborn, explained and optimized by Latchkey.

C

CI health: C - fair

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

Grade your own workflow free or run it on Latchkey →
Source: mwaskom/seaborn.github/workflows/ci.yamlLicense BSD-3-ClauseView source

What it does

This is the CI workflow from the mwaskom/seaborn 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: CI

on:
  push:
    branches: [master, v0.*]
  pull_request:
    branches: master
  schedule:
    - cron:  '0 6 * * 1,4' # Each Monday and Thursday at 06:00 UTC
  workflow_dispatch:

permissions:
  contents: read

env:
  NB_KERNEL: python
  MPLBACKEND: Agg
  SEABORN_DATA: ${{ github.workspace }}/seaborn-data
  PYDEVD_DISABLE_FILE_VALIDATION: 1

jobs:
  build-docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

      - name: Install uv
        uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
        with:
          enable-cache: true

      - name: Install seaborn
        run: uv sync --python 3.13 --no-default-groups --extra stats --group docs

      - name: Install pandoc
        run: |
          wget https://github.com/jgm/pandoc/releases/download/3.1.11/pandoc-3.1.11-1-amd64.deb
          sudo dpkg -i pandoc-3.1.11-1-amd64.deb

      - name: Cache datasets
        run: |
          git clone https://github.com/mwaskom/seaborn-data.git
          ls $SEABORN_DATA

      - name: Build docs
        run: make docs


  run-tests:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
        install: [full]
        deps: [latest]

        include:
          - python: "3.10"
            install: full
            deps: pinned
          - python: "3.13"
            install: light
            deps: latest

    steps:
      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

      - name: Install uv
        uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
        with:
          enable-cache: true

      - name: Install seaborn
        run: |
          # full installs the optional stats dependencies; light omits them.
          # latest resolves the newest compatible releases (default), while
          # pinned resolves the minimum versions declared in pyproject.toml.
          EXTRA=""; if [[ ${{ matrix.install }} == 'full' ]]; then EXTRA='--extra stats'; fi
          RES="";   if [[ ${{ matrix.deps }} == 'pinned' ]]; then RES='--resolution lowest-direct'; fi
          uv sync --python ${{ matrix.python }} --no-default-groups --group test $EXTRA $RES

      - name: Run tests
        run: make test

      - name: Upload coverage
        uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
        if: ${{ success() }}

  lint:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:

      - name: Checkout
        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

      - name: Install uv
        uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
        with:
          enable-cache: true

      - name: Install tools
        # ruff needs no project dependencies, so install it in isolation.
        run: uv sync --only-group lint

      - name: Lint
        run: make lint

  typecheck:
    runs-on: ubuntu-latest
    steps:

      - name: Checkout
        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

      - name: Install uv
        uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
        with:
          enable-cache: true

      - name: Install tools
        run: uv sync --python 3.13 --no-default-groups --extra stats --group typecheck

      - name: Type checking
        run: make typecheck

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: CI
 
on:
  push:
    branches: [master, v0.*]
  pull_request:
    branches: master
  schedule:
    - cron:  '0 6 * * 1,4' # Each Monday and Thursday at 06:00 UTC
  workflow_dispatch:
 
permissions:
  contents: read
 
env:
  NB_KERNEL: python
  MPLBACKEND: Agg
  SEABORN_DATA: ${{ github.workspace }}/seaborn-data
  PYDEVD_DISABLE_FILE_VALIDATION: 1
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  build-docs:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
 
      - name: Install uv
        uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
        with:
          enable-cache: true
 
      - name: Install seaborn
        run: uv sync --python 3.13 --no-default-groups --extra stats --group docs
 
      - name: Install pandoc
        run: |
          wget https://github.com/jgm/pandoc/releases/download/3.1.11/pandoc-3.1.11-1-amd64.deb
          sudo dpkg -i pandoc-3.1.11-1-amd64.deb
 
      - name: Cache datasets
        run: |
          git clone https://github.com/mwaskom/seaborn-data.git
          ls $SEABORN_DATA
 
      - name: Build docs
        run: make docs
 
 
  run-tests:
    timeout-minutes: 30
    runs-on: latchkey-small
 
    strategy:
      matrix:
        python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
        install: [full]
        deps: [latest]
 
        include:
          - python: "3.10"
            install: full
            deps: pinned
          - python: "3.13"
            install: light
            deps: latest
 
    steps:
      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
 
      - name: Install uv
        uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
        with:
          enable-cache: true
 
      - name: Install seaborn
        run: |
          # full installs the optional stats dependencies; light omits them.
          # latest resolves the newest compatible releases (default), while
          # pinned resolves the minimum versions declared in pyproject.toml.
          EXTRA=""; if [[ ${{ matrix.install }} == 'full' ]]; then EXTRA='--extra stats'; fi
          RES="";   if [[ ${{ matrix.deps }} == 'pinned' ]]; then RES='--resolution lowest-direct'; fi
          uv sync --python ${{ matrix.python }} --no-default-groups --group test $EXTRA $RES
 
      - name: Run tests
        run: make test
 
      - name: Upload coverage
        uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
        if: ${{ success() }}
 
  lint:
    timeout-minutes: 30
    runs-on: latchkey-small
    strategy:
      fail-fast: false
    steps:
 
      - name: Checkout
        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
 
      - name: Install uv
        uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
        with:
          enable-cache: true
 
      - name: Install tools
        # ruff needs no project dependencies, so install it in isolation.
        run: uv sync --only-group lint
 
      - name: Lint
        run: make lint
 
  typecheck:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
 
      - name: Checkout
        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
 
      - name: Install uv
        uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
        with:
          enable-cache: true
 
      - name: Install tools
        run: uv sync --python 3.13 --no-default-groups --extra stats --group typecheck
 
      - name: Type checking
        run: make typecheck
 

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 4 jobs (8 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