diff --git a/.github/workflows/reusable-cpp-coverage.yml b/.github/workflows/reusable-cpp-coverage.yml index adc1abc..7f01650 100644 --- a/.github/workflows/reusable-cpp-coverage.yml +++ b/.github/workflows/reusable-cpp-coverage.yml @@ -22,6 +22,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" @@ -71,9 +75,10 @@ jobs: - name: Set up MLIR if: ${{ inputs.setup-mlir }} - uses: munich-quantum-software/setup-mlir@3f32263ce571a8b745068980f30f188b6e800763 # v1.4.2 + uses: munich-quantum-software/setup-mlir@dae31adab96bf01540439d2d2f8226464294f2f3 with: llvm-version: ${{ inputs.llvm-version }} + assertions: ${{ inputs.mlir-assertions }} - name: Set up sccache if: ${{ inputs.use-sccache-gha }} diff --git a/.github/workflows/reusable-cpp-linter.yml b/.github/workflows/reusable-cpp-linter.yml index af76afa..d767d8e 100644 --- a/.github/workflows/reusable-cpp-linter.yml +++ b/.github/workflows/reusable-cpp-linter.yml @@ -58,6 +58,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 like 'a832a52')" default: "21.1.8" @@ -101,9 +105,10 @@ jobs: - name: Set up MLIR if: ${{ inputs.setup-mlir }} - uses: munich-quantum-software/setup-mlir@3f32263ce571a8b745068980f30f188b6e800763 # v1.4.2 + uses: munich-quantum-software/setup-mlir@dae31adab96bf01540439d2d2f8226464294f2f3 with: llvm-version: ${{ inputs.llvm-version }} + assertions: ${{ inputs.mlir-assertions }} - name: Set up sccache if: ${{ inputs.build-project && inputs.use-sccache-gha }} diff --git a/.github/workflows/reusable-cpp-tests-macos.yml b/.github/workflows/reusable-cpp-tests-macos.yml index 4c680f7..e3ba372 100644 --- a/.github/workflows/reusable-cpp-tests-macos.yml +++ b/.github/workflows/reusable-cpp-tests-macos.yml @@ -41,6 +41,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" @@ -92,9 +96,10 @@ jobs: - name: Set up MLIR if: ${{ inputs.setup-mlir }} - uses: munich-quantum-software/setup-mlir@3f32263ce571a8b745068980f30f188b6e800763 # v1.4.2 + uses: munich-quantum-software/setup-mlir@dae31adab96bf01540439d2d2f8226464294f2f3 with: llvm-version: ${{ inputs.llvm-version }} + assertions: ${{ inputs.mlir-assertions }} - name: Install the latest version of uv uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 diff --git a/.github/workflows/reusable-cpp-tests-ubuntu.yml b/.github/workflows/reusable-cpp-tests-ubuntu.yml index 1580b97..c5867bf 100644 --- a/.github/workflows/reusable-cpp-tests-ubuntu.yml +++ b/.github/workflows/reusable-cpp-tests-ubuntu.yml @@ -41,6 +41,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" @@ -92,9 +96,10 @@ jobs: - name: Set up MLIR if: ${{ inputs.setup-mlir }} - uses: munich-quantum-software/setup-mlir@3f32263ce571a8b745068980f30f188b6e800763 # v1.4.2 + uses: munich-quantum-software/setup-mlir@dae31adab96bf01540439d2d2f8226464294f2f3 with: llvm-version: ${{ inputs.llvm-version }} + assertions: ${{ inputs.mlir-assertions }} - name: Set up mold as linker uses: rui314/setup-mold@7e4f20ad28a2e8ca6fd0892ccf72e2abb706b9c3 # v1 diff --git a/.github/workflows/reusable-cpp-tests-windows.yml b/.github/workflows/reusable-cpp-tests-windows.yml index 4397d43..1738747 100644 --- a/.github/workflows/reusable-cpp-tests-windows.yml +++ b/.github/workflows/reusable-cpp-tests-windows.yml @@ -39,6 +39,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" @@ -167,9 +171,10 @@ jobs: - name: Set up MLIR if: ${{ inputs.setup-mlir }} - uses: munich-quantum-software/setup-mlir@3f32263ce571a8b745068980f30f188b6e800763 # v1.4.2 + uses: munich-quantum-software/setup-mlir@dae31adab96bf01540439d2d2f8226464294f2f3 with: llvm-version: ${{ inputs.llvm-version }} + assertions: ${{ inputs.mlir-assertions }} debug: ${{ inputs.mlir-debug }} - name: Install the latest version of uv diff --git a/.github/workflows/reusable-python-linter.yml b/.github/workflows/reusable-python-linter.yml index cafbd78..0203d31 100644 --- a/.github/workflows/reusable-python-linter.yml +++ b/.github/workflows/reusable-python-linter.yml @@ -30,6 +30,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" @@ -77,9 +81,10 @@ jobs: - name: Set up MLIR if: ${{ inputs.setup-mlir }} - uses: munich-quantum-software/setup-mlir@3f32263ce571a8b745068980f30f188b6e800763 # v1.4.2 + uses: munich-quantum-software/setup-mlir@dae31adab96bf01540439d2d2f8226464294f2f3 with: llvm-version: ${{ inputs.llvm-version }} + assertions: ${{ inputs.mlir-assertions }} - name: Install the latest version of uv uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 diff --git a/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml b/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml index 99452b8..8d0b435 100644 --- a/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml +++ b/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml @@ -15,6 +15,10 @@ on: description: "The runner image to test on" default: "ubuntu-24.04" type: string + use-sccache-gha: + description: "Whether to use sccache with the GitHub Actions cache backend" + default: true + type: boolean setup-z3: description: "Whether to set up Z3" default: false @@ -27,6 +31,14 @@ 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 + xcode-version: + description: "Exact Xcode version for macOS wheel builds; empty uses the runner default" + default: "" + type: string 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" @@ -54,6 +66,11 @@ jobs: name: 🎡 ${{ inputs.runs-on }} runs-on: ${{ inputs.runs-on }} env: + CMAKE_C_COMPILER_LAUNCHER: sccache + CMAKE_CXX_COMPILER_LAUNCHER: sccache + SCCACHE_GHA_ENABLED: ${{ inputs.use-sccache-gha }} + SCCACHE_IDLE_TIMEOUT: 0 + SCCACHE_GHA_RW_MODE: ${{ github.ref == 'refs/heads/main' && 'READ_WRITE' || 'READ_ONLY' }} IQM_TOKEN: ${{ secrets.IQM_TOKEN }} IQM_QC_ALIAS: ${{ secrets.IQM_QC_ALIAS }} AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} @@ -66,6 +83,15 @@ jobs: fetch-depth: 0 persist-credentials: false + - name: Select Xcode + if: ${{ startsWith(inputs.runs-on, 'macos') && inputs.xcode-version != '' }} + env: + XCODE_VERSION: ${{ inputs.xcode-version }} + run: | + developer_dir="/Applications/Xcode_${XCODE_VERSION}.app/Contents/Developer" + test -d "$developer_dir" + echo "DEVELOPER_DIR=$developer_dir" >> "$GITHUB_ENV" + - name: Set up Z3 if: ${{ inputs.setup-z3 && !startsWith(inputs.runs-on, 'ubuntu') }} uses: cda-tum/setup-z3@0401375ea1e34d77ef35bbeb634f6203f3bcde60 # v1.7.3 @@ -74,9 +100,10 @@ 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@dae31adab96bf01540439d2d2f8226464294f2f3 with: llvm-version: ${{ inputs.llvm-version }} + assertions: ${{ inputs.mlir-assertions }} - name: Install the latest version of uv uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 @@ -84,10 +111,8 @@ jobs: 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@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 diff --git a/.github/workflows/reusable-python-tests.yml b/.github/workflows/reusable-python-tests.yml index 68f16fc..885c198 100644 --- a/.github/workflows/reusable-python-tests.yml +++ b/.github/workflows/reusable-python-tests.yml @@ -34,6 +34,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" @@ -183,9 +187,10 @@ jobs: - name: Set up MLIR if: ${{ inputs.setup-mlir }} - uses: munich-quantum-software/setup-mlir@3f32263ce571a8b745068980f30f188b6e800763 # v1.4.2 + uses: munich-quantum-software/setup-mlir@dae31adab96bf01540439d2d2f8226464294f2f3 with: llvm-version: ${{ inputs.llvm-version }} + assertions: ${{ inputs.mlir-assertions }} - name: Set up mold as linker (Linux only) uses: rui314/setup-mold@7e4f20ad28a2e8ca6fd0892ccf72e2abb706b9c3 # v1 diff --git a/.github/workflows/reusable-qiskit-upstream-tests.yml b/.github/workflows/reusable-qiskit-upstream-tests.yml index b74d8ff..ce3f51e 100644 --- a/.github/workflows/reusable-qiskit-upstream-tests.yml +++ b/.github/workflows/reusable-qiskit-upstream-tests.yml @@ -26,6 +26,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" @@ -65,9 +69,10 @@ jobs: - name: Set up MLIR if: ${{ inputs.setup-mlir }} - uses: munich-quantum-software/setup-mlir@3f32263ce571a8b745068980f30f188b6e800763 # v1.4.2 + uses: munich-quantum-software/setup-mlir@dae31adab96bf01540439d2d2f8226464294f2f3 with: llvm-version: ${{ inputs.llvm-version }} + assertions: ${{ inputs.mlir-assertions }} - name: Set up mold as linker uses: rui314/setup-mold@7e4f20ad28a2e8ca6fd0892ccf72e2abb706b9c3 # v1