Add saveCacheV2 tests

This commit is contained in:
John Sudol
2024-11-24 18:44:39 +00:00
parent 928d3e806d
commit 8f606682c2
3 changed files with 315 additions and 3 deletions

View File

@@ -328,10 +328,10 @@ export async function saveCache(
options?: UploadOptions,
enableCrossOsArchive = false
): Promise<number> {
const cacheServiceVersion: string = getCacheServiceVersion()
core.debug(`Cache service version: ${cacheServiceVersion}`)
checkPaths(paths)
checkKey(key)
const cacheServiceVersion: string = getCacheServiceVersion()
switch (cacheServiceVersion) {
case 'v2':
return await saveCacheV2(paths, key, options, enableCrossOsArchive)

View File

@@ -1,6 +1,7 @@
import * as core from '@actions/core'
import {
BlobClient,
BlobUploadCommonResponse,
BlockBlobClient,
BlockBlobParallelUploadOptions
} from '@azure/storage-blob'
@@ -8,7 +9,7 @@ import {
export async function uploadCacheFile(
signedUploadURL: string,
archivePath: string
): Promise<{}> {
): Promise<BlobUploadCommonResponse> {
// Specify data transfer options
const uploadOptions: BlockBlobParallelUploadOptions = {
blockSize: 4 * 1024 * 1024, // 4 MiB max block size