-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ improve CI/CD and package itself (#322)
This PR - improves the CI/CD workflows - improves the mqt.bench package structure by moving mqt.benchviewer into mqt.bench.viewer - implements multiple small improvements revealed by the more comprehensive tests --------- Signed-off-by: burgholzer <burgholzer@me.com> Co-authored-by: burgholzer <burgholzer@me.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0aaca11
commit e1772c3
Showing
33 changed files
with
295 additions
and
382 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,6 @@ coverage: | |
patch: | ||
default: | ||
threshold: 1% | ||
codecov: | ||
notify: | ||
after_n_builds: 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: CD | ||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
python-packaging: | ||
name: 🐍 Packaging | ||
uses: cda-tum/mqt-core/.github/workflows/reusable-python-packaging.yml@v2.4.1 | ||
with: | ||
pure-python: true | ||
|
||
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.bench | ||
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 | ||
|
||
upload_webserver: | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
name: 🚀 Deploy to Webserver | ||
needs: deploy | ||
runs-on: ubuntu-latest | ||
env: | ||
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | ||
KNOWN_HOSTS: ${{ secrets.KNOWN_HOSTS }} | ||
CDA_HOST_NAME: tueicda-cda.srv.mwn.de | ||
CDA_USER_NAME: web-user | ||
CDA_TARGET_DIR: /var/www/cda/app/mqtbench/ | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Create version file | ||
run: | | ||
echo "version = \"$(git describe --tags --always)\"" > mqtbench_version.txt | ||
- name: Setup SSH via the stored Action Secrets | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo "${KNOWN_HOSTS}" >> ~/.ssh/known_hosts | ||
echo "${DEPLOY_KEY}" > ~/.ssh/my_rsync_key | ||
echo "IdentityFile ~/.ssh/my_rsync_key" >> ~/.ssh/config | ||
chmod -R 700 ~/.ssh | ||
- name: Copy version file to the webserver | ||
working-directory: ${{ github.workspace }} | ||
run: | | ||
rsync -avz -e ssh mqtbench_version.txt ${CDA_USER_NAME}@${CDA_HOST_NAME}:${CDA_TARGET_DIR}/mqtbench_version.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
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/reusable-change-detection.yml@v2.4.1 | ||
|
||
python-tests: | ||
name: 🐍 Test | ||
needs: change-detection | ||
if: fromJSON(needs.change-detection.outputs.run-python-tests) | ||
uses: cda-tum/mqt-core/.github/workflows/reusable-python-ci.yml@v2.4.1 | ||
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/reusable-code-ql-python.yml@v2.4.1 | ||
|
||
required-checks-pass: # This job does nothing and is only used for branch protection | ||
name: 🚦 Check | ||
if: always() | ||
needs: | ||
- change-detection | ||
- 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-python-tests) | ||
&& '' || 'python-tests,' | ||
}} | ||
${{ | ||
fromJSON(needs.change-detection.outputs.run-code-ql) | ||
&& '' || 'code-ql,' | ||
}} | ||
jobs: ${{ toJSON(needs) }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.