Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 33 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,19 @@ jobs:
matrix:
runs-on: [ubuntu-24.04, ubuntu-24.04-arm]
compiler: [gcc]
config: [Release]
preset: [release]
include:
- runs-on: ubuntu-24.04
compiler: gcc
config: Debug
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
preset: debug
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@80e5e0328e04b99131f3f375100611a094399467 # v1.18.1
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
config: ${{ matrix.config }}
setup-mlir: true
llvm-version: 22.1.0
use-cmake-presets: true
preset-name: ${{ matrix.preset }}

cpp-tests-macos:
name: 🇨‌ Test 🍎
Expand All @@ -47,19 +48,19 @@ jobs:
matrix:
runs-on: [macos-26, macos-26-intel]
compiler: [clang]
config: [Release]
preset: [release]
include:
- runs-on: macos-26
compiler: clang
config: Debug
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
preset: debug
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@80e5e0328e04b99131f3f375100611a094399467 # v1.18.1
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
config: ${{ matrix.config }}
cmake-args: -DMQT_CORE_WITH_GMP=ON
setup-mlir: true
llvm-version: 22.1.0
use-cmake-presets: true
preset-name: ${{ matrix.preset }}

cpp-tests-windows:
name: 🇨‌ Test 🏁
Expand All @@ -70,18 +71,19 @@ jobs:
matrix:
runs-on: [windows-2025, windows-11-arm]
compiler: [msvc]
config: [Release]
preset: [windows-release]
include:
- runs-on: windows-2025
compiler: msvc
config: Debug
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
preset: windows-debug
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@80e5e0328e04b99131f3f375100611a094399467 # v1.18.1
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
config: ${{ matrix.config }}
setup-mlir: true
llvm-version: 22.1.0
use-cmake-presets: true
preset-name: ${{ matrix.preset }}

# run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label
cpp-tests-extensive-ubuntu:
Expand All @@ -93,14 +95,15 @@ jobs:
matrix:
runs-on: [ubuntu-24.04, ubuntu-24.04-arm]
compiler: [gcc, clang, clang-20, clang-21]
config: [Release, Debug]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
preset: [release, debug]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-ubuntu.yml@80e5e0328e04b99131f3f375100611a094399467 # v1.18.1
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
config: ${{ matrix.config }}
setup-mlir: true
llvm-version: 22.1.0
use-cmake-presets: true
preset-name: ${{ matrix.preset }}

# run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label
cpp-tests-extensive-macos:
Expand All @@ -112,15 +115,15 @@ jobs:
matrix:
runs-on: [macos-15, macos-15-intel, macos-26, macos-26-intel]
compiler: [clang, clang-20, clang-21, gcc-14, gcc-15]
config: [Release, Debug]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
preset: [release, debug]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-macos.yml@80e5e0328e04b99131f3f375100611a094399467 # v1.18.1
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
config: ${{ matrix.config }}
cmake-args: -DMQT_CORE_WITH_GMP=ON
setup-mlir: true
llvm-version: 22.1.0
use-cmake-presets: true
preset-name: ${{ matrix.preset }}

# run extensive C++ tests on PRs labeled with the `extensive-cpp-ci` label
cpp-tests-extensive-windows:
Expand All @@ -132,23 +135,26 @@ jobs:
matrix:
runs-on: [windows-2022, windows-2025, windows-11-arm]
compiler: [msvc, clang]
config: [Release, Debug]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
preset: [windows-release, windows-debug]
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-tests-windows.yml@80e5e0328e04b99131f3f375100611a094399467 # v1.18.1
with:
runs-on: ${{ matrix.runs-on }}
compiler: ${{ matrix.compiler }}
config: ${{ matrix.config }}
setup-mlir: true
llvm-version: 22.1.0
use-cmake-presets: true
preset-name: ${{ matrix.preset }}

cpp-coverage:
name: 🇨‌ Coverage
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-coverage.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-coverage.yml@80e5e0328e04b99131f3f375100611a094399467 # v1.18.1
with:
setup-mlir: true
llvm-version: 22.1.0
use-cmake-presets: true
preset-name: debug
permissions:
contents: read
id-token: write
Expand All @@ -157,7 +163,7 @@ jobs:
name: 🇨‌ Lint
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-linter)
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-linter.yml@b59d15aa4f266e713afad51e132bde6e3a28a6b3 # v1.18.1
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-cpp-linter.yml@80e5e0328e04b99131f3f375100611a094399467 # v1.18.1
with:
cmake-args: -DBUILD_MQT_CORE_BENCHMARKS=ON -DBUILD_MQT_CORE_BINDINGS=ON
clang-version: 22
Expand All @@ -168,6 +174,8 @@ jobs:
cpp-linter-extra-args: "-std=c++20"
setup-mlir: true
llvm-version: 22.1.0
use-cmake-presets: true
preset-name: debug

python-tests:
name: 🐍 Test
Expand Down
126 changes: 126 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"version": 3,
"configurePresets": [
{
"name": "base",
"hidden": true,
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"MLIR_DIR": "$env(MLIR_DIR)",
"LLVM_DIR": "$env(LLVM_DIR)"
}
Comment on lines +8 to +11
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@burgholzer, I don't really see a better option than this. In FullStaQD/compiler, we do provide paths here, but they are only guaranteed to be valid when using the development container, which doesn't really make the presets generic.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I also do not know a better solution at the top of my head.
A CMakeUserPresets.json file may inherit from the respective presets and override the cache variables with local paths. These files should not be tracked in VCS though.

},
{
"name": "base-ninja",
"hidden": true,
"inherits": "base",
"generator": "Ninja",
"condition": {
"type": "notEquals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "base-windows",
"hidden": true,
"inherits": "base",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "debug",
"inherits": "base-ninja",
"displayName": "Debug config",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"LLVM_ENABLE_ASSERTIONS": "ON"
}
},
{
"name": "release",
"inherits": "base-ninja",
"displayName": "Release config",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "windows-debug",
"inherits": "base-windows",
"displayName": "Windows Debug config",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"LLVM_ENABLE_ASSERTIONS": "ON"
}
},
{
"name": "windows-release",
"inherits": "base-windows",
"displayName": "Windows Release config",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
}
],
"buildPresets": [
{
"name": "debug",
"configurePreset": "debug",
"configuration": "Debug"
},
{
"name": "release",
"configurePreset": "release",
"configuration": "Release"
},
{
"name": "windows-debug",
"configurePreset": "windows-debug",
"configuration": "Debug"
},
{
"name": "windows-release",
"configurePreset": "windows-release",
"configuration": "Release"
}
],
"testPresets": [
{
"name": "base",
"hidden": true,
"output": { "outputOnFailure": true },
"execution": {
"repeat": { "mode": "until-pass", "count": 3 },
"timeout": 600
}
},
{
"name": "debug",
"inherits": "base",
"configurePreset": "debug",
"configuration": "Debug"
},
{
"name": "release",
"inherits": "base",
"configurePreset": "release",
"configuration": "Release"
},
{
"name": "windows-debug",
"inherits": "base",
"configurePreset": "windows-debug",
"configuration": "Debug"
},
{
"name": "windows-release",
"inherits": "base",
"configurePreset": "windows-release",
"configuration": "Release"
}
]
}