mirror of https://github.com/actions/toolkit
Fix tests
parent
6b01e7a980
commit
13b027cad9
|
@ -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
|
||||||
})
|
})
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue