Skip to content

Commit 19cf99d

Browse files
authored
Add build-result job to collect matrix results (#500)
The `build` matrix runs on all three platforms and passes reliably, so all of them can be required. Instead of listing each platform in the ruleset, add a single `build-result` job that fails unless the whole matrix succeeded, and require that check in `.asf.yaml`. Assisted-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent e232324 commit 19cf99d

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

.asf.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ github:
7575
required_status_checks:
7676
# The GitHub Actions app
7777
- app_slug: github-actions
78-
name: "build / build (macos-latest)"
79-
- app_slug: github-actions
80-
name: "build / build (ubuntu-latest)"
81-
- app_slug: github-actions
82-
name: "build / build (windows-latest)"
78+
name: "build-result"
8379
# The GitHub Advanced Security app
8480
- app_slug: github-advanced-security
8581
name: "CodeQL"

.github/workflows/build.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@ jobs:
4646
site-enabled: true
4747
reproducibility-check-enabled: false
4848

49+
# Collects the results of the `build` matrix into a single check.
50+
# This is the only check that needs to be listed as required in `.asf.yaml`.
51+
build-result:
52+
needs: build
53+
# Run even if `build` failed or was canceled, so that the check is always reported.
54+
if: always()
55+
runs-on: ubuntu-slim
56+
steps:
57+
- name: Verify build result
58+
env:
59+
# `success` only if all the jobs of the matrix succeeded.
60+
BUILD_RESULT: ${{ needs.build.result }}
61+
run: |
62+
echo "Build result: $BUILD_RESULT"
63+
test "$BUILD_RESULT" = "success"
64+
4965
deploy-snapshot:
5066
needs: build
5167
if: github.repository == 'apache/logging-flume' && github.ref_name == 'trunk'

0 commit comments

Comments
 (0)