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

Add CI/CD Pipeline and Tests #2

Merged
merged 40 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
625bb69
feat: :sparkles: Add `runAll` method
DRovara Jul 15, 2024
2670f11
Merge branch 'main' of https://github.com/DRovara/mqt-debugger into t…
DRovara Jul 15, 2024
6a1c3c9
test: :construction: Initial setup for pytest
DRovara Jul 22, 2024
9acdff5
Merge branch 'main' into tests
DRovara Jul 23, 2024
5539981
refactor: :recycle: Remove `getPreviousInstruction` debugging method
DRovara Jul 23, 2024
0627438
test: :white_check_mark: Add python-bindings test
DRovara Jul 23, 2024
3783f32
fix: :bug: No longer clear breakpoints when reloading code
DRovara Jul 23, 2024
db9eb76
feat: :sparkles: Code preprocessing now ignores comments
DRovara Jul 24, 2024
ee3801c
test: :bug: Add end-to-end test cases
DRovara Jul 24, 2024
27419ce
test: :white_check_mark: Add more tests and fix minor bugs
DRovara Aug 4, 2024
c396d82
revert: :recycle: Revert debugging-changes to CliFrontEnd.cpp that sl…
DRovara Aug 5, 2024
e7bd98c
fix: :bug: Fix DAP Server missing some messages if multiple messages …
DRovara Aug 5, 2024
47722c0
fix: :bug: Fix bug that makes breakpoints coming right after a "retur…
DRovara Aug 5, 2024
96916b5
fix: :bug: Fix quotation marks used in f-string
DRovara Aug 5, 2024
5ee33c8
feat: :construction_worker: Add noxfile for organised testing
DRovara Aug 5, 2024
6e0aefa
fix: :bug: Remove unused variable in CodePreprocessing
DRovara Aug 5, 2024
d761bab
fix: :bug: Fix error that makes custom gate definitions not recognise…
DRovara Aug 6, 2024
25a4f66
fix: :bug: Fix `getInteractions`
DRovara Aug 6, 2024
60a32f0
test: :white_check_mark: Add C++ tests
DRovara Aug 6, 2024
1b459fa
ci: :construction_worker: Add CD/CI workflows and other .github files
DRovara Aug 6, 2024
f7966b6
Empty commit to test CI
DRovara Aug 6, 2024
b3e8903
refactor: :recycle: Remove need for `back_inserter` in CodePreprocess…
DRovara Aug 7, 2024
18a2d97
docs: :memo: Add README.md (incomplete)
DRovara Aug 7, 2024
4dc5027
ci: :construction_worker: Allow id-token: write for cpp-tests
DRovara Aug 7, 2024
d14a228
ci: :construction_worker: Also allow id-token: write for python tests…
DRovara Aug 7, 2024
3bccba6
fix: :construction_worker: Possibly fix error of Update MQT Core work…
DRovara Aug 7, 2024
f61dcdd
fix: :bug: Fix majority of linting errors
DRovara Aug 8, 2024
c18a881
fix: :bug: Resolve double-free issues in python bindings by going bac…
DRovara Aug 8, 2024
46fce7d
refactor: :recycle: Fix imports in CodePreprocessing.hpp
DRovara Aug 8, 2024
3e017e3
chore: :see_no_evil: Add local-tools to gitignore
DRovara Aug 8, 2024
c23a220
fix: :bug: Fix remaining linter issues and make compatible with C++17
DRovara Aug 8, 2024
e2134af
refactor: :recycle: Fix linter errors in `app` directory and disable …
DRovara Aug 8, 2024
339efad
build: :building_construction: Require specific version of pybind11 i…
DRovara Aug 8, 2024
61c59ed
fix: :bug: Add missing pybind11 dependencies to pyproject.toml and no…
DRovara Aug 8, 2024
52128a2
refactor: :art: Resolve CodeQL warnings
DRovara Aug 9, 2024
44cd249
fix: :bug: Fix missing return statement
DRovara Aug 9, 2024
6c8edd3
Update .github/workflows/update-mqt-core.yml
DRovara Aug 9, 2024
97a51dc
refactor: :recycle: Move DAP-related code to `dap` submodule
DRovara Aug 9, 2024
c6a3503
Merge branch 'tests' of https://github.com/DRovara/mqt-debugger into …
DRovara Aug 9, 2024
b9f3c01
ci: :construction_worker: Ignore `dap` submodule from codecov
DRovara Aug 9, 2024
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
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 🐛 Bug report
description: Something is not working correctly.
title: "🐛 <title>"
body:
- type: markdown
attributes:
value: >-
**Thank you for wanting to report a bug for this project!**

Verify first that your issue is not [already reported on GitHub](https://github.com/cda-tum/qcec/search?q=is%3Aissue&type=issues).

If you have general questions, please consider [starting a discussion](https://github.com/cda-tum/qcec/discussions).
- type: textarea
attributes:
label: Environment information
description: >-
Please provide information about your environment. For example, OS, C++ compiler, mqt.core version etc.
placeholder: |
- OS:
- C++ compiler:
- mqt.core version:
- Additional environment information:
validations:
required: true
- type: textarea
attributes:
label: Description
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
- type: textarea
attributes:
label: How to Reproduce
description: Please provide steps to reproduce this bug.
placeholder: |
1. Get package from '...'
2. Then run '...'
3. An error occurs.
validations:
required: true
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: ✨ Feature request
description: Suggest an idea
title: "✨ <title>"
body:
- type: markdown
attributes:
value: >
**Thank you for wanting to suggest a feature for this project!**

Verify first that your idea is not [already requested on GitHub](https://github.com/cda-tum/qcec/search?q=is%3Aissue&type=issues).

- type: textarea
attributes:
label: What's the problem this feature will solve?
description: >-
What are you trying to do, that you are unable to achieve as it currently stands?
placeholder: >-
I'm trying to do X and I'm missing feature Y for this to be
easily achievable.
validations:
required: true

- type: textarea
attributes:
label: Describe the solution you'd like
description: >
Clear and concise description of what you want to happen.
placeholder: >-
When I do X, I want to achieve Y in a situation when Z.
validations:
required: true
50 changes: 50 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
ignore:
- "extern/**/*"
- "**/python"
- "test/**/*"
- "src/mqt/debug/dap/**/*"

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"
- name: python
paths:
- "src/mqt/**/*.py"
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
81 changes: 81 additions & 0 deletions .github/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
Contributing
============

Thank you for your interest in contributing to this project.
We value contributions from people with all levels of experience.
In particular if this is your first pull request not everything has to be perfect.
We will guide you through the process.

We use GitHub to `host code <https://github.com/cda-tum/mqt-debug>`_, to `track issues and feature requests <https://github.com/cda-tum/mqt-debug/issues>`_, as well as accept `pull requests <https://github.com/cda-tum/mqt-debug/pulls>`_.
See https://docs.github.com/en/get-started/quickstart for a general introduction to working with GitHub and contributing to projects.

Types of Contributions
######################

You can contribute in several ways:

- 🐛 Report Bugs
Report bugs at https://github.com/cda-tum/mqt-debug/issues using the *🐛 Bug report* issue template. Please make sure to fill out all relevant information in the respective issue form.

- 🐛 Fix Bugs
Look through the `GitHub Issues <https://github.com/cda-tum/mqt-debug/issues>`_ for bugs. Anything tagged with "bug" is open to whoever wants to try and fix it.

- ✨ Propose New Features
Propose new features at https://github.com/cda-tum/mqt-debug/issues using the *✨ Feature request* issue template. Please make sure to fill out all relevant information in the respective issue form.

- ✨ Implement New Features
Look through the `GitHub Issues <https://github.com/cda-tum/mqt-debug/issues>`_ for features. Anything tagged with "feature" is open to whoever wants to implement it. We highly appreciate external contributions to the project.

- 📝 Write Documentation
MQT Debug could always use some more `documentation <https://mqt.readthedocs.io/projects/debug>`_, and we appreciate any help with that.

🎉 Get Started
##############

Ready to contribute? Check out the :doc:`Development Guide <DevelopmentGuide>` to set up MQT Debug for local development and learn about the style guidelines and conventions used throughout the project.

We value contributions from people with all levels of experience.
In particular if this is your first PR not everything has to be perfect.
We will guide you through the PR process.
Nevertheless, please try to follow the guidelines below as well as you can to help make the PR process quick and smooth.

Core Guidelines
###############

- `"Commit early and push often" <https://www.worklytics.co/blog/commit-early-push-often>`_.
- Write meaningful commit messages (preferably using `gitmoji <https://gitmoji.dev>`_ to give additional context to your commits).
- Focus on a single feature/bug at a time and only touch relevant files. Split multiple features into multiple contributions.
- If you added a new feature, you should add tests that ensure it works as intended. Furthermore, the new feature should be documented appropriately.
- If you fixed a bug, you should add tests that demonstrate that the bug has been fixed.
- Document your code thoroughly and write readable code.
- Keep your code clean. Remove any debug statements, left-over comments, or code unrelated to your contribution.
- Run :code:`nox -rs lint` to check your code for style and linting errors before committing.

Pull Request Workflow
#####################

- Create PRs early. It is ok to create work-in-progress PRs. You may mark these as draft PRs on GitHub.
- Describe your PR. Start with a descriptive title, reference any related issues by including the issue number in the PR description, and add a comprehensive description of the changes. We provide a PR template that you can (and should) follow to create a PR.
- Whenever a PR is created or updated, several workflows on all supported platforms and versions of Python are executed. Make sure your PR passes *all* these continuous integration (CI) checks. Here are some tips for finding the cause of certain failures:
- If any of the *C++/\** checks fail, this most likely indicates build errors or test failures in the C++ part of the code base. Look through the respective logs on GitHub for any error or failure messages.

- If any of the :code:`Python Packaging/\*` checks fail, this indicates an error in the Python bindings or creation of the Python wheels and/or source distribution. Look through the respective logs on GitHub for any error or failure messages.
- If any of the :code:`Python/\*` checks fail, this indicates an error in the Python part of the code base. Look through the respective logs on GitHub for any error or failure messages.
- If any of the :code:`codecov/\*` checks fail, this means that your changes are not appropriately covered by tests or that the overall project coverage decreased too much. Ensure that you include tests for all your changes in the PR.
- If the :code:`docs/readthedocs.org:debug` check fails, the documentation could not be built properly. Inspect the corresponding log file for any errors.
- If :code:`cpp-linter` comments on your PR with a list of warnings, these have been raised by :code:`clang-tidy` when checking the C++ part of your changes for warnings or style guideline violations. The individual messages frequently provide helpful suggestions on how to fix the warnings.
- If the :code:`pre-commit.ci` check fails, some of the :code:`pre-commit` checks failed and could not be fixed automatically by the *pre-commit.ci* bot. Such failures are most likely related to the Python part of the code base. The individual log messages frequently provide helpful suggestions on how to fix the warnings.

- Once your PR is ready, change it from a draft PR to a regular PR and request a review from one of the project maintainers.
- If your PR gets a "Changes requested" review, you will need to address the feedback and update your PR by pushing to the same branch. You don't need to close the PR and open a new one. Respond to review comments on the PR (e.g., with "done 👍"). Be sure to re-request review once you have made changes after a code review so that maintainers know that the requests have been addressed.

.. raw:: html

<hr>

This document was inspired by and partially adapted from

- https://matplotlib.org/stable/devel/coding_guide.html
- https://opensource.creativecommons.org/contributing-code/pr-guidelines/
- https://yeoman.io/contributing/pull-request.html
- https://github.com/scikit-build/scikit-build
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"
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

## Checklist:

<!---
This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly.
-->

- [ ] The pull request only contains commits that are related to it.
- [ ] I have added appropriate tests and documentation.
- [ ] I have made sure that all CI jobs on GitHub pass.
- [ ] The pull request introduces no new warnings and follows the project's style guidelines.
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 Debug $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
12 changes: 12 additions & 0 deletions .github/support.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Support
=======

If you are stuck with a problem using MQT Debug or are having questions, please do get in touch at our `Issues <https://github.com/cda-tum/mqt-debug/issues>`_ or `Discussions <https://github.com/cda-tum/mqt-debug/discussions>`_. We'd love to help.

You can save time by following this procedure when reporting a problem:

- Do try to solve the problem on your own first. Make sure to consult the `Documentation <https://mqt.readthedocs.io/projects/debug>`_.
- Search through past `Issues <https://github.com/cda-tum/mqt-debug/issues>`_ to see if someone else already had the same problem.
- Before filing a bug report, try to create a minimal working example (MWE) that reproduces the problem. It's much easier to identify the cause for the problem if a handful of lines suffice to show that something isn't working.

You can also always reach us at `quantum.cda@xcit.tum.de <mailto:quantum.cda@xcit.tum.de>`_.
37 changes: 37 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CD
on:
release:
types: [published]
workflow_dispatch:
pull_request:
paths:
- .github/workflows/cd.yml

jobs:
python-packaging:
name: 🐍 Packaging
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.1.5

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.qcec
permissions:
id-token: write
attestations: write
contents: read
needs: [python-packaging]
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Generate artifact attestation for sdist and wheel(s)
uses: actions/attest-build-provenance@v1.4.0
with:
subject-path: "dist/*"
- uses: pypa/gh-action-pypi-publish@release/v1
Loading
Loading