limit to github hosted runners

This commit is contained in:
Sergey Dolin 2023-07-12 09:06:59 +02:00
parent 7eefc6eb21
commit 96a955403c
2 changed files with 9 additions and 2 deletions

5
dist/setup/index.js vendored
View file

@ -61464,7 +61464,10 @@ function installGoVersion(info, auth, arch) {
if (info.type === 'dist') { if (info.type === 'dist') {
extPath = path.join(extPath, 'go'); extPath = path.join(extPath, 'go');
} }
if (isWindows) { // for github hosted windows runner handle latency of OS drive
// by avoiding write operations to C:
const isHosted = (process.env['RUNNER_ENVIRONMENT'] = 'github-hosted');
if (isWindows && isHosted) {
const defaultToolCacheRoot = process.env['RUNNER_TOOL_CACHE'] || ''; const defaultToolCacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
const substitutedToolCacheRoot = defaultToolCacheRoot const substitutedToolCacheRoot = defaultToolCacheRoot
.replace('C:', 'D:') .replace('C:', 'D:')

View file

@ -189,6 +189,7 @@ async function installGoVersion(
// Windows requires that we keep the extension (.zip) for extraction // Windows requires that we keep the extension (.zip) for extraction
const isWindows = os.platform() === 'win32'; const isWindows = os.platform() === 'win32';
const tempDir = process.env.RUNNER_TEMP || '.'; const tempDir = process.env.RUNNER_TEMP || '.';
const fileName = isWindows ? path.join(tempDir, info.fileName) : undefined; const fileName = isWindows ? path.join(tempDir, info.fileName) : undefined;
@ -201,7 +202,10 @@ async function installGoVersion(
extPath = path.join(extPath, 'go'); extPath = path.join(extPath, 'go');
} }
if (isWindows) { // for github hosted windows runner handle latency of OS drive
// by avoiding write operations to C:
const isHosted = (process.env['RUNNER_ENVIRONMENT'] = 'github-hosted');
if (isWindows && isHosted) {
const defaultToolCacheRoot = process.env['RUNNER_TOOL_CACHE'] || ''; const defaultToolCacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
const substitutedToolCacheRoot = defaultToolCacheRoot const substitutedToolCacheRoot = defaultToolCacheRoot
.replace('C:', 'D:') .replace('C:', 'D:')