Skip to content

Commit

Permalink
Merge branch 'main' into approximate-equivalence-checking
Browse files Browse the repository at this point in the history
  • Loading branch information
burgholzer authored Feb 18, 2025
2 parents b92d53e + 6802cfd commit 97b0da8
Show file tree
Hide file tree
Showing 107 changed files with 6,830 additions and 5,930 deletions.
41 changes: 6 additions & 35 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: CD
name: CD 🚀
on:
push:
branches: [main]
release:
types: [published]
workflow_dispatch:
Expand All @@ -13,36 +11,11 @@ permissions:

jobs:
# Builds the sdist and wheels on all supported platforms and uploads the resulting
# wheels as GitHub artifacts `dev-cibw-*`, `test-cibw-*`, or `cibw-*`, depending on
# whether the workflow is triggered from a PR, a push to main, or a release, respectively.
# wheels as GitHub artifacts `dev-cibw-*` or `cibw-*`, depending on whether the
# workflow is triggered from a PR or a release, respectively.
python-packaging:
name: 🐍 Packaging
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.4
with:
# Do not include local version information on pushes to main to facilitate TestPyPI uploads.
no-local-version: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
# Do not build emulated wheels on pushes to main to reduce runner load for CD.
build-emulated-wheels: ${{ github.ref != 'refs/heads/main' || github.event_name != 'push' }}

# Downloads the previously generated artifacts and deploys to TestPyPI on pushes to main
deploy-test-pypi:
name: 🚀 Deploy to Test PyPI
runs-on: ubuntu-latest
environment:
name: test-pypi
url: https://test.pypi.org/p/mqt.qcec
needs: [python-packaging]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/download-artifact@v4
with:
pattern: test-cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
attestations: true
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.7

# Downloads the previously generated artifacts and deploys to PyPI on published releases.
deploy:
Expand All @@ -59,10 +32,8 @@ jobs:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Generate artifact attestation for sdist and wheel(s)
uses: actions/attest-build-provenance@v1.4.3
- name: Generate artifact attestation for sdist and wheels
uses: actions/attest-build-provenance@v2
with:
subject-path: "dist/*"
- uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
167 changes: 157 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,182 @@ concurrency:
jobs:
change-detection:
name: 🔍 Change
uses: cda-tum/mqt-workflows/.github/workflows/reusable-change-detection.yml@v1.4
uses: cda-tum/mqt-workflows/.github/workflows/reusable-change-detection.yml@v1.7

cpp-tests:
name: 🇨‌ Test
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-ci.yml@v1.4
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-ci.yml@v1.7
with:
cmake-args: ""
cmake-args-ubuntu: -G Ninja
cmake-args-macos: -G Ninja -DMQT_CORE_WITH_GMP=ON
cmake-args-windows: -T ClangCL
# Runs to enable
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
# Runs to disable
enable-ubuntu2404-gcc-debug: false
enable-ubuntu2404-clang-release: false
enable-ubuntu2404-clang-debug: false
enable-ubuntu2204-gcc-release: false
enable-ubuntu2204-gcc-debug: false
enable-ubuntu2204-clang-release: false
enable-ubuntu2204-clang-debug: false
enable-ubuntu2404-arm-gcc-debug: false
enable-ubuntu2404-arm-clang-release: false
enable-ubuntu2404-arm-clang-debug: false
enable-ubuntu2204-arm-gcc-release: false
enable-ubuntu2204-arm-gcc-debug: false
enable-ubuntu2204-arm-clang-release: false
enable-ubuntu2204-arm-clang-debug: false
enable-macos13-clang-debug: false
enable-macos13-gcc-release: false
enable-macos13-gcc-debug: false
enable-macos14-clang-debug: false
enable-macos14-gcc-release: false
enable-macos14-gcc-debug: false
enable-macos15-clang-release: false
enable-macos15-clang-debug: false
enable-macos15-gcc-release: false
enable-macos15-gcc-debug: false
enable-windows2022-msvc-debug: false
enable-windows2022-clang-release: false
enable-windows2022-clang-debug: false
enable-windows2025-msvc-release: false
enable-windows2025-msvc-debug: false
enable-windows2025-clang-release: false
enable-windows2025-clang-debug: false
# General settings
cmake-args-macos: -DMQT_CORE_WITH_GMP=ON

# run extensive C++ tests whenever this is on a PR and the PR has the `extensive-cpp-ci` label
cpp-tests-extensive:
name: 🇨‌ Test (Extensive)
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-tests) && github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'extensive-cpp-ci')
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-ci.yml@v1.7
with:
# Runs to enable
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
# Runs to disable (these are already enabled in the non-extensive run)
enable-ubuntu2404-gcc-release: false
enable-ubuntu2404-arm-gcc-release: false
enable-macos13-clang-release: false
enable-macos14-clang-release: false
enable-windows2022-msvc-release: false
# General settings
cmake-args-macos: -DMQT_CORE_WITH_GMP=ON

cpp-coverage:
name: 🇨‌ Coverage
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-coverage.yml@v1.7

cpp-linter:
name: 🇨‌ Lint
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-linter)
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-linter.yml@v1.4
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-linter.yml@v1.7

# run extensive Python tests whenever this is on a PR and the PR has the `extensive-python-ci` label
python-tests:
name: 🐍 Test
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-python-tests)
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-ci.yml@v1.4
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-ci.yml@v1.7
with:
# Runs to enable
enable-ubuntu2404: true
enable-ubuntu2404-arm: true
enable-macos13: true
enable-macos14: true
enable-windows2022: true
# Runs to disable
enable-ubuntu2204: false
enable-ubuntu2204-arm: false
enable-macos15: false
enable-windows2025: false

python-tests-extensive:
name: 🐍 Test (Extensive)
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-python-tests) && github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'extensive-python-ci')
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-ci.yml@v1.7
with:
# Runs to enable
enable-ubuntu2204: true
enable-ubuntu2204-arm: true
enable-macos15: true
enable-windows2025: true
# Runs to disable (these are already enabled in the non-extensive run)
enable-ubuntu2404: false
enable-ubuntu2404-arm: false
enable-macos13: false
enable-macos14: false
enable-windows2022: false

python-linter:
name: 🐍 Lint
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-python-tests)
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-linter.yml@v1.7

code-ql:
name: 📝 CodeQL
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-code-ql)
uses: cda-tum/mqt-workflows/.github/workflows/reusable-code-ql.yml@v1.4
uses: cda-tum/mqt-workflows/.github/workflows/reusable-code-ql.yml@v1.7

cd:
name: 🚀 CD
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cd)
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.4
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.7

required-checks-pass: # This job does nothing and is only used for branch protection
name: 🚦 Check
if: always()
needs:
- change-detection
- cpp-tests
- cpp-tests-extensive
- cpp-coverage
- cpp-linter
- python-tests
- python-tests-extensive
- python-linter
- code-ql
- cd
runs-on: ubuntu-latest
Expand All @@ -71,6 +202,14 @@ jobs:
fromJSON(needs.change-detection.outputs.run-cpp-tests)
&& '' || 'cpp-tests,'
}}
${{
fromJSON(needs.change-detection.outputs.run-cpp-tests) && github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'extensive-cpp-ci')
&& '' || 'cpp-tests-extensive,'
}}
${{
fromJSON(needs.change-detection.outputs.run-cpp-tests)
&& '' || 'cpp-coverage,'
}}
${{
fromJSON(needs.change-detection.outputs.run-cpp-linter)
&& '' || 'cpp-linter,'
Expand All @@ -79,6 +218,14 @@ jobs:
fromJSON(needs.change-detection.outputs.run-python-tests)
&& '' || 'python-tests,'
}}
${{
fromJSON(needs.change-detection.outputs.run-python-tests) && github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'extensive-python-ci')
&& '' || 'python-tests-extensive,'
}}
${{
fromJSON(needs.change-detection.outputs.run-python-tests)
&& '' || 'python-linter,'
}}
${{
fromJSON(needs.change-detection.outputs.run-code-ql)
&& '' || 'code-ql,'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-mqt-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ concurrency:
jobs:
update-mqt-core:
name: ⬆️ Update MQT Core
uses: cda-tum/mqt-workflows/.github/workflows/reusable-mqt-core-update.yml@v1.4
uses: cda-tum/mqt-workflows/.github/workflows/reusable-mqt-core-update.yml@v1.7
with:
update-to-head: ${{ github.event.inputs.update-to-head == 'true' }}
19 changes: 10 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ repos:

# Handling unwanted unicode characters
- repo: https://github.com/sirosen/texthooks
rev: 0.6.7
rev: 0.6.8
hooks:
- id: fix-ligatures
- id: fix-smartquotes
Expand All @@ -57,7 +57,7 @@ repos:

# Python linting and formatting using ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
rev: v0.9.6
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -67,7 +67,7 @@ repos:

# Also run Black on examples in the documentation
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.19.0
rev: 1.19.1
hooks:
- id: blacken-docs
additional_dependencies: [black==24.*]
Expand All @@ -83,21 +83,21 @@ repos:

# Clang-format the C++ part of the code base automatically
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.2
rev: v19.1.7
hooks:
- id: clang-format
types_or: [c++, c, cuda]

# Format configuration files with prettier
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.3.3
rev: v3.5.1
hooks:
- id: prettier
types_or: [yaml, markdown, html, css, scss, javascript, json]

# Check static types with mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.12.1
rev: v1.15.0
hooks:
- id: mypy
files: ^(src/mqt|test/python|noxfile.py)
Expand All @@ -107,10 +107,11 @@ repos:
- nox
- numpy
- pytest
- mqt.core>=3.0.0b4

# Check for spelling
- repo: https://github.com/crate-ci/typos
rev: v1.26.0
rev: v1.29.7
hooks:
- id: typos

Expand All @@ -132,14 +133,14 @@ repos:

# Check JSON schemata
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
rev: 0.31.1
hooks:
- id: check-dependabot
- id: check-github-workflows
- id: check-readthedocs

# Check the pyproject.toml file
- repo: https://github.com/henryiii/validate-pyproject-schema-store
rev: 2024.09.23
rev: 2025.01.10
hooks:
- id: validate-pyproject
Loading

0 comments on commit 97b0da8

Please sign in to comment.