diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml new file mode 100644 index 0000000..460fe46 --- /dev/null +++ b/.github/workflows/downstream.yml @@ -0,0 +1,179 @@ +# Copyright (c) 2023 - 2025 Chair for Design Automation, TUM +# Copyright (c) 2025 Munich Quantum Software Company GmbH +# All rights reserved. +# +# SPDX-License-Identifier: MIT +# +# Licensed under the MIT License + +name: Downstream Tests +on: + push: + branches: + - main + pull_request: + merge_group: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + downstream-cpp-test: + strategy: + matrix: + package: + - { user: munich-quantum-toolkit, repo: core, setup-z3: false } + - { user: cda-tum, repo: mqt-qcec, setup-z3: false } + - { user: cda-tum, repo: mqt-qmap, setup-z3: true } + - { user: cda-tum, repo: mqt-ddsim, setup-z3: false } + name: ${{ matrix.package.user }}/${{ matrix.package.repo }} • 🇨‌ • CI + permissions: + contents: read + uses: ./.github/workflows/reusable-cpp-ci.yml + with: + repository: ${{ matrix.package.user }}/${{ matrix.package.repo }} + setup-z3: ${{ matrix.package.setup-z3 }} + # enable running on all supported combinations + enable-ubuntu2404-gcc-release: true + enable-ubuntu2404-arm-gcc-release: true + enable-macos13-clang-release: true + enable-macos14-clang-release: true + enable-windows2022-msvc-release: true + enable-ubuntu2404-gcc-debug: true + enable-ubuntu2404-clang-release: true + enable-ubuntu2404-clang-debug: true + enable-ubuntu2204-gcc-release: true + enable-ubuntu2204-gcc-debug: true + enable-ubuntu2204-clang-release: true + enable-ubuntu2204-clang-debug: true + enable-ubuntu2404-arm-gcc-debug: true + enable-ubuntu2404-arm-clang-release: true + enable-ubuntu2404-arm-clang-debug: true + enable-ubuntu2204-arm-gcc-release: true + enable-ubuntu2204-arm-gcc-debug: true + enable-ubuntu2204-arm-clang-release: true + enable-ubuntu2204-arm-clang-debug: true + enable-macos13-clang-debug: true + enable-macos13-gcc-release: true + enable-macos13-gcc-debug: true + enable-macos14-clang-debug: true + enable-macos14-gcc-release: true + enable-macos14-gcc-debug: true + enable-macos15-clang-release: true + enable-macos15-clang-debug: true + enable-macos15-gcc-release: true + enable-macos15-gcc-debug: true + enable-windows2022-msvc-debug: true + enable-windows2022-clang-release: true + enable-windows2022-clang-debug: true + enable-windows2025-msvc-release: true + enable-windows2025-msvc-debug: true + enable-windows2025-clang-release: true + enable-windows2025-clang-debug: true + + downstream-python-test: + strategy: + matrix: + package: + - { user: munich-quantum-toolkit, repo: core, setup-z3: false } + - { user: cda-tum, repo: mqt-qcec, setup-z3: false } + - { user: cda-tum, repo: mqt-qmap, setup-z3: true } + - { user: cda-tum, repo: mqt-ddsim, setup-z3: false } + - { user: cda-tum, repo: mqt-bench, setup-z3: false } + name: ${{ matrix.package.user }}/${{ matrix.package.repo }} • 🐍‌ • CI + permissions: + contents: read + id-token: write + uses: ./.github/workflows/reusable-python-ci.yml + with: + repository: ${{ matrix.package.user }}/${{ matrix.package.repo }} + setup-z3: ${{ matrix.package.setup-z3 }} + upload-coverage: false + # enable running on all supported combinations + enable-ubuntu2404: true + enable-ubuntu2204: true + enable-ubuntu2404-arm: true + enable-ubuntu2204-arm: true + enable-macos13: true + enable-macos14: true + enable-macos15: true + enable-windows2022: true + enable-windows2025: true + # testing Python on Windows 11 ARM is not supported by the ecosystem at the moment + enable-windows11-arm: false + + downstream-python-linter: + strategy: + matrix: + package: + - { user: munich-quantum-toolkit, repo: core, setup-z3: false } + - { user: cda-tum, repo: mqt-qcec, setup-z3: false } + - { user: cda-tum, repo: mqt-qmap, setup-z3: true } + - { user: cda-tum, repo: mqt-ddsim, setup-z3: false } + - { user: cda-tum, repo: mqt-bench, setup-z3: false } + name: ${{ matrix.package.user }}/${{ matrix.package.repo }} • 🐍‌ • Lint + permissions: + contents: read + uses: ./.github/workflows/reusable-python-linter.yml + with: + repository: ${{ matrix.package.user }}/${{ matrix.package.repo }} + setup-z3: ${{ matrix.package.setup-z3 }} + + downstream-python-packaging: + strategy: + matrix: + package: + - { + user: munich-quantum-toolkit, + repo: core, + setup-z3: false, + pure-python: false, + } + - { + user: cda-tum, + repo: mqt-qcec, + setup-z3: false, + pure-python: false, + } + - { + user: cda-tum, + repo: mqt-qmap, + setup-z3: true, + pure-python: false, + } + - { + user: cda-tum, + repo: mqt-ddsim, + setup-z3: false, + pure-python: false, + } + - { + user: cda-tum, + repo: mqt-bench, + setup-z3: false, + pure-python: true, + } + name: ${{ matrix.package.user }}/${{ matrix.package.repo }} • 🐍‌ • Packaging + permissions: + contents: read + uses: ./.github/workflows/reusable-python-packaging.yml + with: + repository: ${{ matrix.package.user }}/${{ matrix.package.repo }} + upload-artifacts: false + setup-z3: ${{ matrix.package.setup-z3 }} + pure-python: ${{ matrix.package.pure-python }} + # enable running on all supported combinations + enable-ubuntu2404: true + enable-ubuntu2404-arm: true + enable-macos13: true + enable-macos14: true + enable-windows2022: true + # disable commonly unused runners for packaging + enable-ubuntu2204: true + enable-ubuntu2204-arm: true + enable-macos15: false + enable-windows2025: false + # Only select MQT packages currently support packaging on Windows 11 ARM + enable-windows11-arm: false diff --git a/.github/workflows/reusable-cpp-ci.yml b/.github/workflows/reusable-cpp-ci.yml index 08c6804..87183ae 100644 --- a/.github/workflows/reusable-cpp-ci.yml +++ b/.github/workflows/reusable-cpp-ci.yml @@ -11,6 +11,12 @@ on: workflow_call: inputs: ###---- General inputs ----------------------------------------------------------------------------------------### + repository: + description: > + The repository to run this action on. + Defaults to the repository this workflow is running in (`github.repository`). + default: ${{ github.repository }} + type: string cmake-args: description: > Additional arguments to pass to CMake on every OS. Defaults to an empty string. @@ -386,6 +392,7 @@ jobs: fail-fast: false uses: ./.github/workflows/reusable-cpp-tests-ubuntu.yml with: + repository: ${{ inputs.repository }} runs-on: ${{ matrix.runs-on }} compiler: ${{ matrix.compiler }} config: ${{ matrix.config }} @@ -403,6 +410,7 @@ jobs: fail-fast: false uses: ./.github/workflows/reusable-cpp-tests-macos.yml with: + repository: ${{ inputs.repository }} runs-on: ${{ matrix.runs-on }} compiler: ${{ matrix.compiler }} config: ${{ matrix.config }} @@ -420,6 +428,7 @@ jobs: fail-fast: false uses: ./.github/workflows/reusable-cpp-tests-windows.yml with: + repository: ${{ inputs.repository }} runs-on: ${{ matrix.runs-on }} compiler: ${{ matrix.compiler }} config: ${{ matrix.config }} diff --git a/.github/workflows/reusable-cpp-tests-macos.yml b/.github/workflows/reusable-cpp-tests-macos.yml index ac29875..29550a3 100644 --- a/.github/workflows/reusable-cpp-tests-macos.yml +++ b/.github/workflows/reusable-cpp-tests-macos.yml @@ -10,6 +10,12 @@ name: 🇨 • Tests • macos on: workflow_call: inputs: + repository: + description: > + The repository to run this action on. + Defaults to the repository this workflow is running in (`github.repository`). + default: ${{ github.repository }} + type: string runs-on: description: > The macOS runner image to use. Defaults to 'macos-latest'. @@ -57,6 +63,7 @@ jobs: # check out the repository (including submodules and all history) - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: + repository: ${{ inputs.repository }} submodules: recursive fetch-depth: 0 # optionally set up Z3 diff --git a/.github/workflows/reusable-cpp-tests-ubuntu.yml b/.github/workflows/reusable-cpp-tests-ubuntu.yml index 53911ad..b709b98 100644 --- a/.github/workflows/reusable-cpp-tests-ubuntu.yml +++ b/.github/workflows/reusable-cpp-tests-ubuntu.yml @@ -10,6 +10,12 @@ name: 🇨 • Tests • ubuntu on: workflow_call: inputs: + repository: + description: > + The repository to run this action on. + Defaults to the repository this workflow is running in (`github.repository`). + default: ${{ github.repository }} + type: string runs-on: description: > The ubuntu runner image to use. Defaults to 'ubuntu-latest'. @@ -57,6 +63,7 @@ jobs: # check out the repository (including submodules and all history) - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: + repository: ${{ inputs.repository }} submodules: recursive fetch-depth: 0 # optionally set up Z3 diff --git a/.github/workflows/reusable-cpp-tests-windows.yml b/.github/workflows/reusable-cpp-tests-windows.yml index 4414d4d..d411490 100644 --- a/.github/workflows/reusable-cpp-tests-windows.yml +++ b/.github/workflows/reusable-cpp-tests-windows.yml @@ -10,6 +10,12 @@ name: 🇨 • Tests • windows on: workflow_call: inputs: + repository: + description: > + The repository to run this action on. + Defaults to the repository this workflow is running in (`github.repository`). + default: ${{ github.repository }} + type: string runs-on: description: > The Windows runner image to use. Defaults to 'windows-latest'. @@ -60,6 +66,7 @@ jobs: # check out the repository (including submodules and all history) - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: + repository: ${{ inputs.repository }} submodules: recursive fetch-depth: 0 # optionally set up Z3 diff --git a/.github/workflows/reusable-python-ci.yml b/.github/workflows/reusable-python-ci.yml index 7cf6933..74485ea 100644 --- a/.github/workflows/reusable-python-ci.yml +++ b/.github/workflows/reusable-python-ci.yml @@ -12,6 +12,16 @@ on: workflow_call: inputs: ###---- General inputs ----------------------------------------------------------------------------------------### + repository: + description: > + The repository to run this action on. + Defaults to the repository this workflow is running in (`github.repository`). + default: ${{ github.repository }} + type: string + upload-coverage: + description: "Whether to upload the generated coverage reports" + default: true + type: boolean setup-z3: description: "Whether to set up Z3" default: false @@ -130,12 +140,15 @@ jobs: include: ${{ fromJson(needs.build-matrix.outputs.matrix) }} uses: ./.github/workflows/reusable-python-tests.yml with: + repository: ${{ inputs.repository }} + upload-coverage: ${{ inputs.upload-coverage }} runs-on: ${{ matrix.runs-on }} setup-z3: ${{ inputs.setup-z3 }} z3-version: ${{ inputs.z3-version }} python-coverage-upload: name: 📈 + if: ${{ inputs.upload-coverage }} needs: [python-tests] runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/reusable-python-linter.yml b/.github/workflows/reusable-python-linter.yml index f595fd7..c1c9075 100644 --- a/.github/workflows/reusable-python-linter.yml +++ b/.github/workflows/reusable-python-linter.yml @@ -10,6 +10,12 @@ name: 🐍 • Lint on: workflow_call: inputs: + repository: + description: > + The repository to run this action on. + Defaults to the repository this workflow is running in (`github.repository`). + default: ${{ github.repository }} + type: string setup-z3: description: "Whether to set up Z3" default: false @@ -28,6 +34,7 @@ jobs: # check out the repository (including submodules and all history) - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: + repository: ${{ inputs.repository }} submodules: recursive fetch-depth: 0 # optionally set up Z3 diff --git a/.github/workflows/reusable-python-packaging.yml b/.github/workflows/reusable-python-packaging.yml index d84e408..dffe37e 100644 --- a/.github/workflows/reusable-python-packaging.yml +++ b/.github/workflows/reusable-python-packaging.yml @@ -12,6 +12,16 @@ on: workflow_call: inputs: ###---- General inputs ----------------------------------------------------------------------------------------### + repository: + description: > + The repository to run this action on. + Defaults to the repository this workflow is running in (`github.repository`). + default: ${{ github.repository }} + type: string + upload-artifacts: + description: "Whether to upload the generated artifacts" + default: true + type: boolean pure-python: description: "Whether this is a pure Python package (or contains compiled extensions)" default: false @@ -90,6 +100,7 @@ jobs: # check out the repository (including submodules and all history) - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: + repository: ${{ inputs.repository }} submodules: recursive fetch-depth: 0 # set up uv for faster Python package management @@ -103,6 +114,7 @@ jobs: run: uvx twine check dist/* # upload the source distribution as an artifact (adds a `dev-` prefix for PRs) - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + if: ${{ inputs.upload-artifacts }} with: name: ${{ github.event_name == 'pull_request' && 'dev-' || '' }}cibw-sdist path: dist/*.tar.gz @@ -115,6 +127,7 @@ jobs: # check out the repository (including submodules and all history) - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: + repository: ${{ inputs.repository }} submodules: recursive fetch-depth: 0 # set up uv for faster Python package management @@ -128,6 +141,7 @@ jobs: run: uvx twine check dist/* # upload the wheel as an artifact (adds a `dev-` prefix for PRs) - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + if: ${{ inputs.upload-artifacts }} with: name: ${{ github.event_name == 'pull_request' && 'dev-' || '' }}cibw-wheel path: dist/*.whl @@ -188,6 +202,7 @@ jobs: # check out the repository (including submodules and all history) - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: + repository: ${{ inputs.repository }} submodules: recursive fetch-depth: 0 # optionally set up Z3 (non-Ubuntu only) @@ -217,6 +232,7 @@ jobs: # upload the wheels as an artifact (adds a `dev-` prefix for PRs) - name: Upload wheels uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 + if: ${{ inputs.upload-artifacts }} with: name: ${{ github.event_name == 'pull_request' && 'dev-' || '' }}cibw-wheels-${{ matrix.runs-on }}-${{ strategy.job-index }} path: wheelhouse/*.whl diff --git a/.github/workflows/reusable-python-tests.yml b/.github/workflows/reusable-python-tests.yml index 21a69ff..8d8f4a3 100644 --- a/.github/workflows/reusable-python-tests.yml +++ b/.github/workflows/reusable-python-tests.yml @@ -10,6 +10,16 @@ name: 🐍 • Tests on: workflow_call: inputs: + repository: + description: > + The repository to run this action on. + Defaults to the repository this workflow is running in (`github.repository`). + default: ${{ github.repository }} + type: string + upload-coverage: + description: "Whether to upload the generated coverage reports" + default: true + type: boolean runs-on: description: "The platform to run the tests on" required: true @@ -34,6 +44,7 @@ jobs: # check out the repository (including submodules and all history) - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: + repository: ${{ inputs.repository }} submodules: recursive fetch-depth: 0 # optionally set up Z3 @@ -70,6 +81,7 @@ jobs: run: uvx nox -s tests --verbose -- --cov --cov-report=xml:coverage-${{ inputs.runs-on }}.xml --cov-append # upload the report as an artifact to GitHub so that it can later be uploaded to Codecov - name: Upload 🐍 coverage report for ${{ inputs.runs-on }} + if: ${{ inputs.upload-coverage }} uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: coverage-${{ inputs.runs-on }}