Skip to content

👷 Enable templating for common files #1005

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

Draft
wants to merge 58 commits into
base: main
Choose a base branch
from
Draft

👷 Enable templating for common files #1005

wants to merge 58 commits into from

Conversation

denialhaag
Copy link
Collaborator

@denialhaag denialhaag commented Jun 18, 2025

Description

This PR adds a workflow that uses an action introduced in munich-quantum-toolkit/templates#1 to synchronize files across repositories.

Checklist:

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

@denialhaag denialhaag self-assigned this Jun 18, 2025
Copy link
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @denialhaag for churning this out so quickly. This is already a great start. I'll simultaneously write a review in the .github repo PR to summarize my thoughts.
Some minor inline thoughts and inspiration already here.

Comment on lines +3 to +6
on:
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
on:
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
on:
schedule:
# Run every Monday at 00:00 UTC
- cron: "0 0 * * 1"
pull_request:
paths:
- ".github/workflows/templating.yml"
workflow_dispatch: # Allow manual triggering

I suppose this can be fairly similar to how we handle upstream Qiskit testing.

@@ -0,0 +1,32 @@
name: Templating
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. That would be similar to how we are doing that for the MQT Core update workflow
In QCEC: https://github.com/munich-quantum-toolkit/qcec/blob/main/.github/workflows/update-mqt-core.yml
In the workflow repo: https://github.com/munich-quantum-toolkit/workflows/blob/main/.github/workflows/reusable-mqt-core-update.yml
Although I suppose that this will actually be an action instead of a workflow. So it might as well be that we do not add anything to the workflows repository.

Comment on lines 24 to 32
- name: Commit and push changes
run: |
git add .
if ! git diff --cached --quiet; then
git commit -m "Update template"
git push
else
echo "No changes to commit."
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be heavily inspired by https://github.com/munich-quantum-toolkit/workflows/blob/main/.github/workflows/reusable-mqt-core-update.yml
Especially when it comes to creating the PR.

That also means that this code snippet can be entirely moved to the reusable workflow/action.

@denialhaag denialhaag changed the title Implement templating for common files 👷 Enable templating for common files Jun 26, 2025
@denialhaag denialhaag added documentation Improvements or additions to documentation continuous integration Anything related to the CI setup labels Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
continuous integration Anything related to the CI setup documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants