Skip to content

Commit 5f60c71

Browse files
style(audience): always show step scope in name, derive Unity scope from matrix
Detect or Install Unity now always shows "(Windows + macOS only)" in the step name, derived in the setup job from desktop_targets that carry an install_unity_script. Adding or removing such a target updates the label automatically. Detect or Install VS Build Tools always shows "(StandaloneWindows64 IL2CPP only)". This scope is structurally fixed so the label lives as a static job env value. In both cases the if: condition derives from the same source as the label (matrix data or the env), so name and condition cannot drift.
1 parent a83d4b0 commit 5f60c71

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

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

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
desktop_targets: ${{ steps.set.outputs.desktop_targets }}
4242
mobile_targets: ${{ steps.set.outputs.mobile_targets }}
4343
pr_exclude: ${{ steps.set.outputs.pr_exclude }}
44+
install_unity_scope: ${{ steps.set.outputs.install_unity_scope }}
4445
steps:
4546
- uses: actions/checkout@v4
4647
- id: set
@@ -56,6 +57,10 @@ jobs:
5657
else
5758
echo 'pr_exclude=[]' >> "$GITHUB_OUTPUT"
5859
fi
60+
# Friendly scope label for the "Detect or Install Unity" step: all desktop
61+
# targets that carry an install_unity_script, with target names cleaned up.
62+
install_unity_scope=$(jq -r '[.desktop_targets[] | select(.install_unity_script != "") | .target | sub("^Standalone"; "") | sub("64$"; "") | sub("OSX"; "macOS")] | join(" + ")' "$f")
63+
echo "install_unity_scope=$install_unity_scope" >> "$GITHUB_OUTPUT"
5964
6065
playmode:
6166
needs: setup
@@ -71,9 +76,12 @@ jobs:
7176
timeout-minutes: 45
7277
env:
7378
AUDIENCE_TEST_CELL_ID: ${{ matrix.platform.target }}-${{ matrix.backend }}-${{ matrix.unity.version }}
74-
# Single-source scope strings: empty when the step does not run, target-or-target+backend label when it does.
75-
INSTALL_UNITY_SCOPE: ${{ matrix.platform.install_unity_script != '' && matrix.platform.target || '' }}
76-
INSTALL_VS_TOOLS_SCOPE: ${{ matrix.platform.target == 'StandaloneWindows64' && matrix.backend == 'IL2CPP' && format('{0} {1}', matrix.platform.target, matrix.backend) || '' }}
79+
# Always-populated scope labels. Step names show them as "(<scope> only)" on
80+
# 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).
83+
INSTALL_UNITY_SCOPE: ${{ needs.setup.outputs.install_unity_scope }}
84+
INSTALL_VS_TOOLS_SCOPE: StandaloneWindows64 IL2CPP
7785

7886
steps:
7987
- uses: actions/checkout@v4
@@ -89,16 +97,16 @@ jobs:
8997
Library-${{ matrix.backend }}-${{ matrix.platform.target }}-${{ matrix.unity.version }}-
9098
Library-${{ matrix.backend }}-${{ matrix.platform.target }}-
9199
92-
- name: Detect or Install Unity${{ env.INSTALL_UNITY_SCOPE && format(' ({0} only)', env.INSTALL_UNITY_SCOPE) || '' }}
93-
if: env.INSTALL_UNITY_SCOPE
100+
- name: Detect or Install Unity (${{ env.INSTALL_UNITY_SCOPE }} only)
101+
if: matrix.platform.install_unity_script != ''
94102
env:
95103
UNITY_VERSION: ${{ matrix.unity.version }}
96104
UNITY_CHANGESET: ${{ matrix.unity.changeset }}
97105
BACKEND: ${{ matrix.backend }}
98106
run: ${{ matrix.platform.install_unity_script }}
99107

100-
- name: Detect or Install VS Build Tools${{ env.INSTALL_VS_TOOLS_SCOPE && format(' ({0} only)', env.INSTALL_VS_TOOLS_SCOPE) || '' }}
101-
if: env.INSTALL_VS_TOOLS_SCOPE
108+
- 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
102110
shell: pwsh
103111
run: .github/scripts/audience/ensure-msvc-windows.ps1
104112

0 commit comments

Comments
 (0)