mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
ci: avoid "successful failure" of status check job by inspecting needs (#4918)
Thanks to @ryanec for this tip.
This commit is contained in:
20
.github/workflows/nix.yml
vendored
20
.github/workflows/nix.yml
vendored
@ -7,8 +7,24 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- check-zig-cache-hash
|
- check-zig-cache-hash
|
||||||
steps:
|
steps:
|
||||||
- name: Noop
|
- id: status
|
||||||
run: echo "Required Checks Met"
|
name: Determine status
|
||||||
|
run: |
|
||||||
|
results=$(tr -d '\n' <<< '${{ toJSON(needs.*.result) }}')
|
||||||
|
if ! grep -q -v -E '(failure|cancelled)' <<< "$results"; then
|
||||||
|
result="failed"
|
||||||
|
else
|
||||||
|
result="success"
|
||||||
|
fi
|
||||||
|
{
|
||||||
|
echo "result=${result}"
|
||||||
|
echo "results=${results}"
|
||||||
|
} | tee -a "$GITHUB_OUTPUT"
|
||||||
|
- if: always() && steps.status.outputs.result != 'success'
|
||||||
|
name: Check for failed status
|
||||||
|
run: |
|
||||||
|
echo "One or more required build workflows failed: ${{ steps.status.outputs.results }}"
|
||||||
|
exit 1
|
||||||
|
|
||||||
check-zig-cache-hash:
|
check-zig-cache-hash:
|
||||||
if: github.repository == 'ghostty-org/ghostty'
|
if: github.repository == 'ghostty-org/ghostty'
|
||||||
|
20
.github/workflows/test.yml
vendored
20
.github/workflows/test.yml
vendored
@ -26,8 +26,24 @@ jobs:
|
|||||||
- typos
|
- typos
|
||||||
- test-pkg-linux
|
- test-pkg-linux
|
||||||
steps:
|
steps:
|
||||||
- name: Noop
|
- id: status
|
||||||
run: echo "Required Checks Met"
|
name: Determine status
|
||||||
|
run: |
|
||||||
|
results=$(tr -d '\n' <<< '${{ toJSON(needs.*.result) }}')
|
||||||
|
if ! grep -q -v -E '(failure|cancelled)' <<< "$results"; then
|
||||||
|
result="failed"
|
||||||
|
else
|
||||||
|
result="success"
|
||||||
|
fi
|
||||||
|
{
|
||||||
|
echo "result=${result}"
|
||||||
|
echo "results=${results}"
|
||||||
|
} | tee -a "$GITHUB_OUTPUT"
|
||||||
|
- if: always() && steps.status.outputs.result != 'success'
|
||||||
|
name: Check for failed status
|
||||||
|
run: |
|
||||||
|
echo "One or more required build workflows failed: ${{ steps.status.outputs.results }}"
|
||||||
|
exit 1
|
||||||
|
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
|
Reference in New Issue
Block a user