Skip to content

Commit 65d8810

Browse files
ci(audience): drop Linux Unity 6 PlayMode cells from PR matrix
StandaloneLinux64 / IL2CPP / Unity 6000.4.0f1 and the Mono2x variant take ~23 min each on PRs under xvfb plus Mesa llvmpipe. Other Linux cells finish in ~3 min. Slowness is Unity 6 plus software rasterisation. Both cells stay in the weekly cron so regressions still surface. - matrix-shared.json pr_exclude moves from literal exclude objects to partial-cell rules using stable identifiers (unity, platform, backend). - Adds { "unity": "6000.4.0f1", "platform": "StandaloneLinux64" } to drop both Linux Unity 6 cells from PRs. - setup step expands rules against live matrix data, so changeset bumps and runner renames cannot silently break excludes. - Two assertions in setup. Empty rule or unknown key fails before expansion. Identifier with no matching cell fails after. - Weekly cron and workflow_dispatch see the full 24-cell matrix. PR cell count goes from 16 to 14. Weekly cell count stays at 24. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d4998a8 commit 65d8810

2 files changed

Lines changed: 59 additions & 7 deletions

File tree

.github/scripts/audience/matrix-shared.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
{ "target": "iOS", "build_player_method": "IosBuilder.Build" }
1616
],
1717
"pr_exclude": [
18-
{ "unity": { "version": "2022.3.62f2", "changeset": "7670c08855a9" } }
18+
{ "unity": "2022.3.62f2" },
19+
{ "unity": "6000.4.0f1", "platform": "StandaloneLinux64" }
1920
]
2021
}

.github/workflows/test-audience-sample-app.yml

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ env:
2626
AUDIENCE_TEST_RUN_ID: ${{ github.run_id }}-${{ github.run_attempt }}
2727

2828
jobs:
29-
# SSOT for the unity matrix and the PR-only Unity 2022 exclude. Both
30-
# playmode and mobile-build consume these outputs via fromJSON. Source
31-
# data lives in .github/scripts/audience/matrix-shared.json.
29+
# SSOT for the unity matrix and PR-only excludes. Both playmode and
30+
# mobile-build consume these outputs via fromJSON. Source data lives
31+
# in .github/scripts/audience/matrix-shared.json.
32+
#
33+
# pr_exclude in the JSON is a list of partial-cell rules using stable
34+
# identifiers (unity / platform / backend). The setup step below
35+
# validates the rule shape, expands each rule against live matrix
36+
# data into the literal exclude objects GitHub Actions matrix.exclude
37+
# expects, and asserts each rule matched exactly one cell descriptor.
3238
setup:
3339
if: |
3440
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false)
@@ -46,16 +52,61 @@ jobs:
4652
- id: set
4753
shell: bash
4854
run: |
55+
set -euo pipefail
4956
f=.github/scripts/audience/matrix-shared.json
5057
for key in unity_versions scripting_backends desktop_targets mobile_targets; do
5158
echo "$key=$(jq -c ".$key" "$f")" >> "$GITHUB_OUTPUT"
5259
done
60+
5361
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
54-
# Drop Unity 2022.3.62f2 for PRs. The full set runs on schedule and workflow_dispatch.
55-
echo "pr_exclude=$(jq -c .pr_exclude "$f")" >> "$GITHUB_OUTPUT"
62+
# Reject empty rules and unknown keys before expansion.
63+
# An empty exclude object would make GitHub Actions skip every cell.
64+
bad=$(jq -c '
65+
["unity","platform","backend"] as $allowed
66+
| [ .pr_exclude
67+
| to_entries[]
68+
| .key as $i
69+
| .value as $rule
70+
| if ($rule | length) == 0 then
71+
{ rule: $i, error: "empty rule" }
72+
else
73+
($rule | keys[] | select(. as $k | $allowed | index($k) | not))
74+
| { rule: $i, unknown_key: . }
75+
end
76+
]
77+
' "$f")
78+
if [[ "$bad" != "[]" ]]; then
79+
echo "pr_exclude rule shape errors: $bad" >&2
80+
echo "allowed keys: unity, platform, backend; each rule needs at least one" >&2
81+
exit 1
82+
fi
83+
84+
# Expand rules into full GitHub-Actions exclude objects by joining
85+
# each identifier to its full matrix entry from this same file.
86+
pr_exclude=$(jq -c '
87+
. as $root
88+
| [ .pr_exclude[] as $r
89+
| {}
90+
| (if $r.unity then .unity = ($root.unity_versions[] | select(.version == $r.unity)) else . end)
91+
| (if $r.platform then .platform = ($root.desktop_targets[] | select(.target == $r.platform)) else . end)
92+
| (if $r.backend then .backend = ($root.scripting_backends[] | select(. == $r.backend)) else . end)
93+
]
94+
' "$f")
95+
96+
# Each rule must produce exactly one expanded object. A mismatch
97+
# means a rule references an identifier that no longer exists.
98+
rule_count=$(jq '.pr_exclude | length' "$f")
99+
built_count=$(jq 'length' <<<"$pr_exclude")
100+
if [[ "$rule_count" != "$built_count" ]]; then
101+
echo "pr_exclude rule(s) matched no cells. rules=$rule_count built=$built_count" >&2
102+
echo "rules:" >&2 && jq '.pr_exclude' "$f" >&2
103+
echo "built:" >&2 && jq '.' <<<"$pr_exclude" >&2
104+
exit 1
105+
fi
56106
else
57-
echo 'pr_exclude=[]' >> "$GITHUB_OUTPUT"
107+
pr_exclude='[]'
58108
fi
109+
echo "pr_exclude=$pr_exclude" >> "$GITHUB_OUTPUT"
59110
60111
playmode:
61112
needs: setup

0 commit comments

Comments
 (0)