github: restore platform-specific status badges in README (#9931)

Consolidating the CI workflows into a single postsubmit.yml broke the
individual platform status badges in the README, as GitHub Actions
only supports status badges at the workflow level, not the job level.

Added shadow workflows (e.g., status-android.yml) that trigger on
the completion of the main "Postsubmit CI" workflow. These scripts
query the GitHub Actions API to determine the success or failure of
their respective job (e.g., build-android) and reflect that status.
Updated the README to point to these new workflow badges.
This commit is contained in:
Powei Feng
2026-04-23 11:17:28 -07:00
committed by GitHub
parent 7a1f155d71
commit d16ebaa94f
7 changed files with 162 additions and 6 deletions

26
.github/workflows/status-android.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Android
on:
workflow_run:
workflows: ["Postsubmit CI"]
types: [completed]
jobs:
status:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'skipped' }}
steps:
- uses: actions/github-script@v7
with:
script: |
const { data: { jobs } } = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }}
});
const job = jobs.find(j => j.name === 'build-android');
if (job && job.conclusion !== 'success') {
core.setFailed(`Android build failed: ${job.conclusion}`);
} else if (!job) {
core.warning(`Job build-android not found in the workflow run.`);
}

26
.github/workflows/status-ios.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: iOS
on:
workflow_run:
workflows: ["Postsubmit CI"]
types: [completed]
jobs:
status:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'skipped' }}
steps:
- uses: actions/github-script@v7
with:
script: |
const { data: { jobs } } = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }}
});
const job = jobs.find(j => j.name === 'build-ios');
if (job && job.conclusion !== 'success') {
core.setFailed(`iOS build failed: ${job.conclusion}`);
} else if (!job) {
core.warning(`Job build-ios not found in the workflow run.`);
}

26
.github/workflows/status-linux.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Linux
on:
workflow_run:
workflows: ["Postsubmit CI"]
types: [completed]
jobs:
status:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'skipped' }}
steps:
- uses: actions/github-script@v7
with:
script: |
const { data: { jobs } } = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }}
});
const job = jobs.find(j => j.name === 'build-linux');
if (job && job.conclusion !== 'success') {
core.setFailed(`Linux build failed: ${job.conclusion}`);
} else if (!job) {
core.warning(`Job build-linux not found in the workflow run.`);
}

26
.github/workflows/status-macos.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: macOS
on:
workflow_run:
workflows: ["Postsubmit CI"]
types: [completed]
jobs:
status:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'skipped' }}
steps:
- uses: actions/github-script@v7
with:
script: |
const { data: { jobs } } = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }}
});
const job = jobs.find(j => j.name === 'build-mac');
if (job && job.conclusion !== 'success') {
core.setFailed(`macOS build failed: ${job.conclusion}`);
} else if (!job) {
core.warning(`Job build-mac not found in the workflow run.`);
}

26
.github/workflows/status-web.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Web
on:
workflow_run:
workflows: ["Postsubmit CI"]
types: [completed]
jobs:
status:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'skipped' }}
steps:
- uses: actions/github-script@v7
with:
script: |
const { data: { jobs } } = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }}
});
const job = jobs.find(j => j.name === 'build-web');
if (job && job.conclusion !== 'success') {
core.setFailed(`Web build failed: ${job.conclusion}`);
} else if (!job) {
core.warning(`Job build-web not found in the workflow run.`);
}

26
.github/workflows/status-windows.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Windows
on:
workflow_run:
workflows: ["Postsubmit CI"]
types: [completed]
jobs:
status:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'skipped' }}
steps:
- uses: actions/github-script@v7
with:
script: |
const { data: { jobs } } = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }}
});
const job = jobs.find(j => j.name === 'build-windows');
if (job && job.conclusion !== 'success') {
core.setFailed(`Windows build failed: ${job.conclusion}`);
} else if (!job) {
core.warning(`Job build-windows not found in the workflow run.`);
}

View File

@@ -1,11 +1,11 @@
# Filament
[![Android Build Status](https://github.com/google/filament/workflows/Android/badge.svg)](https://github.com/google/filament/actions?query=workflow%3AAndroid)
[![iOS Build Status](https://github.com/google/filament/workflows/iOS/badge.svg)](https://github.com/google/filament/actions?query=workflow%3AiOS)
[![Linux Build Status](https://github.com/google/filament/workflows/Linux/badge.svg)](https://github.com/google/filament/actions?query=workflow%3ALinux)
[![macOS Build Status](https://github.com/google/filament/workflows/macOS/badge.svg)](https://github.com/google/filament/actions?query=workflow%3AmacOS)
[![Windows Build Status](https://github.com/google/filament/workflows/Windows/badge.svg)](https://github.com/google/filament/actions?query=workflow%3AWindows)
[![Web Build Status](https://github.com/google/filament/workflows/Web/badge.svg)](https://github.com/google/filament/actions?query=workflow%3AWeb)
[![Android Build Status](https://github.com/google/filament/actions/workflows/status-android.yml/badge.svg)](https://github.com/google/filament/actions/workflows/status-android.yml)
[![iOS Build Status](https://github.com/google/filament/actions/workflows/status-ios.yml/badge.svg)](https://github.com/google/filament/actions/workflows/status-ios.yml)
[![Linux Build Status](https://github.com/google/filament/actions/workflows/status-linux.yml/badge.svg)](https://github.com/google/filament/actions/workflows/status-linux.yml)
[![macOS Build Status](https://github.com/google/filament/actions/workflows/status-macos.yml/badge.svg)](https://github.com/google/filament/actions/workflows/status-macos.yml)
[![Windows Build Status](https://github.com/google/filament/actions/workflows/status-windows.yml/badge.svg)](https://github.com/google/filament/actions/workflows/status-windows.yml)
[![Web Build Status](https://github.com/google/filament/actions/workflows/status-web.yml/badge.svg)](https://github.com/google/filament/actions/workflows/status-web.yml)
Filament is a real-time physically based rendering engine for Android, iOS, Linux, macOS, Windows,
and WebGL. It is designed to be as small as possible and as efficient as possible on Android.