Skip to content

Commit 2a1a970

Browse files
ci(audience): install git-lfs on linux runner before checkout (SDK-340)
- Linux pre-checkout step apt-installs git and git-lfs if missing. - imx-sdkbuild lacked git-lfs, so actions/checkout@v4 with lfs: true failed with exit 128: "Unable to locate executable file: git-lfs". - Idempotent: skips install when both binaries already on PATH. - Mirrors the Unity Hub install pattern; relies on passwordless sudo for the runner user. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c9d3ddb commit 2a1a970

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,26 @@ jobs:
136136
}
137137
Write-Host "::warning::Workspace not fully cleaned; checkout may fail"
138138
139+
- name: Ensure git and git-lfs (Linux, idempotent)
140+
if: runner.os == 'Linux'
141+
shell: bash
142+
run: |
143+
# actions/checkout@v4 below uses lfs: true, which needs both git
144+
# and git-lfs on PATH. Self-hosted Linux runners may not have
145+
# git-lfs preinstalled, so install on demand. Idempotent: skip
146+
# whichever is already present. Requires passwordless sudo for
147+
# the runner user, same assumption as the Unity Hub install.
148+
set -uo pipefail
149+
needs=()
150+
command -v git >/dev/null 2>&1 || needs+=(git)
151+
command -v git-lfs >/dev/null 2>&1 || needs+=(git-lfs)
152+
if [ ${#needs[@]} -gt 0 ]; then
153+
sudo apt-get update -qq
154+
sudo apt-get install -y --no-install-recommends "${needs[@]}"
155+
fi
156+
git --version
157+
git-lfs --version
158+
139159
- uses: actions/checkout@v4
140160
with:
141161
lfs: true

0 commit comments

Comments
 (0)