Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨♻️ Project Setup and Structural Improvements #7

Merged
merged 22 commits into from
Apr 21, 2024
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
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BasedOnStyle: LLVM
IncludeBlocks: Regroup
PointerAlignment: Left
74 changes: 74 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
FormatStyle: file

Checks: |
clang-diagnostic-*,
clang-analyzer-*,
-clang-analyzer-core.NullDereference,
boost-*,
bugprone-*,
-bugprone-easily-swappable-parameters,
clang-analyzer-*,
cppcoreguidelines-*,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-special-member-functions,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-bounds-constant-array-index,
google-*,
-google-readability-todo,
-google-build-using-namespace,
misc-*,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
modernize-*,
-modernize-use-trailing-return-type,
performance-*,
-performance-no-int-to-ptr,
portability-*,
readability-*,
-readability-identifier-length,
-readability-magic-numbers,
-readability-function-cognitive-complexity

CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.ClassIgnoredRegexp
value: ".*ZX.*|.*SWAP.*|.*CEX.*|.*DD.*|.*EQ.*"
- key: readability-identifier-naming.ConstantParameterCase
value: camelBack
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.EnumConstantCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: camelBack
- key: readability-identifier-naming.FunctionIgnoredRegexp
value: ".*ZX.*|.*SWAP.*|.*CEX.*|.*DD.*|.*EQ.*"
- key: readability-identifier-naming.GlobalConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.IgnoreMainLikeFunctions
value: "true"
- key: readability-identifier-naming.LocalConstantCase
value: camelBack
- key: readability-identifier-naming.LocalVariableCase
value: camelBack
- key: readability-identifier-naming.MemberCase
value: camelBack
- key: readability-identifier-naming.MemberIgnoredRegexp
value: ".*ZX.*|.*SWAP.*|.*CEX.*|.*DD.*|.*EQ.*"
- key: readability-identifier-naming.MethodCase
value: camelBack
- key: readability-identifier-naming.ParameterCase
value: camelBack
- key: readability-identifier-naming.ParameterIgnoredRegexp
value: ".*ZX.*|.*SWAP.*|.*CEX.*|.*DD.*|.*EQ.*"
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.StaticConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.StructCase
value: CamelCase
- key: readability-identifier-naming.VariableCase
value: camelBack
4 changes: 4 additions & 0 deletions .cmake-format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
format:
line_width: 100
keyword_case: "upper"
autosort: true
4 changes: 4 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test/circuits/** linguist-vendored
.git_archival.txt export-subst
52 changes: 52 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
ignore:
- "extern/**/*"
- "include/GateMatrixDefinitions.h"
- "**/python"
- "test/**/*"

coverage:
range: 60..90
precision: 1
status:
project: off
patch: off

flag_management:
default_rules:
carryforward: true
statuses:
- type: project
target: auto
threshold: 0.5%
removed_code_behavior: adjust_base
- type: patch
target: 90%
threshold: 1%
individual_flags:
- name: cpp
paths:
- "include"
- "src"
after_n_builds: 1
- name: python
paths:
- "src/mqt/**/*.py"
after_n_builds: 12
statuses:
- type: project
threshold: 0.5%
removed_code_behavior: adjust_base
- type: patch
target: 95%
threshold: 1%

parsers:
gcov:
branch_detection:
conditional: no
loop: no

comment:
layout: "reach, diff, flags, files"
require_changes: true
show_carryforward_flags: true
36 changes: 36 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: 2
updates:
- package-ecosystem: "gitsubmodule"
directory: "/"
groups:
submodules:
patterns:
- "*"
schedule:
interval: "monthly"
time: "06:00"
timezone: "Europe/Vienna"

- package-ecosystem: "github-actions"
directory: "/"
groups:
github-actions:
patterns:
- "*"
schedule:
interval: "weekly"
day: "friday"
time: "06:00"
timezone: "Europe/Vienna"

- package-ecosystem: "pip"
directory: "/"
groups:
python-dependencies:
patterns:
- "*"
schedule:
interval: "weekly"
day: "friday"
time: "06:00"
timezone: "Europe/Vienna"
54 changes: 54 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name-template: "MQT Qudits $RESOLVED_VERSION Release"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: "🚀 Features and Enhancements"
labels:
- "feature"
- "enhancement"
- "usability"
- title: "🐛 Bug Fixes"
labels:
- "bug"
- "fix"
- title: "📄 Documentation"
labels:
- "documentation"
- title: "🤖 CI"
labels:
- "continuous integration"
- title: "📦 Packaging"
labels:
- "packaging"
- title: "🧹 Code Quality"
labels:
- "code quality"
- title: "⬆️ Dependencies"
collapse-after: 5
labels:
- "dependencies"
- "submodules"
- "github_actions"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&'
version-resolver:
major:
labels:
- "major"
minor:
labels:
- "minor"
patch:
labels:
- "patch"
default: patch
autolabeler:
- label: "dependencies"
title:
- "/update pre-commit hooks/i"

template: |
## 👀 What Changed

$CHANGES

**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
26 changes: 25 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
name: cd.yml
name: CD
on:
release:
types: [published]
workflow_dispatch:

jobs:
python-packaging:
name: 🐍 Packaging
uses: cda-tum/mqt-core/.github/workflows/[email protected]

deploy:
if: github.event_name == 'release' && github.event.action == 'published'
name: 🚀 Deploy to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/mqt.qudits
permissions:
id-token: write
needs: [python-packaging]
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- uses: pypa/gh-action-pypi-publish@release/v1
81 changes: 80 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,83 @@
name: ci.yml
name: CI
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:
change-detection:
name: 🔍 Change
uses: cda-tum/mqt-core/.github/workflows/[email protected]

cpp-tests:
name: 🇨‌ Test
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
uses: cda-tum/mqt-core/.github/workflows/[email protected]
secrets:
token: ${{ secrets.CODECOV_TOKEN }}
with:
cmake-args: ""
cmake-args-ubuntu: -G Ninja
cmake-args-macos: -G Ninja
cmake-args-windows: -T ClangCL

cpp-linter:
name: 🇨‌ Lint
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-cpp-linter)
uses: cda-tum/mqt-core/.github/workflows/[email protected]

python-tests:
name: 🐍 Test
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-python-tests)
uses: cda-tum/mqt-core/.github/workflows/[email protected]
secrets:
token: ${{ secrets.CODECOV_TOKEN }}

code-ql:
name: 📝 CodeQL
needs: change-detection
if: fromJSON(needs.change-detection.outputs.run-code-ql)
uses: cda-tum/mqt-core/.github/workflows/[email protected]

required-checks-pass: # This job does nothing and is only used for branch protection
name: 🚦 Check
if: always()
needs:
- change-detection
- cpp-tests
- cpp-linter
- python-tests
- code-ql
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
allowed-skips: >-
${{
fromJSON(needs.change-detection.outputs.run-cpp-tests)
&& '' || 'cpp-tests,'
}}
${{
fromJSON(needs.change-detection.outputs.run-cpp-linter)
&& '' || 'cpp-linter,'
}}
${{
fromJSON(needs.change-detection.outputs.run-python-tests)
&& '' || 'python-tests,'
}}
${{
fromJSON(needs.change-detection.outputs.run-code-ql)
&& '' || 'code-ql,'
}}
jobs: ${{ toJSON(needs) }}
4 changes: 0 additions & 4 deletions .github/workflows/codecov.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/python-publish.yml

This file was deleted.

Loading
Loading