1
0
Fork 0

Fix tests

pull/1291/head
Sampark Sharma 2023-01-03 09:35:30 +00:00 committed by GitHub
parent 6b01e7a980
commit 13b027cad9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,6 @@ import * as utils from './internal/cacheUtils'
import * as cacheHttpClient from './internal/cacheHttpClient' import * as cacheHttpClient from './internal/cacheHttpClient'
import {createTar, extractTar, listTar} from './internal/tar' import {createTar, extractTar, listTar} from './internal/tar'
import {DownloadOptions, UploadOptions} from './options' import {DownloadOptions, UploadOptions} from './options'
import {CompressionMethod} from './internal/constants'
import {ArtifactCacheEntry} from './internal/contracts' import {ArtifactCacheEntry} from './internal/contracts'
export class ValidationError extends Error { export class ValidationError extends Error {
@ -89,12 +88,11 @@ export async function restoreCache(
checkKey(key) checkKey(key)
} }
let cacheEntry: ArtifactCacheEntry | null const compressionMethod = await utils.getCompressionMethod()
let compressionMethod = await utils.getCompressionMethod()
let archivePath = '' let archivePath = ''
try { try {
// path are needed to compute version // path are needed to compute version
cacheEntry = await cacheHttpClient.getCacheEntry(keys, paths, { const cacheEntry = await cacheHttpClient.getCacheEntry(keys, paths, {
compressionMethod, compressionMethod,
enableCrossOsArchive enableCrossOsArchive
}) })

View File

@ -79,7 +79,9 @@ export function getCacheVersion(
const components = paths const components = paths
.concat([!compressionMethod ? '' : compressionMethod]) .concat([!compressionMethod ? '' : compressionMethod])
.concat( .concat(
process.platform !== 'win32' || enableCrossOsArchive ? [] : ['windows-only'] process.platform !== 'win32' || enableCrossOsArchive
? []
: ['windows-only']
) // Only check for windows platforms if enableCrossOsArchive is false ) // Only check for windows platforms if enableCrossOsArchive is false
// Add salt to cache version to support breaking changes in cache entry // Add salt to cache version to support breaking changes in cache entry