diff --git a/dist/index.js b/dist/index.js index c91eee1f..c090b4a0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -41777,6 +41777,7 @@ async function requestUploadURL(repoKey, sha) { + // WarpBuild checkout snapshot cache: SHA-keyed tars of what the stock shallow fetch // produces. Hit = restore + skip the fetch; miss = upload after checkout. Keys are // immutable (no expiry). Fail-open: any error degrades to stock behavior. @@ -41795,9 +41796,6 @@ function getMirrorCacheSkipReason(settings) { !process.env['WARPBUILD_HOST_URL']) { return SKIP_NOT_WARPBUILD; } - if (process.platform === 'win32') { - return 'Windows is not supported by the snapshot cache yet'; - } const repoKey = process.env['GITHUB_REPOSITORY_ID'] || ''; if (!repoKey) { return 'GITHUB_REPOSITORY_ID is not set'; @@ -41878,6 +41876,11 @@ async function setup(settings) { async function setupInner(settings) { const repoKey = process.env['GITHUB_REPOSITORY_ID']; const sha = settings.commit; + // The restore/upload paths shell out to `tar`; without it, fall back cleanly. + if (!(await which('tar', false))) { + info('tar not found on PATH; using standard checkout'); + return false; + } const lookup = await lookupSnapshot(repoKey, sha); if (lookup.kind === 'disabled') { info('Snapshot cache is disabled by the backend for this organization'); diff --git a/src/warpbuild/mirror-cache.ts b/src/warpbuild/mirror-cache.ts index dbeb476e..879a43f2 100644 --- a/src/warpbuild/mirror-cache.ts +++ b/src/warpbuild/mirror-cache.ts @@ -1,6 +1,7 @@ /* eslint-disable i18n-text/no-en, import/no-unresolved -- upstream conventions; no TS import resolver configured */ import * as core from '@actions/core' import * as exec from '@actions/exec' +import * as io from '@actions/io' import * as fs from 'fs' import * as os from 'os' import * as path from 'path' @@ -38,9 +39,6 @@ export function getMirrorCacheSkipReason( ) { return SKIP_NOT_WARPBUILD } - if (process.platform === 'win32') { - return 'Windows is not supported by the snapshot cache yet' - } const repoKey = process.env['GITHUB_REPOSITORY_ID'] || '' if (!repoKey) { return 'GITHUB_REPOSITORY_ID is not set' @@ -127,6 +125,12 @@ async function setupInner(settings: IGitSourceSettings): Promise { const repoKey = process.env['GITHUB_REPOSITORY_ID'] as string const sha = settings.commit + // The restore/upload paths shell out to `tar`; without it, fall back cleanly. + if (!(await io.which('tar', false))) { + core.info('tar not found on PATH; using standard checkout') + return false + } + const lookup = await api.lookupSnapshot(repoKey, sha) if (lookup.kind === 'disabled') {