Skip to content
Merged
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
22 changes: 6 additions & 16 deletions .github/workflows/reusable-cpp-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ name: 🇨 • Coverage
on:
workflow_call:
inputs:
cmake-args:
description: "Additional arguments to pass to CMake"
default: "-G Ninja"
type: string
setup-z3:
description: "Whether to set up Z3"
default: false
Expand Down Expand Up @@ -90,24 +86,18 @@ jobs:

- name: Install lit
if: ${{ inputs.setup-mlir }}
run: uv pip install lit
run: |
uv pip install lit
echo "LIT_BIN=$(which lit)" >> $GITHUB_ENV

- name: Configure CMake
env:
CMAKE_ARGS: ${{ inputs.cmake-args }}
SETUP_MLIR: ${{ inputs.setup-mlir }}
run: |
LIT_ARG=""
if [ "$SETUP_MLIR" = "true" ]; then
LIT_ARG="-DLLVM_EXTERNAL_LIT=$(which lit)"
fi
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON $CMAKE_ARGS "$LIT_ARG"
run: cmake --preset coverage

- name: Build
run: cmake --build build --config Debug
run: cmake --build --preset coverage

- name: Test
run: ctest -C Debug --output-on-failure --test-dir build --repeat until-pass:3 --timeout 600
run: ctest --preset coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
Expand Down
18 changes: 2 additions & 16 deletions .github/workflows/reusable-cpp-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ on:
description: "Whether to only lint files that have changed"
default: true
type: boolean
cmake-args:
description: "Additional arguments to pass to CMake"
default: ""
type: string
cpp-linter-extra-args:
description: "Extra arguments to pass to the cpp-linter"
default: "-std=c++17"
Expand Down Expand Up @@ -158,22 +154,12 @@ jobs:
uv pip install "${pkgs_array[@]}"
fi

# generate a compilation database (assumes that the CMake project has `CMAKE_EXPORT_COMPILE_COMMANDS` set)
- name: Generate compilation database
env:
CMAKE_ARGS: ${{ inputs.cmake-args }}
run: |
echo $CC
echo $CXX
$CC --version
$CXX --version
echo $MLIR_DIR
echo $LLVM_DIR
cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=Debug $CMAKE_ARGS
run: cmake --preset lint

- name: Build
if: ${{ inputs.build-project }}
run: cmake --build build --config Debug
run: cmake --build --preset lint
Comment thread
coderabbitai[bot] marked this conversation as resolved.

# runs the cpp-linter action using the generated compilation database and the specified clang version
- name: Run cpp-linter
Expand Down
43 changes: 15 additions & 28 deletions .github/workflows/reusable-cpp-tests-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ on:
This can be any valid macOS runner image, such as 'macos-15', 'macos-26', or 'macos-26-intel'.
default: "macos-latest"
type: string
config:
description: >
The build type to use. Defaults to 'Release'.
This can be any valid CMake build type, such as 'Debug' or 'Release'.
default: "Release"
type: string
compiler:
description: >
The compiler to use. Defaults to 'clang'.
Expand All @@ -31,12 +25,6 @@ on:
A specific version of Clang can be requested via 'clang-XX', where XX is the version number (e.g., 'clang-20').
default: "clang"
type: string
cmake-args:
description: >
Additional arguments to pass to CMake. Defaults to an empty string.
This can be any valid CMake argument, such as '-DBUILD_SHARED_LIBS=ON'.
default: ""
type: string
setup-z3:
description: "Whether to set up Z3"
default: false
Expand All @@ -53,17 +41,21 @@ on:
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"
type: string
preset-name:
description: "The CMake preset to use for configuration and build"
required: true
type: string
Comment thread
coderabbitai[bot] marked this conversation as resolved.

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-cpp-tests-${{ inputs.runs-on }}-${{ inputs.compiler }}-${{ inputs.config }}
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-cpp-tests-${{ inputs.runs-on }}-${{ inputs.compiler }}-${{ inputs.preset-name }}
cancel-in-progress: true

permissions:
contents: read

jobs:
cpp-tests-macos:
name: 🍎 ${{ inputs.runs-on }} ${{ inputs.compiler }} ${{ inputs.config }}
name: 🍎 ${{ inputs.runs-on }} ${{ inputs.compiler }} ${{ inputs.preset-name }}
runs-on: ${{ inputs.runs-on }}
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
Expand Down Expand Up @@ -100,7 +92,9 @@ jobs:

- name: Install lit
if: ${{ inputs.setup-mlir }}
run: uv pip install lit
run: |
uv pip install lit
echo "LIT_BIN=$(which lit)" >> $GITHUB_ENV

- name: Set up GCC
if: ${{ startsWith(inputs.compiler, 'gcc-') }}
Expand Down Expand Up @@ -141,22 +135,15 @@ jobs:

- name: Configure CMake
env:
CONFIG: ${{ inputs.config }}
CMAKE_ARGS: ${{ inputs.cmake-args }}
SETUP_MLIR: ${{ inputs.setup-mlir }}
run: |
LIT_ARG=""
if [ "$SETUP_MLIR" = "true" ]; then
LIT_ARG="-DLLVM_EXTERNAL_LIT=$(which lit)"
fi
cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=$CONFIG $CMAKE_ARGS "$LIT_ARG"
PRESET_NAME: ${{ inputs.preset-name }}
run: cmake --preset "$PRESET_NAME"

- name: Build
env:
CONFIG: ${{ inputs.config }}
run: cmake --build build --config $CONFIG
PRESET_NAME: ${{ inputs.preset-name }}
run: cmake --build --preset "$PRESET_NAME"

- name: Test
env:
CONFIG: ${{ inputs.config }}
run: ctest -C $CONFIG --output-on-failure --test-dir build --repeat until-pass:3 --timeout 600
PRESET_NAME: ${{ inputs.preset-name }}
run: ctest --preset "$PRESET_NAME"
43 changes: 15 additions & 28 deletions .github/workflows/reusable-cpp-tests-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ on:
This can be any valid Ubuntu runner image, such as 'ubuntu-24.04' or its ARM variant 'ubuntu-24.04-arm'.
default: "ubuntu-24.04"
type: string
config:
description: >
The build type to use. Defaults to 'Release'.
This can be any valid CMake build type, such as 'Debug' or 'Release'.
default: "Release"
type: string
compiler:
description: >
The compiler to use. Defaults to 'gcc'.
Expand All @@ -31,12 +25,6 @@ on:
A specific version of Clang can be requested via 'clang-XX', where XX is the version number (e.g., 'clang-20').
default: "gcc"
type: string
cmake-args:
description: >
Additional arguments to pass to CMake. Defaults to an empty string.
This can be any valid CMake argument, such as '-DBUILD_SHARED_LIBS=ON'.
default: ""
type: string
setup-z3:
description: "Whether to set up Z3"
default: false
Expand All @@ -53,17 +41,21 @@ on:
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"
type: string
preset-name:
description: "The CMake preset to use for configuration and build"
required: true
type: string
Comment thread
coderabbitai[bot] marked this conversation as resolved.

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-cpp-tests-${{ inputs.runs-on }}-${{ inputs.compiler }}-${{ inputs.config }}
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-cpp-tests-${{ inputs.runs-on }}-${{ inputs.compiler }}-${{ inputs.preset-name }}
cancel-in-progress: true

permissions:
contents: read

jobs:
cpp-tests-ubuntu:
name: 🐧 ${{ inputs.runs-on }} ${{ inputs.compiler }} ${{ inputs.config }}
name: 🐧 ${{ inputs.runs-on }} ${{ inputs.compiler }} ${{ inputs.preset-name }}
runs-on: ${{ inputs.runs-on }}
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
Expand Down Expand Up @@ -103,7 +95,9 @@ jobs:

- name: Install lit
if: ${{ inputs.setup-mlir }}
run: uv pip install lit
run: |
uv pip install lit
echo "LIT_BIN=$(which lit)" >> $GITHUB_ENV

- name: Set up default Clang
if: ${{ inputs.compiler == 'clang' }}
Expand Down Expand Up @@ -141,22 +135,15 @@ jobs:

- name: Configure CMake
env:
CONFIG: ${{ inputs.config }}
CMAKE_ARGS: ${{ inputs.cmake-args }}
SETUP_MLIR: ${{ inputs.setup-mlir }}
run: |
LIT_ARG=""
if [ "$SETUP_MLIR" = "true" ]; then
LIT_ARG="-DLLVM_EXTERNAL_LIT=$(which lit)"
fi
cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=$CONFIG $CMAKE_ARGS "$LIT_ARG"
PRESET_NAME: ${{ inputs.preset-name }}
run: cmake --preset "$PRESET_NAME"

- name: Build
env:
CONFIG: ${{ inputs.config }}
run: cmake --build build --config $CONFIG
PRESET_NAME: ${{ inputs.preset-name }}
run: cmake --build --preset "$PRESET_NAME"

- name: Test
env:
CONFIG: ${{ inputs.config }}
run: ctest -C $CONFIG --output-on-failure --test-dir build --repeat until-pass:3 --timeout 600
PRESET_NAME: ${{ inputs.preset-name }}
run: ctest --preset "$PRESET_NAME"
50 changes: 20 additions & 30 deletions .github/workflows/reusable-cpp-tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,13 @@ on:
This can be any valid Windows runner image, such as 'windows-2022' or 'windows-2025'.
default: "windows-latest"
type: string
config:
description: >
The build type to use. Defaults to 'Release'.
This can be any valid CMake build type, such as 'Debug' or 'Release'.
default: "Release"
type: string
compiler:
description: >
The compiler to use. Defaults to 'msvc'.
This can be 'msvc' or 'clang'.
If 'clang' is selected, '-T ClangCL' is automatically added to the CMake arguments.
default: "msvc"
type: string
cmake-args:
description: >
Additional arguments to pass to CMake. Defaults to an empty string.
This can be any valid CMake argument, such as '-DBUILD_SHARED_LIBS=ON'.
default: ""
type: string
setup-z3:
description: "Whether to set up Z3"
default: false
Expand All @@ -51,9 +39,17 @@ on:
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"
type: string
mlir-debug:
description: "Whether to use a debug build of MLIR"
default: false
type: boolean
preset-name:
description: "The CMake preset to use for configuration and build"
required: true
type: string
Comment thread
coderabbitai[bot] marked this conversation as resolved.

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-cpp-tests-${{ inputs.runs-on }}-${{ inputs.compiler }}-${{ inputs.config }}
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-cpp-tests-${{ inputs.runs-on }}-${{ inputs.compiler }}-${{ inputs.preset-name }}
cancel-in-progress: true

permissions:
Expand All @@ -65,7 +61,7 @@ defaults:

jobs:
cpp-tests-windows:
name: 🏁 ${{ inputs.runs-on }} ${{ inputs.compiler }} ${{ inputs.config }}
name: 🏁 ${{ inputs.runs-on }} ${{ inputs.compiler }} ${{ inputs.preset-name }}
runs-on: ${{ inputs.runs-on }}
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
Expand All @@ -89,7 +85,7 @@ jobs:
uses: munich-quantum-software/setup-mlir@883c1e05e60abbc215e967cde7d3ca7fde378e8d # v1.3.1
with:
llvm-version: ${{ inputs.llvm-version }}
debug: ${{ inputs.config == 'Debug' }}
debug: ${{ inputs.mlir-debug }}

- name: Install the latest version of uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
Expand All @@ -100,28 +96,22 @@ jobs:

- name: Install lit
if: ${{ inputs.setup-mlir }}
run: uv pip install lit
run: |
uv pip install lit
echo "LIT_BIN=$GITHUB_WORKSPACE/.venv/Scripts/lit.exe" >> $GITHUB_ENV

- name: Configure CMake
env:
CONFIG: ${{ inputs.config }}
CMAKE_ARGS: ${{ inputs.cmake-args }}
COMPILER: ${{ inputs.compiler }}
LIT_ARG: ${{ inputs.setup-mlir && format('-DLLVM_EXTERNAL_LIT={0}/.venv/Scripts/lit.exe', github.workspace) || '' }}
run: |
cmake_args=$CMAKE_ARGS
if [ "$COMPILER" == "clang" ]; then
cmake_args="$cmake_args -T ClangCL"
fi
cmake -S . -B build -DCMAKE_BUILD_TYPE=$CONFIG $cmake_args $LIT_ARG
PRESET_NAME: ${{ inputs.preset-name }}
run: cmake --preset "$PRESET_NAME"

- name: Build
timeout-minutes: 60
env:
CONFIG: ${{ inputs.config }}
run: cmake --build build --config $CONFIG
PRESET_NAME: ${{ inputs.preset-name }}
run: cmake --build --preset "$PRESET_NAME"

- name: Test
env:
CONFIG: ${{ inputs.config }}
run: ctest -C $CONFIG --output-on-failure --test-dir build --repeat until-pass:3 --timeout 600
PRESET_NAME: ${{ inputs.preset-name }}
run: ctest --preset "$PRESET_NAME"
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ This project adheres to [Semantic Versioning], with the exception that minor rel

## [Unreleased]

## [2.0.0] - 2026-05-22

_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md#200)._

### Changed

- 🚸 Adapt C++ workflows to require [CMake presets] ([#363]) ([**@denialhaag**])
- ♻️ Add `mlir-debug` flag to the `reusable-cpp-tests-windows` workflow for requesting a debug build of MLIR ([#363]) ([**@denialhaag**])

## [1.18.1] - 2026-04-09

_If you are upgrading: please see [`UPGRADING.md`](UPGRADING.md#1181)._
Expand Down Expand Up @@ -303,7 +312,8 @@ _📚 Refer to the [GitHub Release Notes] for previous changelogs._

<!-- Version links -->

[unreleased]: https://github.com/munich-quantum-toolkit/workflows/compare/v1.18.1...HEAD
[unreleased]: https://github.com/munich-quantum-toolkit/workflows/compare/v2.0.0...HEAD
[2.0.0]: https://github.com/munich-quantum-toolkit/workflows/releases/tag/v2.0.0
[1.18.1]: https://github.com/munich-quantum-toolkit/workflows/releases/tag/v1.18.1
[1.18.0]: https://github.com/munich-quantum-toolkit/workflows/releases/tag/v1.18.0
[1.17.15]: https://github.com/munich-quantum-toolkit/workflows/releases/tag/v1.17.15
Expand Down Expand Up @@ -337,6 +347,7 @@ _📚 Refer to the [GitHub Release Notes] for previous changelogs._

<!-- PR links -->

[#363]: https://github.com/munich-quantum-toolkit/workflows/pull/363
[#356]: https://github.com/munich-quantum-toolkit/workflows/pull/356
[#344]: https://github.com/munich-quantum-toolkit/workflows/pull/344
[#343]: https://github.com/munich-quantum-toolkit/workflows/pull/343
Expand Down Expand Up @@ -397,3 +408,4 @@ _📚 Refer to the [GitHub Release Notes] for previous changelogs._
[Semantic Versioning]: https://semver.org/spec/v2.0.0.html
[GitHub Release Notes]: https://github.com/munich-quantum-toolkit/workflows/releases
[munich-quantum-software/setup-mlir]: https://github.com/munich-quantum-software/setup-mlir
[CMake presets]: https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html
Loading