Skip to content

Commit

Permalink
👷 CI setup
Browse files Browse the repository at this point in the history
  • Loading branch information
burgholzer committed Apr 19, 2024
1 parent 3744adb commit d35d1b0
Show file tree
Hide file tree
Showing 8 changed files with 270 additions and 42 deletions.
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.

23 changes: 23 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release Drafter

on:
push:
branches:
- main
pull_request_target:
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_release_draft:
name: Run
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ github.token }}

0 comments on commit d35d1b0

Please sign in to comment.