Skip to content

Commit b6c9228

Browse files
ci: add opt-in 5.1 smoke via needs-5.1 and dispatch
Default PR matrix stays 4.5 and 5.2. labeled is required so the label actually starts a job. Dispatch takes a series input. Monday cron is unchanged. Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent f9d2d7f commit b6c9228

1 file changed

Lines changed: 55 additions & 4 deletions

File tree

‎.github/workflows/blender-smoke.yml‎

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,88 @@ name: Blender Smoke Test
22

33
# Executes the snippets' and skills' headline examples inside REAL Blender, headless,
44
# on the current stable (5.2.x LTS) and the fallback LTS (4.5.x) on every PR,
5-
# plus 5.1.x on the weekly cron, and fails on any error or
5+
# plus 5.1.x on the weekly cron, the opt-in `needs-5.1` PR label, or a
6+
# workflow_dispatch series input, and fails on any error or
67
# empty-output assertion. Shipped examples go through tests/smoke/run_example.py
78
# (catalog.json): SKIP is exit 77 + SMOKE_SKIP below --min-version, never exit 0.
89
# Post-exit sidecars are opt-in. A leg with zero PASSes is red.
910
# py_compile (in validate.yml) cannot catch API-level regressions
1011
# like the EEVEE-id inversion, the slotted-actions boundary, the driver TypeError, or the
1112
# dead SDF link -- this gate runs the code so those surface in CI, not in users' files.
13+
#
14+
# Default PR matrix stays 5.2 + 4.5. `labeled` is in pull_request.types so
15+
# applying `needs-5.1` starts a 5.1 job; other labels are ignored and must
16+
# not cancel an in-progress default run. Auto-label does not apply needs-5.1.
17+
# Manual dispatch: Actions > Blender Smoke Test > Run workflow > pick series.
1218

1319
on:
14-
workflow_dispatch: {}
20+
workflow_dispatch:
21+
inputs:
22+
series:
23+
description: Blender series to smoke (single version, on-demand)
24+
required: true
25+
type: choice
26+
options:
27+
- "5.2"
28+
- "5.1"
29+
- "4.5"
30+
default: "5.2"
1531
schedule:
1632
- cron: "0 7 * * 1" # weekly, Monday 07:00 UTC
1733
pull_request:
1834
branches: [main]
35+
types: [opened, synchronize, reopened, labeled]
1936

2037
permissions:
2138
contents: read
2239

2340
concurrency:
24-
group: blender-smoke-${{ github.ref }}
41+
# Isolate labeled runs so auto-label (`ci`, `documentation`, ...) does not
42+
# cancel the default 4.5/5.2 jobs. synchronize still cancels the previous
43+
# synchronize on the same PR.
44+
group: blender-smoke-${{ github.event.pull_request.number || github.ref }}${{ github.event.action == 'labeled' && format('-label-{0}', github.event.label.name) || '' }}
2545
cancel-in-progress: true
2646

2747
jobs:
48+
resolve-matrix:
49+
name: Resolve smoke matrix
50+
runs-on: ubuntu-latest
51+
if: github.event.action != 'labeled' || github.event.label.name == 'needs-5.1'
52+
outputs:
53+
series: ${{ steps.set.outputs.series }}
54+
steps:
55+
- id: set
56+
env:
57+
EVENT_NAME: ${{ github.event_name }}
58+
EVENT_ACTION: ${{ github.event.action }}
59+
DISPATCH_SERIES: ${{ github.event.inputs.series }}
60+
PR_LABELS: ${{ join(github.event.pull_request.labels.*.name, ',') }}
61+
run: |
62+
set -euo pipefail
63+
if [ "$EVENT_NAME" = "schedule" ]; then
64+
json='["5.2","5.1","4.5"]'
65+
elif [ "$EVENT_NAME" = "workflow_dispatch" ]; then
66+
json=$(printf '["%s"]' "$DISPATCH_SERIES")
67+
elif [ "$EVENT_ACTION" = "labeled" ]; then
68+
json='["5.1"]'
69+
elif echo ",$PR_LABELS," | grep -q ",needs-5.1,"; then
70+
json='["5.2","5.1","4.5"]'
71+
else
72+
json='["5.2","4.5"]'
73+
fi
74+
echo "series=$json" >> "$GITHUB_OUTPUT"
75+
echo "Smoke matrix: $json"
76+
2877
smoke:
2978
name: Blender ${{ matrix.series }} smoke
79+
needs: resolve-matrix
80+
if: needs.resolve-matrix.result == 'success'
3081
runs-on: ubuntu-latest
3182
timeout-minutes: 45
3283
strategy:
3384
fail-fast: false
3485
matrix:
35-
series: ${{ github.event_name == 'schedule' && fromJSON('["5.2","5.1","4.5"]') || fromJSON('["5.2","4.5"]') }}
86+
series: ${{ fromJSON(needs.resolve-matrix.outputs.series) }}
3687
steps:
3788
- uses: actions/checkout@v7
3889

0 commit comments

Comments
 (0)