name: Wheel smoke

# The release wheel matrix in ci.yml only runs after a version bump has already
# been tagged, so a build change that breaks a wheel target is discovered too
# late to block: the tag exists, upload_pypi is skipped, and the version never
# reaches PyPI. This builds the one target that has actually broken that way
# (manylinux armv7l cp313, emulated) whenever a build input changes on a PR.

on:
  pull_request:
    paths:
      - "build_ext.py"
      - "pyproject.toml"
      - "src/**/*.pyx"
      - "src/**/*.pxd"
      - "src/**/*.h"
      - ".github/workflows/wheel-smoke.yml"
  workflow_dispatch:

permissions:
  contents: read

concurrency:
  group: wheel-smoke-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  armv7l:
    name: manylinux armv7l cp313 wheel
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
        with:
          python-version: "3.12"
      - uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
        with:
          platforms: all
          # Keep in sync with ci.yml's build_wheels job
          # xref https://github.com/docker/setup-qemu-action/issues/188
          image: tonistiigi/binfmt:qemu-v8.1.5
      - uses: pypa/cibuildwheel@4726cd35bb13f7bde50cf2761f2499ac7b3aa32c # v4.1.1
        env:
          CIBW_ARCHS_LINUX: armv7l
          CIBW_BUILD: cp313-manylinux_armv7l
          # Fail the build instead of silently shipping a pure-Python wheel
          REQUIRE_CYTHON: 1
