Skip to content

Commit

Permalink
fixup! fixup! de-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
afuller-TT committed Mar 8, 2025
1 parent 8fb3011 commit 7c815ac
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/pr-gate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ jobs:
pr-gate-build:
name: Build
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
uses: ./.github/workflows/build-artifact.yaml
with:
version: "22.04"
runs-on: ubuntu-latest
steps:
- run: |
exit 0
# uses: ./.github/workflows/build-artifact.yaml
# with:
# version: "22.04"

smoke-tests:
needs: pr-gate-build
Expand All @@ -47,11 +51,15 @@ jobs:
platform: [
"tt-beta-ubuntu-2204-n300-large-stable",
]
uses: ./.github/workflows/smoke.yaml
with:
docker-image: ${{ needs.pr-gate-build.outputs.ci-build-docker-image }}
package-artifact-name: ${{ needs.pr-gate-build.outputs.packages-artifact-name }}
runner: ${{ matrix.platform }}
runs-on: ubuntu-latest
steps:
- run: |
exit 0
# uses: ./.github/workflows/smoke.yaml
# with:
# docker-image: ${{ needs.pr-gate-build.outputs.ci-build-docker-image }}
# package-artifact-name: ${{ needs.pr-gate-build.outputs.packages-artifact-name }}
# runner: ${{ matrix.platform }}

# GitHub has so many design limitations it's not even funny.
# This job is purely so we can capture the essence of the workflow as a whole in our status checks.
Expand All @@ -68,14 +76,19 @@ jobs:
const requiredJobs = ["pr-gate-build"];
const optionalJobs = ["smoke-tests"];
// The 'needs' context provides job outcomes
const needs = ${{ toJSON(needs) }};
// Check required jobs
for (const job of requiredJobs) {
if (context.payload.workflow_run.jobs[job].outcome !== "success") {
if (needs[job]?.outcome !== "success") {
core.setFailed(`Required job '${job}' did not succeed.`);
}
}
// Check optional jobs (treat skipped as success)
for (const job of optionalJobs) {
const outcome = context.payload.workflow_run.jobs[job]?.outcome;
const outcome = needs[job]?.outcome || "success"; // Default to success if undefined
if (outcome === "failure") {
core.setFailed(`Optional job '${job}' failed.`);
}
Expand Down

0 comments on commit 7c815ac

Please sign in to comment.