mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-07-26 16:07:55 +00:00
Use @cirunlabs/cache
, update dist
This commit is contained in:
parent
640a1c2554
commit
c32473836f
5 changed files with 37 additions and 13 deletions
12
dist/restore-only/index.js
vendored
12
dist/restore-only/index.js
vendored
|
@ -198,7 +198,7 @@ function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
||||||
function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) {
|
function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
// Override UploadOptions to force the use of Azure
|
// Override UploadOptions to force the use of Azure
|
||||||
options = Object.assign(Object.assign({}, options), { useAzureSdk: true });
|
options = Object.assign(Object.assign({}, options), { useAzureSdk: false });
|
||||||
restoreKeys = restoreKeys || [];
|
restoreKeys = restoreKeys || [];
|
||||||
const keys = [primaryKey, ...restoreKeys];
|
const keys = [primaryKey, ...restoreKeys];
|
||||||
core.debug('Resolved Keys:');
|
core.debug('Resolved Keys:');
|
||||||
|
@ -223,7 +223,13 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
||||||
core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`);
|
core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
core.info(`Cache hit for: ${request.key}`);
|
const isRestoreKeyMatch = request.key !== response.matchedKey;
|
||||||
|
if (isRestoreKeyMatch) {
|
||||||
|
core.info(`Cache hit for restore-key: ${response.matchedKey}`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.info(`Cache hit for: ${response.matchedKey}`);
|
||||||
|
}
|
||||||
if (options === null || options === void 0 ? void 0 : options.lookupOnly) {
|
if (options === null || options === void 0 ? void 0 : options.lookupOnly) {
|
||||||
core.info('Lookup only - skipping download');
|
core.info('Lookup only - skipping download');
|
||||||
return response.matchedKey;
|
return response.matchedKey;
|
||||||
|
@ -380,7 +386,7 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
|
||||||
// Override UploadOptions to force the use of Azure
|
// Override UploadOptions to force the use of Azure
|
||||||
// ...options goes first because we want to override the default values
|
// ...options goes first because we want to override the default values
|
||||||
// set in UploadOptions with these specific figures
|
// set in UploadOptions with these specific figures
|
||||||
options = Object.assign(Object.assign({}, options), { uploadChunkSize: 64 * 1024 * 1024, uploadConcurrency: 8, useAzureSdk: true });
|
options = Object.assign(Object.assign({}, options), { uploadChunkSize: 64 * 1024 * 1024, uploadConcurrency: 8, useAzureSdk: false });
|
||||||
const compressionMethod = yield utils.getCompressionMethod();
|
const compressionMethod = yield utils.getCompressionMethod();
|
||||||
const twirpClient = cacheTwirpClient.internalCacheTwirpClient();
|
const twirpClient = cacheTwirpClient.internalCacheTwirpClient();
|
||||||
let cacheId = -1;
|
let cacheId = -1;
|
||||||
|
|
12
dist/restore/index.js
vendored
12
dist/restore/index.js
vendored
|
@ -198,7 +198,7 @@ function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
||||||
function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) {
|
function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
// Override UploadOptions to force the use of Azure
|
// Override UploadOptions to force the use of Azure
|
||||||
options = Object.assign(Object.assign({}, options), { useAzureSdk: true });
|
options = Object.assign(Object.assign({}, options), { useAzureSdk: false });
|
||||||
restoreKeys = restoreKeys || [];
|
restoreKeys = restoreKeys || [];
|
||||||
const keys = [primaryKey, ...restoreKeys];
|
const keys = [primaryKey, ...restoreKeys];
|
||||||
core.debug('Resolved Keys:');
|
core.debug('Resolved Keys:');
|
||||||
|
@ -223,7 +223,13 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
||||||
core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`);
|
core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
core.info(`Cache hit for: ${request.key}`);
|
const isRestoreKeyMatch = request.key !== response.matchedKey;
|
||||||
|
if (isRestoreKeyMatch) {
|
||||||
|
core.info(`Cache hit for restore-key: ${response.matchedKey}`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.info(`Cache hit for: ${response.matchedKey}`);
|
||||||
|
}
|
||||||
if (options === null || options === void 0 ? void 0 : options.lookupOnly) {
|
if (options === null || options === void 0 ? void 0 : options.lookupOnly) {
|
||||||
core.info('Lookup only - skipping download');
|
core.info('Lookup only - skipping download');
|
||||||
return response.matchedKey;
|
return response.matchedKey;
|
||||||
|
@ -380,7 +386,7 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
|
||||||
// Override UploadOptions to force the use of Azure
|
// Override UploadOptions to force the use of Azure
|
||||||
// ...options goes first because we want to override the default values
|
// ...options goes first because we want to override the default values
|
||||||
// set in UploadOptions with these specific figures
|
// set in UploadOptions with these specific figures
|
||||||
options = Object.assign(Object.assign({}, options), { uploadChunkSize: 64 * 1024 * 1024, uploadConcurrency: 8, useAzureSdk: true });
|
options = Object.assign(Object.assign({}, options), { uploadChunkSize: 64 * 1024 * 1024, uploadConcurrency: 8, useAzureSdk: false });
|
||||||
const compressionMethod = yield utils.getCompressionMethod();
|
const compressionMethod = yield utils.getCompressionMethod();
|
||||||
const twirpClient = cacheTwirpClient.internalCacheTwirpClient();
|
const twirpClient = cacheTwirpClient.internalCacheTwirpClient();
|
||||||
let cacheId = -1;
|
let cacheId = -1;
|
||||||
|
|
12
dist/save-only/index.js
vendored
12
dist/save-only/index.js
vendored
|
@ -198,7 +198,7 @@ function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
||||||
function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) {
|
function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
// Override UploadOptions to force the use of Azure
|
// Override UploadOptions to force the use of Azure
|
||||||
options = Object.assign(Object.assign({}, options), { useAzureSdk: true });
|
options = Object.assign(Object.assign({}, options), { useAzureSdk: false });
|
||||||
restoreKeys = restoreKeys || [];
|
restoreKeys = restoreKeys || [];
|
||||||
const keys = [primaryKey, ...restoreKeys];
|
const keys = [primaryKey, ...restoreKeys];
|
||||||
core.debug('Resolved Keys:');
|
core.debug('Resolved Keys:');
|
||||||
|
@ -223,7 +223,13 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
||||||
core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`);
|
core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
core.info(`Cache hit for: ${request.key}`);
|
const isRestoreKeyMatch = request.key !== response.matchedKey;
|
||||||
|
if (isRestoreKeyMatch) {
|
||||||
|
core.info(`Cache hit for restore-key: ${response.matchedKey}`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.info(`Cache hit for: ${response.matchedKey}`);
|
||||||
|
}
|
||||||
if (options === null || options === void 0 ? void 0 : options.lookupOnly) {
|
if (options === null || options === void 0 ? void 0 : options.lookupOnly) {
|
||||||
core.info('Lookup only - skipping download');
|
core.info('Lookup only - skipping download');
|
||||||
return response.matchedKey;
|
return response.matchedKey;
|
||||||
|
@ -380,7 +386,7 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
|
||||||
// Override UploadOptions to force the use of Azure
|
// Override UploadOptions to force the use of Azure
|
||||||
// ...options goes first because we want to override the default values
|
// ...options goes first because we want to override the default values
|
||||||
// set in UploadOptions with these specific figures
|
// set in UploadOptions with these specific figures
|
||||||
options = Object.assign(Object.assign({}, options), { uploadChunkSize: 64 * 1024 * 1024, uploadConcurrency: 8, useAzureSdk: true });
|
options = Object.assign(Object.assign({}, options), { uploadChunkSize: 64 * 1024 * 1024, uploadConcurrency: 8, useAzureSdk: false });
|
||||||
const compressionMethod = yield utils.getCompressionMethod();
|
const compressionMethod = yield utils.getCompressionMethod();
|
||||||
const twirpClient = cacheTwirpClient.internalCacheTwirpClient();
|
const twirpClient = cacheTwirpClient.internalCacheTwirpClient();
|
||||||
let cacheId = -1;
|
let cacheId = -1;
|
||||||
|
|
12
dist/save/index.js
vendored
12
dist/save/index.js
vendored
|
@ -198,7 +198,7 @@ function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
||||||
function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) {
|
function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
// Override UploadOptions to force the use of Azure
|
// Override UploadOptions to force the use of Azure
|
||||||
options = Object.assign(Object.assign({}, options), { useAzureSdk: true });
|
options = Object.assign(Object.assign({}, options), { useAzureSdk: false });
|
||||||
restoreKeys = restoreKeys || [];
|
restoreKeys = restoreKeys || [];
|
||||||
const keys = [primaryKey, ...restoreKeys];
|
const keys = [primaryKey, ...restoreKeys];
|
||||||
core.debug('Resolved Keys:');
|
core.debug('Resolved Keys:');
|
||||||
|
@ -223,7 +223,13 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
||||||
core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`);
|
core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
core.info(`Cache hit for: ${request.key}`);
|
const isRestoreKeyMatch = request.key !== response.matchedKey;
|
||||||
|
if (isRestoreKeyMatch) {
|
||||||
|
core.info(`Cache hit for restore-key: ${response.matchedKey}`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.info(`Cache hit for: ${response.matchedKey}`);
|
||||||
|
}
|
||||||
if (options === null || options === void 0 ? void 0 : options.lookupOnly) {
|
if (options === null || options === void 0 ? void 0 : options.lookupOnly) {
|
||||||
core.info('Lookup only - skipping download');
|
core.info('Lookup only - skipping download');
|
||||||
return response.matchedKey;
|
return response.matchedKey;
|
||||||
|
@ -380,7 +386,7 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
|
||||||
// Override UploadOptions to force the use of Azure
|
// Override UploadOptions to force the use of Azure
|
||||||
// ...options goes first because we want to override the default values
|
// ...options goes first because we want to override the default values
|
||||||
// set in UploadOptions with these specific figures
|
// set in UploadOptions with these specific figures
|
||||||
options = Object.assign(Object.assign({}, options), { uploadChunkSize: 64 * 1024 * 1024, uploadConcurrency: 8, useAzureSdk: true });
|
options = Object.assign(Object.assign({}, options), { uploadChunkSize: 64 * 1024 * 1024, uploadConcurrency: 8, useAzureSdk: false });
|
||||||
const compressionMethod = yield utils.getCompressionMethod();
|
const compressionMethod = yield utils.getCompressionMethod();
|
||||||
const twirpClient = cacheTwirpClient.internalCacheTwirpClient();
|
const twirpClient = cacheTwirpClient.internalCacheTwirpClient();
|
||||||
let cacheId = -1;
|
let cacheId = -1;
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
"author": "GitHub",
|
"author": "GitHub",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^4.0.3",
|
"@cirunlabs/cache": "^4.0.3",
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/io": "^1.1.3"
|
"@actions/io": "^1.1.3"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue