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:
26
.github/workflows/status-android.yml
vendored
Normal file
26
.github/workflows/status-android.yml
vendored
Normal 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
26
.github/workflows/status-ios.yml
vendored
Normal 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
26
.github/workflows/status-linux.yml
vendored
Normal 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
26
.github/workflows/status-macos.yml
vendored
Normal 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
26
.github/workflows/status-web.yml
vendored
Normal 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
26
.github/workflows/status-windows.yml
vendored
Normal 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.`);
|
||||
}
|
||||
12
README.md
12
README.md
@@ -1,11 +1,11 @@
|
||||
# Filament
|
||||
|
||||
[](https://github.com/google/filament/actions?query=workflow%3AAndroid)
|
||||
[](https://github.com/google/filament/actions?query=workflow%3AiOS)
|
||||
[](https://github.com/google/filament/actions?query=workflow%3ALinux)
|
||||
[](https://github.com/google/filament/actions?query=workflow%3AmacOS)
|
||||
[](https://github.com/google/filament/actions?query=workflow%3AWindows)
|
||||
[](https://github.com/google/filament/actions?query=workflow%3AWeb)
|
||||
[](https://github.com/google/filament/actions/workflows/status-android.yml)
|
||||
[](https://github.com/google/filament/actions/workflows/status-ios.yml)
|
||||
[](https://github.com/google/filament/actions/workflows/status-linux.yml)
|
||||
[](https://github.com/google/filament/actions/workflows/status-macos.yml)
|
||||
[](https://github.com/google/filament/actions/workflows/status-windows.yml)
|
||||
[](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.
|
||||
|
||||
Reference in New Issue
Block a user