Skip to content

Commit

Permalink
[ci] Create a job for status check purposes. (#17)
Browse files Browse the repository at this point in the history
Signed-off-by: boschmitt <[email protected]>
  • Loading branch information
boschmitt authored Dec 3, 2024
1 parent d1c3a58 commit f19903d
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/pr_workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,38 @@ jobs:
(needs.check-changes.outputs.build-solvers == 'true' || needs.check-changes.outputs.build-cudaq == 'true')
uses: ./.github/workflows/lib_solvers.yaml

# This job is used for branch protection checks.
verify:
name: Verify PR
if: ${{ always() }}
needs:
- build-cudaq
- build-all
- build-qec
- build-solvers
runs-on: ubuntu-latest
steps:
- name: Check results
run: |
status="success"
check_result() {
name=$1
result=$2
# NOTE: "skipped" is considered success.
if [[ "$result" == "failure" || "$result" == "cancelled" ]]; then
echo "$name job failed"
status="failed"
fi
}
check_result "build-cudaq" "${{needs.build-cudaq.result}}"
check_result "build-all" "${{needs.build-all.result}}"
check_result "build-qec" "${{needs.build-qec.result}}"
check_result "build-solvers" "${{needs.build-solvers.result}}"
if [[ "$status" != "success" ]]; then
exit 1
fi

0 comments on commit f19903d

Please sign in to comment.