Skip to content

Commit 22fce64

Browse files
style(audience): derive INSTALL_VS_TOOLS_SCOPE from matrix data too
Setup job computes the VS Build Tools scope label as the cartesian product of Windows desktop targets and the IL2CPP backend, joined with " or ". Adding a Windows variant or removing IL2CPP from the backend list updates the label automatically. Step if: switches from == to contains() so the same label works for the future multi-target case (e.g. "StandaloneWindows64 IL2CPP or StandaloneWindowsArm64 IL2CPP").
1 parent 5f60c71 commit 22fce64

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jobs:
4242
mobile_targets: ${{ steps.set.outputs.mobile_targets }}
4343
pr_exclude: ${{ steps.set.outputs.pr_exclude }}
4444
install_unity_scope: ${{ steps.set.outputs.install_unity_scope }}
45+
install_vs_tools_scope: ${{ steps.set.outputs.install_vs_tools_scope }}
4546
steps:
4647
- uses: actions/checkout@v4
4748
- id: set
@@ -61,6 +62,17 @@ jobs:
6162
# targets that carry an install_unity_script, with target names cleaned up.
6263
install_unity_scope=$(jq -r '[.desktop_targets[] | select(.install_unity_script != "") | .target | sub("^Standalone"; "") | sub("64$"; "") | sub("OSX"; "macOS")] | join(" + ")' "$f")
6364
echo "install_unity_scope=$install_unity_scope" >> "$GITHUB_OUTPUT"
65+
# Scope label for the "Detect or Install VS Build Tools" step: cartesian
66+
# of Windows desktop targets and the IL2CPP backend (the structural Unity
67+
# rule). Joined with " or " so multi-target setups still produce a single
68+
# readable label.
69+
install_vs_tools_scope=$(jq -r '
70+
[.desktop_targets[] | select(.target | contains("Windows")) | .target] as $win
71+
| (.scripting_backends | map(select(. == "IL2CPP"))) as $il
72+
| [$win[] as $t | $il[] as $b | "\($t) \($b)"]
73+
| join(" or ")
74+
' "$f")
75+
echo "install_vs_tools_scope=$install_vs_tools_scope" >> "$GITHUB_OUTPUT"
6476
6577
playmode:
6678
needs: setup
@@ -78,10 +90,9 @@ jobs:
7890
AUDIENCE_TEST_CELL_ID: ${{ matrix.platform.target }}-${{ matrix.backend }}-${{ matrix.unity.version }}
7991
# Always-populated scope labels. Step names show them as "(<scope> only)" on
8092
# every cell, so a reader can see what the step is for without expanding it.
81-
# Unity scope is derived from matrix data in the setup job.
82-
# VS Build Tools scope is structurally fixed (Windows IL2CPP needs MSVC).
93+
# Both labels are derived from matrix data in the setup job.
8394
INSTALL_UNITY_SCOPE: ${{ needs.setup.outputs.install_unity_scope }}
84-
INSTALL_VS_TOOLS_SCOPE: StandaloneWindows64 IL2CPP
95+
INSTALL_VS_TOOLS_SCOPE: ${{ needs.setup.outputs.install_vs_tools_scope }}
8596

8697
steps:
8798
- uses: actions/checkout@v4
@@ -106,7 +117,7 @@ jobs:
106117
run: ${{ matrix.platform.install_unity_script }}
107118

108119
- name: Detect or Install VS Build Tools (${{ env.INSTALL_VS_TOOLS_SCOPE }} only)
109-
if: format('{0} {1}', matrix.platform.target, matrix.backend) == env.INSTALL_VS_TOOLS_SCOPE
120+
if: contains(env.INSTALL_VS_TOOLS_SCOPE, format('{0} {1}', matrix.platform.target, matrix.backend))
110121
shell: pwsh
111122
run: .github/scripts/audience/ensure-msvc-windows.ps1
112123

0 commit comments

Comments
 (0)