Skip to content

Commit 5acb063

Browse files
build(deps): bump @actions/cache from 3.0.3 to 3.0.4 (#555)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent 08fdc05 commit 5acb063

File tree

4 files changed

+98
-92
lines changed

4 files changed

+98
-92
lines changed

dist/post_run/index.js

+45-42
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,7 @@ const fs_1 = __nccwpck_require__(7147);
10701070
const path = __importStar(__nccwpck_require__(1017));
10711071
const utils = __importStar(__nccwpck_require__(1518));
10721072
const constants_1 = __nccwpck_require__(8840);
1073+
const IS_WINDOWS = process.platform === 'win32';
10731074
function getTarPath(args, compressionMethod) {
10741075
return __awaiter(this, void 0, void 0, function* () {
10751076
switch (process.platform) {
@@ -1117,26 +1118,43 @@ function getWorkingDirectory() {
11171118
var _a;
11181119
return (_a = process.env['GITHUB_WORKSPACE']) !== null && _a !== void 0 ? _a : process.cwd();
11191120
}
1121+
// Common function for extractTar and listTar to get the compression method
1122+
function getCompressionProgram(compressionMethod) {
1123+
// -d: Decompress.
1124+
// unzstd is equivalent to 'zstd -d'
1125+
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
1126+
// Using 30 here because we also support 32-bit self-hosted runners.
1127+
switch (compressionMethod) {
1128+
case constants_1.CompressionMethod.Zstd:
1129+
return [
1130+
'--use-compress-program',
1131+
IS_WINDOWS ? 'zstd -d --long=30' : 'unzstd --long=30'
1132+
];
1133+
case constants_1.CompressionMethod.ZstdWithoutLong:
1134+
return ['--use-compress-program', IS_WINDOWS ? 'zstd -d' : 'unzstd'];
1135+
default:
1136+
return ['-z'];
1137+
}
1138+
}
1139+
function listTar(archivePath, compressionMethod) {
1140+
return __awaiter(this, void 0, void 0, function* () {
1141+
const args = [
1142+
...getCompressionProgram(compressionMethod),
1143+
'-tf',
1144+
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
1145+
'-P'
1146+
];
1147+
yield execTar(args, compressionMethod);
1148+
});
1149+
}
1150+
exports.listTar = listTar;
11201151
function extractTar(archivePath, compressionMethod) {
11211152
return __awaiter(this, void 0, void 0, function* () {
11221153
// Create directory to extract tar into
11231154
const workingDirectory = getWorkingDirectory();
11241155
yield io.mkdirP(workingDirectory);
1125-
// --d: Decompress.
1126-
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
1127-
// Using 30 here because we also support 32-bit self-hosted runners.
1128-
function getCompressionProgram() {
1129-
switch (compressionMethod) {
1130-
case constants_1.CompressionMethod.Zstd:
1131-
return ['--use-compress-program', 'unzstd --long=30'];
1132-
case constants_1.CompressionMethod.ZstdWithoutLong:
1133-
return ['--use-compress-program', 'unzstd'];
1134-
default:
1135-
return ['-z'];
1136-
}
1137-
}
11381156
const args = [
1139-
...getCompressionProgram(),
1157+
...getCompressionProgram(compressionMethod),
11401158
'-xf',
11411159
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
11421160
'-P',
@@ -1155,15 +1173,19 @@ function createTar(archiveFolder, sourceDirectories, compressionMethod) {
11551173
fs_1.writeFileSync(path.join(archiveFolder, manifestFilename), sourceDirectories.join('\n'));
11561174
const workingDirectory = getWorkingDirectory();
11571175
// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.
1176+
// zstdmt is equivalent to 'zstd -T0'
11581177
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
11591178
// Using 30 here because we also support 32-bit self-hosted runners.
11601179
// Long range mode is added to zstd in v1.3.2 release, so we will not use --long in older version of zstd.
11611180
function getCompressionProgram() {
11621181
switch (compressionMethod) {
11631182
case constants_1.CompressionMethod.Zstd:
1164-
return ['--use-compress-program', 'zstdmt --long=30'];
1183+
return [
1184+
'--use-compress-program',
1185+
IS_WINDOWS ? 'zstd -T0 --long=30' : 'zstdmt --long=30'
1186+
];
11651187
case constants_1.CompressionMethod.ZstdWithoutLong:
1166-
return ['--use-compress-program', 'zstdmt'];
1188+
return ['--use-compress-program', IS_WINDOWS ? 'zstd -T0' : 'zstdmt'];
11671189
default:
11681190
return ['-z'];
11691191
}
@@ -1185,32 +1207,6 @@ function createTar(archiveFolder, sourceDirectories, compressionMethod) {
11851207
});
11861208
}
11871209
exports.createTar = createTar;
1188-
function listTar(archivePath, compressionMethod) {
1189-
return __awaiter(this, void 0, void 0, function* () {
1190-
// --d: Decompress.
1191-
// --long=#: Enables long distance matching with # bits.
1192-
// Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
1193-
// Using 30 here because we also support 32-bit self-hosted runners.
1194-
function getCompressionProgram() {
1195-
switch (compressionMethod) {
1196-
case constants_1.CompressionMethod.Zstd:
1197-
return ['--use-compress-program', 'unzstd --long=30'];
1198-
case constants_1.CompressionMethod.ZstdWithoutLong:
1199-
return ['--use-compress-program', 'unzstd'];
1200-
default:
1201-
return ['-z'];
1202-
}
1203-
}
1204-
const args = [
1205-
...getCompressionProgram(),
1206-
'-tf',
1207-
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
1208-
'-P'
1209-
];
1210-
yield execTar(args, compressionMethod);
1211-
});
1212-
}
1213-
exports.listTar = listTar;
12141210
//# sourceMappingURL=tar.js.map
12151211

12161212
/***/ }),
@@ -1278,9 +1274,16 @@ function getDownloadOptions(copy) {
12781274
result.segmentTimeoutInMs = copy.segmentTimeoutInMs;
12791275
}
12801276
}
1277+
const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'];
1278+
if (segmentDownloadTimeoutMins &&
1279+
!isNaN(Number(segmentDownloadTimeoutMins)) &&
1280+
isFinite(Number(segmentDownloadTimeoutMins))) {
1281+
result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1000;
1282+
}
12811283
core.debug(`Use Azure SDK: ${result.useAzureSdk}`);
12821284
core.debug(`Download concurrency: ${result.downloadConcurrency}`);
12831285
core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
1286+
core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`);
12841287
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
12851288
return result;
12861289
}

dist/run/index.js

+45-42
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,7 @@ const fs_1 = __nccwpck_require__(7147);
10701070
const path = __importStar(__nccwpck_require__(1017));
10711071
const utils = __importStar(__nccwpck_require__(1518));
10721072
const constants_1 = __nccwpck_require__(8840);
1073+
const IS_WINDOWS = process.platform === 'win32';
10731074
function getTarPath(args, compressionMethod) {
10741075
return __awaiter(this, void 0, void 0, function* () {
10751076
switch (process.platform) {
@@ -1117,26 +1118,43 @@ function getWorkingDirectory() {
11171118
var _a;
11181119
return (_a = process.env['GITHUB_WORKSPACE']) !== null && _a !== void 0 ? _a : process.cwd();
11191120
}
1121+
// Common function for extractTar and listTar to get the compression method
1122+
function getCompressionProgram(compressionMethod) {
1123+
// -d: Decompress.
1124+
// unzstd is equivalent to 'zstd -d'
1125+
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
1126+
// Using 30 here because we also support 32-bit self-hosted runners.
1127+
switch (compressionMethod) {
1128+
case constants_1.CompressionMethod.Zstd:
1129+
return [
1130+
'--use-compress-program',
1131+
IS_WINDOWS ? 'zstd -d --long=30' : 'unzstd --long=30'
1132+
];
1133+
case constants_1.CompressionMethod.ZstdWithoutLong:
1134+
return ['--use-compress-program', IS_WINDOWS ? 'zstd -d' : 'unzstd'];
1135+
default:
1136+
return ['-z'];
1137+
}
1138+
}
1139+
function listTar(archivePath, compressionMethod) {
1140+
return __awaiter(this, void 0, void 0, function* () {
1141+
const args = [
1142+
...getCompressionProgram(compressionMethod),
1143+
'-tf',
1144+
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
1145+
'-P'
1146+
];
1147+
yield execTar(args, compressionMethod);
1148+
});
1149+
}
1150+
exports.listTar = listTar;
11201151
function extractTar(archivePath, compressionMethod) {
11211152
return __awaiter(this, void 0, void 0, function* () {
11221153
// Create directory to extract tar into
11231154
const workingDirectory = getWorkingDirectory();
11241155
yield io.mkdirP(workingDirectory);
1125-
// --d: Decompress.
1126-
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
1127-
// Using 30 here because we also support 32-bit self-hosted runners.
1128-
function getCompressionProgram() {
1129-
switch (compressionMethod) {
1130-
case constants_1.CompressionMethod.Zstd:
1131-
return ['--use-compress-program', 'unzstd --long=30'];
1132-
case constants_1.CompressionMethod.ZstdWithoutLong:
1133-
return ['--use-compress-program', 'unzstd'];
1134-
default:
1135-
return ['-z'];
1136-
}
1137-
}
11381156
const args = [
1139-
...getCompressionProgram(),
1157+
...getCompressionProgram(compressionMethod),
11401158
'-xf',
11411159
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
11421160
'-P',
@@ -1155,15 +1173,19 @@ function createTar(archiveFolder, sourceDirectories, compressionMethod) {
11551173
fs_1.writeFileSync(path.join(archiveFolder, manifestFilename), sourceDirectories.join('\n'));
11561174
const workingDirectory = getWorkingDirectory();
11571175
// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.
1176+
// zstdmt is equivalent to 'zstd -T0'
11581177
// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
11591178
// Using 30 here because we also support 32-bit self-hosted runners.
11601179
// Long range mode is added to zstd in v1.3.2 release, so we will not use --long in older version of zstd.
11611180
function getCompressionProgram() {
11621181
switch (compressionMethod) {
11631182
case constants_1.CompressionMethod.Zstd:
1164-
return ['--use-compress-program', 'zstdmt --long=30'];
1183+
return [
1184+
'--use-compress-program',
1185+
IS_WINDOWS ? 'zstd -T0 --long=30' : 'zstdmt --long=30'
1186+
];
11651187
case constants_1.CompressionMethod.ZstdWithoutLong:
1166-
return ['--use-compress-program', 'zstdmt'];
1188+
return ['--use-compress-program', IS_WINDOWS ? 'zstd -T0' : 'zstdmt'];
11671189
default:
11681190
return ['-z'];
11691191
}
@@ -1185,32 +1207,6 @@ function createTar(archiveFolder, sourceDirectories, compressionMethod) {
11851207
});
11861208
}
11871209
exports.createTar = createTar;
1188-
function listTar(archivePath, compressionMethod) {
1189-
return __awaiter(this, void 0, void 0, function* () {
1190-
// --d: Decompress.
1191-
// --long=#: Enables long distance matching with # bits.
1192-
// Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.
1193-
// Using 30 here because we also support 32-bit self-hosted runners.
1194-
function getCompressionProgram() {
1195-
switch (compressionMethod) {
1196-
case constants_1.CompressionMethod.Zstd:
1197-
return ['--use-compress-program', 'unzstd --long=30'];
1198-
case constants_1.CompressionMethod.ZstdWithoutLong:
1199-
return ['--use-compress-program', 'unzstd'];
1200-
default:
1201-
return ['-z'];
1202-
}
1203-
}
1204-
const args = [
1205-
...getCompressionProgram(),
1206-
'-tf',
1207-
archivePath.replace(new RegExp(`\\${path.sep}`, 'g'), '/'),
1208-
'-P'
1209-
];
1210-
yield execTar(args, compressionMethod);
1211-
});
1212-
}
1213-
exports.listTar = listTar;
12141210
//# sourceMappingURL=tar.js.map
12151211

12161212
/***/ }),
@@ -1278,9 +1274,16 @@ function getDownloadOptions(copy) {
12781274
result.segmentTimeoutInMs = copy.segmentTimeoutInMs;
12791275
}
12801276
}
1277+
const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'];
1278+
if (segmentDownloadTimeoutMins &&
1279+
!isNaN(Number(segmentDownloadTimeoutMins)) &&
1280+
isFinite(Number(segmentDownloadTimeoutMins))) {
1281+
result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1000;
1282+
}
12811283
core.debug(`Use Azure SDK: ${result.useAzureSdk}`);
12821284
core.debug(`Download concurrency: ${result.downloadConcurrency}`);
12831285
core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
1286+
core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`);
12841287
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
12851288
return result;
12861289
}

package-lock.json

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"author": "golangci",
2525
"license": "MIT",
2626
"dependencies": {
27-
"@actions/cache": "^3.0.3",
27+
"@actions/cache": "^3.0.4",
2828
"@actions/core": "^1.9.1",
2929
"@actions/exec": "^1.1.1",
3030
"@actions/github": "^5.1.0",

0 commit comments

Comments
 (0)