Skip to content

Commit a4c20b9

Browse files
authored
🚸 Provide CMakePresets.json (#1660)
## Description This PR defines a [`CMakePresets.json`](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) and updates the CI to utilize the defined presets. Fixes #1622 ## Checklist - [x] The pull request only contains commits that are focused and relevant to this change. - [x] I have added appropriate tests that cover the new/changed functionality. - [x] ~~I have updated the documentation to reflect these changes.~~ - [x] I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals. - [x] I have added migration instructions to the upgrade guide (if needed). - [x] The changes follow the project's style guidelines and introduce no new warnings. - [x] The changes are fully tested and pass the CI checks. - [x] I have reviewed my own code changes.
1 parent 8a4e165 commit a4c20b9

6 files changed

Lines changed: 210 additions & 37 deletions

File tree

‎.github/workflows/cd.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
jobs:
1313
build-sdist:
1414
name: 🐍 Packaging
15-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
15+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
1616

1717
# Builds wheels on all supported platforms using cibuildwheel.
1818
# The wheels are uploaded as GitHub artifacts `dev-cibw-*` or `cibw-*`, depending on whether the workflow is triggered from a PR or a release.
@@ -30,7 +30,7 @@ jobs:
3030
windows-2025,
3131
windows-11-arm,
3232
]
33-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
33+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
3434
with:
3535
runs-on: ${{ matrix.runs-on }}
3636

‎.github/workflows/ci.yml‎

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414
jobs:
1515
change-detection:
1616
name: 🔍 Change
17-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-change-detection.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
17+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-change-detection.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
1818

1919
cpp-tests-ubuntu:
2020
name: 🇨‌ Test 🐧
@@ -25,18 +25,18 @@ jobs:
2525
matrix:
2626
runs-on: [ubuntu-24.04, ubuntu-24.04-arm]
2727
compiler: [gcc]
28-
config: [Release]
28+
preset: [release]
2929
include:
3030
- runs-on: ubuntu-24.04
3131
compiler: gcc
32-
config: Debug
33-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
32+
preset: debug
33+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
3434
with:
3535
runs-on: ${{ matrix.runs-on }}
3636
compiler: ${{ matrix.compiler }}
37-
config: ${{ matrix.config }}
3837
setup-mlir: true
3938
llvm-version: 22.1.0
39+
preset-name: ${{ matrix.preset }}
4040

4141
cpp-tests-macos:
4242
name: 🇨‌ Test 🍎
@@ -47,19 +47,18 @@ jobs:
4747
matrix:
4848
runs-on: [macos-26, macos-26-intel]
4949
compiler: [clang]
50-
config: [Release]
50+
preset: [release]
5151
include:
5252
- runs-on: macos-26
5353
compiler: clang
54-
config: Debug
55-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
54+
preset: debug
55+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
5656
with:
5757
runs-on: ${{ matrix.runs-on }}
5858
compiler: ${{ matrix.compiler }}
59-
config: ${{ matrix.config }}
60-
cmake-args: -DMQT_CORE_WITH_GMP=ON
6159
setup-mlir: true
6260
llvm-version: 22.1.0
61+
preset-name: ${{ matrix.preset }}
6362

6463
cpp-tests-windows:
6564
name: 🇨‌ Test 🏁
@@ -70,18 +69,19 @@ jobs:
7069
matrix:
7170
runs-on: [windows-2025, windows-11-arm]
7271
compiler: [msvc]
73-
config: [Release]
72+
preset: [release-windows]
7473
include:
7574
- runs-on: windows-2025
7675
compiler: msvc
77-
config: Debug
78-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
76+
preset: debug-windows
77+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
7978
with:
8079
runs-on: ${{ matrix.runs-on }}
8180
compiler: ${{ matrix.compiler }}
82-
config: ${{ matrix.config }}
8381
setup-mlir: true
8482
llvm-version: 22.1.0
83+
mlir-debug: ${{ matrix.preset == 'debug-windows' }}
84+
preset-name: ${{ matrix.preset }}
8585

8686
# run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label
8787
cpp-tests-extensive-ubuntu:
@@ -93,14 +93,14 @@ jobs:
9393
matrix:
9494
runs-on: [ubuntu-24.04, ubuntu-24.04-arm]
9595
compiler: [gcc, clang, clang-20, clang-21]
96-
config: [Release, Debug]
97-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
96+
preset: [release, debug]
97+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
9898
with:
9999
runs-on: ${{ matrix.runs-on }}
100100
compiler: ${{ matrix.compiler }}
101-
config: ${{ matrix.config }}
102101
setup-mlir: true
103102
llvm-version: 22.1.0
103+
preset-name: ${{ matrix.preset }}
104104

105105
# run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label
106106
cpp-tests-extensive-macos:
@@ -112,15 +112,14 @@ jobs:
112112
matrix:
113113
runs-on: [macos-15, macos-15-intel, macos-26, macos-26-intel]
114114
compiler: [clang, clang-20, clang-21, gcc-14, gcc-15]
115-
config: [Release, Debug]
116-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
115+
preset: [release, debug]
116+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
117117
with:
118118
runs-on: ${{ matrix.runs-on }}
119119
compiler: ${{ matrix.compiler }}
120-
config: ${{ matrix.config }}
121-
cmake-args: -DMQT_CORE_WITH_GMP=ON
122120
setup-mlir: true
123121
llvm-version: 22.1.0
122+
preset-name: ${{ matrix.preset }}
124123

125124
# run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label
126125
cpp-tests-extensive-windows:
@@ -132,20 +131,21 @@ jobs:
132131
matrix:
133132
runs-on: [windows-2022, windows-2025, windows-11-arm]
134133
compiler: [msvc, clang]
135-
config: [Release, Debug]
136-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
134+
preset: [release-windows, debug-windows]
135+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
137136
with:
138137
runs-on: ${{ matrix.runs-on }}
139138
compiler: ${{ matrix.compiler }}
140-
config: ${{ matrix.config }}
141139
setup-mlir: true
142140
llvm-version: 22.1.0
141+
mlir-debug: ${{ matrix.preset == 'debug-windows' }}
142+
preset-name: ${{ matrix.preset }}
143143

144144
cpp-coverage:
145145
name: 🇨‌ Coverage
146146
needs: change-detection
147147
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
148-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-coverage.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
148+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-coverage.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
149149
with:
150150
setup-mlir: true
151151
llvm-version: 22.1.0
@@ -157,9 +157,8 @@ jobs:
157157
name: 🇨‌ Lint
158158
needs: change-detection
159159
if: fromJSON(needs.change-detection.outputs.run-cpp-linter)
160-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-linter.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
160+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-linter.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
161161
with:
162-
cmake-args: -DBUILD_MQT_CORE_BENCHMARKS=ON -DBUILD_MQT_CORE_BINDINGS=ON
163162
clang-version: 22
164163
build-project: true
165164
files-changed-only: true
@@ -184,15 +183,15 @@ jobs:
184183
macos-26-intel,
185184
windows-2025,
186185
]
187-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
186+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
188187
with:
189188
runs-on: ${{ matrix.runs-on }}
190189

191190
python-coverage:
192191
name: 🐍 Coverage
193192
needs: [change-detection, python-tests]
194193
if: fromJSON(needs.change-detection.outputs.run-python-tests)
195-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-coverage.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
194+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-coverage.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
196195
permissions:
197196
contents: read
198197
id-token: write
@@ -206,15 +205,15 @@ jobs:
206205
fail-fast: false
207206
matrix:
208207
runs-on: [macos-15, macos-15-intel, windows-2022]
209-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
208+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
210209
with:
211210
runs-on: ${{ matrix.runs-on }}
212211

213212
python-linter:
214213
name: 🐍 Lint
215214
needs: change-detection
216215
if: fromJSON(needs.change-detection.outputs.run-python-tests)
217-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-linter.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
216+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-linter.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
218217
with:
219218
check-stubs: true
220219
enable-ty: true
@@ -224,7 +223,7 @@ jobs:
224223
name: 🚀 CD
225224
needs: change-detection
226225
if: fromJSON(needs.change-detection.outputs.run-cd)
227-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
226+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
228227

229228
build-wheel:
230229
name: 🚀 CD
@@ -242,7 +241,7 @@ jobs:
242241
windows-2025,
243242
windows-11-arm,
244243
]
245-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
244+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-cibuildwheel.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
246245
with:
247246
runs-on: ${{ matrix.runs-on }}
248247

‎.github/workflows/upstream.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
runs-on: [ubuntu-24.04, macos-14, windows-2022]
22-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-tests.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
22+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-tests.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
2323
with:
2424
runs-on: ${{ matrix.runs-on }}
2525
setup-z3: true
@@ -28,7 +28,7 @@ jobs:
2828
name: Create issue on failure
2929
needs: qiskit-upstream-tests
3030
if: ${{ always() }}
31-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-issue.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
31+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-qiskit-upstream-issue.yml@ae263e66c071e9f0b79f41166577190085c10b27 # v2.0.0
3232
with:
3333
tests-result: ${{ needs.qiskit-upstream-tests.result }}
3434
permissions:

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning], with the exception that minor rel
1111

1212
### Added
1313

14+
- 🚸 Add `debug`, `release`, `coverage`, and `lint` [CMake presets] ([#1660]) ([**@denialhaag**])
1415
- ✨ Add a `quantum-loop-unroll` pass for unrolling for-loop operations containing quantum operations ([#1718]) ([**@MatthiasReumann**])
1516
- ✨ Add a `hadamard-lifting` pass for lifting Hadamard gates above Pauli gates ([#1605]) ([**@lirem101**], [**@burgholzer**])
1617
- ✨ Add a `merge-single-qubit-rotation-gates` pass for merging consecutive rotation gates using quaternions ([#1407], [#1674]) ([**@J4MMlE**], [**@denialhaag**], [**@MatthiasReumann**])
@@ -416,6 +417,7 @@ _📚 Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool
416417
[#1673]: https://github.com/munich-quantum-toolkit/core/pull/1673
417418
[#1664]: https://github.com/munich-quantum-toolkit/core/pull/1664
418419
[#1662]: https://github.com/munich-quantum-toolkit/core/pull/1662
420+
[#1660]: https://github.com/munich-quantum-toolkit/core/pull/1660
419421
[#1652]: https://github.com/munich-quantum-toolkit/core/pull/1652
420422
[#1638]: https://github.com/munich-quantum-toolkit/core/pull/1638
421423
[#1637]: https://github.com/munich-quantum-toolkit/core/pull/1637
@@ -651,3 +653,4 @@ _📚 Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool
651653
[munich-quantum-toolkit]: https://github.com/munich-quantum-toolkit
652654
[PEP 639]: https://peps.python.org/pep-0639/
653655
[PEP 735]: https://peps.python.org/pep-0735/
656+
[CMake presets]: https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html

0 commit comments

Comments
 (0)