Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkg/workflow/compiler_yaml_main_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,12 @@ func (c *Compiler) generateRuntimeAndWorkspaceSetupSteps(yaml *strings.Builder,
// This step must run before any runtime setup steps (setup-go, setup-node, etc.) so that
// those actions pick up the redirected path when they write into RUNNER_TOOL_CACHE.
if isArcDindTopology(data) {
yaml.WriteString(" - name: Redirect tool cache for ARC/DinD\n")
yaml.WriteString(" - name: Redirect tool cache and install paths for ARC/DinD\n")
yaml.WriteString(" run: |\n")
yaml.WriteString(" mkdir -p \"${RUNNER_TEMP}/gh-aw/tool-cache\"\n")
yaml.WriteString(" echo \"RUNNER_TOOL_CACHE=${RUNNER_TEMP}/gh-aw/tool-cache\" >> \"$GITHUB_ENV\"\n")
yaml.WriteString(" echo \"DOTNET_INSTALL_DIR=${RUNNER_TEMP}/gh-aw/tool-cache/dotnet\" >> \"$GITHUB_ENV\"\n")
yaml.WriteString(" echo \"GOPATH=${RUNNER_TEMP}/gh-aw/tool-cache/go\" >> \"$GITHUB_ENV\"\n")
}

if needsCheckout || !customStepsContainCheckout {
Expand Down
4 changes: 3 additions & 1 deletion pkg/workflow/compiler_yaml_main_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -748,9 +748,11 @@ func TestGenerateMainJobStepsArcDindRedirectsToolCacheToRunnerTemp(t *testing.T)
require.NoError(t, err)

result := yaml.String()
assert.Contains(t, result, "- name: Redirect tool cache for ARC/DinD")
assert.Contains(t, result, "- name: Redirect tool cache and install paths for ARC/DinD")
assert.Contains(t, result, `mkdir -p "${RUNNER_TEMP}/gh-aw/tool-cache"`)
assert.Contains(t, result, `echo "RUNNER_TOOL_CACHE=${RUNNER_TEMP}/gh-aw/tool-cache" >> "$GITHUB_ENV"`)
assert.Contains(t, result, `echo "DOTNET_INSTALL_DIR=${RUNNER_TEMP}/gh-aw/tool-cache/dotnet" >> "$GITHUB_ENV"`)
assert.Contains(t, result, `echo "GOPATH=${RUNNER_TEMP}/gh-aw/tool-cache/go" >> "$GITHUB_ENV"`)
assert.NotContains(t, result, "/tmp/gh-aw/tool-cache")
}

Expand Down
Loading