Skip to content
20 changes: 13 additions & 7 deletions .github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ on:
description: "Whether to set up MLIR"
default: false
type: boolean
mlir-assertions:
description: "Whether the MLIR SDK should retain assertions"
default: true
type: boolean
llvm-version:
description: "The LLVM version to set up (formatted as 'major.minor.patch') or commit hash (minimum 7 characters, e.g., 'a832a52')"
default: "21.1.8"
Expand Down Expand Up @@ -54,6 +58,9 @@ jobs:
name: 🎡 ${{ inputs.runs-on }}
runs-on: ${{ inputs.runs-on }}
env:
CMAKE_C_COMPILER_LAUNCHER: sccache
CMAKE_CXX_COMPILER_LAUNCHER: sccache
SCCACHE_GHA_ENABLED: true
IQM_TOKEN: ${{ secrets.IQM_TOKEN }}
IQM_QC_ALIAS: ${{ secrets.IQM_QC_ALIAS }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
Expand All @@ -74,23 +81,22 @@ jobs:

- name: Set up MLIR
if: ${{ inputs.setup-mlir && !startsWith(inputs.runs-on, 'ubuntu') }}
uses: munich-quantum-software/setup-mlir@3f32263ce571a8b745068980f30f188b6e800763 # v1.4.2
uses: munich-quantum-software/setup-mlir@9750652be0c7c595a8cbcc21769e4300ad599a7e # zizmor: ignore[stale-action-refs] -- Pin PR #255 until its release.
with:
llvm-version: ${{ inputs.llvm-version }}
assertions: ${{ inputs.mlir-assertions }}

- name: Install the latest version of uv
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with:
enable-cache: ${{ !startsWith(inputs.runs-on, 'ubuntu') }}
save-cache: ${{ github.ref == 'refs/heads/main' }}

# set up sccache for faster builds (non-Ubuntu only)
- name: Install sccache
if: ${{ !startsWith(inputs.runs-on, 'ubuntu') }}
run: uv tool install sccache
- name: Set up sccache
uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11

# run cibuildwheel to build wheels for the specified Python version
- uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1
- name: Build wheels
uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1

- name: Verify clean directory
run: git diff --exit-code
Expand Down