Skip to content
Latchkey

Build wheels workflow (PythonOT/POT)

The Build wheels workflow from PythonOT/POT, 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: PythonOT/POT.github/workflows/build_wheels.ymlLicense MITView source

What it does

This is the Build wheels workflow from the PythonOT/POT 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: Build wheels

on:
  workflow_dispatch:
  release:
  pull_request:

jobs:
  build_wheels:
    name: ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    if: "contains(github.event.head_commit.message, 'build wheels')"
    strategy:
      matrix:
        os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]

    steps:
    - uses: actions/checkout@v7
      with:
        submodules: true
    - name: Set up Python 3.11
      uses: actions/setup-python@v6
      with:
        python-version: "3.11"

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip setuptools

    - name: Install cibuildwheel
      run: |
        python -m pip install cibuildwheel==3.1.4

    - name: Build wheels
      env:
        CIBW_SKIP: "cp38* cp*musl* *i686 *win32" # remove pypy on mac and win (wrong version)
      run: |
        python -m cibuildwheel --output-dir wheelhouse

    - uses: actions/upload-artifact@v4
      with:
        name: wheels-${{ strategy.job-index }}
        path: ./wheelhouse

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: Build wheels
 
on:
  workflow_dispatch:
  release:
  pull_request:
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  build_wheels:
    timeout-minutes: 30
    name: ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    if: "contains(github.event.head_commit.message, 'build wheels')"
    strategy:
      matrix:
        os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
 
    steps:
    - uses: actions/checkout@v7
      with:
        submodules: true
    - name: Set up Python 3.11
      uses: actions/setup-python@v6
      with:
        cache: 'pip'
        python-version: "3.11"
 
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip setuptools
 
    - name: Install cibuildwheel
      run: |
        python -m pip install cibuildwheel==3.1.4
 
    - name: Build wheels
      env:
        CIBW_SKIP: "cp38* cp*musl* *i686 *win32" # remove pypy on mac and win (wrong version)
      run: |
        python -m cibuildwheel --output-dir wheelhouse
 
    - uses: actions/upload-artifact@v4
      with:
        name: wheels-${{ strategy.job-index }}
        path: ./wheelhouse
 

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