-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔧 switch to reusable workflows from mqt-core
- Loading branch information
1 parent
e62ee22
commit 17abc6c
Showing
5 changed files
with
88 additions
and
228 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: CD | ||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
python-packaging: | ||
name: 🐍 Packaging | ||
uses: cda-tum/mqt-core/.github/workflows/[email protected] | ||
with: | ||
setup-z3: 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.qusat | ||
permissions: | ||
id-token: write | ||
needs: [python-packaging] | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
- uses: pypa/gh-action-pypi-publish@release/v1 |
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 |
---|---|---|
@@ -1,69 +1,71 @@ | ||
name: C++ | ||
|
||
name: CI | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
merge_group: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
CMAKE_BUILD_PARALLEL_LEVEL: 3 | ||
Z3_VERSION: 4.11.2 | ||
|
||
jobs: | ||
change-detection: | ||
name: 🔍 Change | ||
uses: cda-tum/mqt-core/.github/workflows/[email protected] | ||
|
||
cpp-tests: | ||
name: Tests ${{ matrix.config.os }} | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { os: ubuntu-latest, test-dir: build/test, toolchain: "" } | ||
- { os: macos-latest, test-dir: build/test, toolchain: "" } | ||
- { | ||
os: windows-latest, | ||
test-dir: build\test\Release, | ||
toolchain: "-T ClangCl", | ||
} | ||
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: | ||
setup-z3: true | ||
|
||
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] | ||
with: | ||
setup-z3: true | ||
|
||
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.yml@main | ||
with: | ||
setup-z3: true | ||
|
||
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 | ||
- code-ql | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install Z3 | ||
uses: cda-tum/setup-z3@v1 | ||
with: | ||
version: ${{ env.Z3_VERSION }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Configure CMake | ||
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_QUSAT_TESTS=ON ${{ matrix.config.toolchain }} | ||
- name: Build | ||
run: cmake --build build --config Release | ||
- name: Test | ||
working-directory: ${{ matrix.config.test-dir }} | ||
run: ctest -C Release --output-on-failure | ||
- if: runner.os == 'Linux' | ||
name: Coverage | ||
run: | | ||
cmake -S . -B buildCov -DCMAKE_BUILD_TYPE=Debug -DBUILD_QUSAT_TESTS=ON -DENABLE_COVERAGE=ON | ||
cmake --build buildCov --config Debug | ||
cd buildCov/test | ||
ctest -C Debug --output-on-failure | ||
- if: runner.os == 'Linux' | ||
name: Upload coverage to Codecov | ||
uses: codecov/[email protected] | ||
- name: Decide whether the needed jobs succeeded or failed | ||
uses: re-actors/alls-green@release/v1 | ||
with: | ||
fail_ci_if_error: true | ||
flags: cpp | ||
gcov: true | ||
gcov_ignore: "extern/**/*" | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
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-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 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