Skip to content

Commit a975272

Browse files
committed
GitHub: fix "Automerge" button to *actually* depend on tests passing.
I've been bitten by this several times: skipping the test seems to make it OK for GH! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 8da5512 commit a975272

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ jobs:
616616
gather:
617617
# A dummy task that depends on the full matrix of tests, and
618618
# signals successful completion. Used for the PR status to pass
619-
# before merging.
619+
# before merging. Needs to run even if they failed!
620620
name: CI completion
621621
runs-on: ubuntu-22.04
622622
needs:
@@ -626,7 +626,28 @@ jobs:
626626
- integration-sanitizers
627627
- min-btc-support
628628
- check-flake
629+
if: ${{ always() }}
629630
steps:
630631
- name: Complete
632+
env:
633+
JOB_NAMES: "INTEGRATION CHECK_UNITS VALGRIND SANITIZERS BTC FLAKE"
634+
INTEGRATION: ${{ needs.integration.result }}
635+
CHECK_UNITS: ${{ needs['check-units'].result }}
636+
VALGRIND: ${{ needs['integration-valgrind'].result }}
637+
SANITIZERS: ${{ needs['integration-sanitizers'].result }}
638+
DOCS: ${{ needs['update-docs-examples'].result }}
639+
BTC: ${{ needs['min-btc-support'].result }}
640+
FLAKE: ${{ needs['check-flake'].result }}
631641
run: |
632-
echo CI completed successfully
642+
failed=""
643+
for name in $JOB_NAMES; do
644+
result="${!name}"
645+
echo "$name: $result"
646+
if [[ "$result" != "success" ]]; then
647+
failed="yes"
648+
fi
649+
done
650+
if [[ "$failed" == "yes" ]]; then
651+
echo "One or more required jobs failed"
652+
exit 1
653+
fi

0 commit comments

Comments
 (0)