Compare commits

..

11 Commits

Author SHA1 Message Date
Jackie Brewster
1710556e46 Merge 498cbc2966 into 2a017f350d 2023-10-10 03:25:52 -07:00
Jackie Brewster
498cbc2966 Create Apple App Store 2023-10-10 03:25:28 -07:00
Nikolai Laevskii
2a017f350d Merge pull request #859 from actions/update-temp-directory-creation
Update temp directory creation
2023-10-09 07:12:35 +02:00
Dmitry Shibanov
72c43c2d8f Update semver (#861) 2023-09-27 12:57:35 +02:00
Nikolai Laevskii
d3ace34546 Update build 2023-09-25 16:37:45 +02:00
Nikolai Laevskii
acbf0586b1 Fix typo 2023-09-25 15:58:01 +02:00
Nikolai Laevskii
f1744b62b7 Update license 2023-09-25 15:58:01 +02:00
Nikolai Laevskii
2651591c72 Update temporary directory creation 2023-09-25 15:58:01 +02:00
Dmitry Shibanov
5e21ff4d9b Remove filter for cached paths (#831) 2023-08-15 15:53:46 +02:00
Dmitry Shibanov
bea5baf987 change getinput to getstate for cache (#816) 2023-08-10 16:32:24 +02:00
dependabot[bot]
d82f92a0eb Bump word-wrap from 1.2.3 to 1.2.4 (#815)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-04 09:56:30 +02:00
9 changed files with 1884 additions and 1819 deletions

View File

@@ -1,9 +1,9 @@
--- ---
name: semver name: semver
version: 5.7.0 version: 5.7.2
type: npm type: npm
summary: The semantic version parser used by npm. summary: The semantic version parser used by npm.
homepage: https://github.com/npm/node-semver#readme homepage:
license: isc license: isc
licenses: licenses:
- sources: LICENSE - sources: LICENSE

1
Apple Normal file
View File

@@ -0,0 +1 @@

View File

@@ -92,6 +92,9 @@ describe('run', () => {
it('Package manager is not valid, skip caching', async () => { it('Package manager is not valid, skip caching', async () => {
inputs['cache'] = 'yarn3'; inputs['cache'] = 'yarn3';
getStateSpy.mockImplementation(key =>
key === State.CachePackageManager ? inputs['cache'] : ''
);
await run(); await run();
@@ -108,7 +111,9 @@ describe('run', () => {
it('should not save cache for yarn1', async () => { it('should not save cache for yarn1', async () => {
inputs['cache'] = 'yarn'; inputs['cache'] = 'yarn';
getStateSpy.mockImplementation(key => getStateSpy.mockImplementation(key =>
key === State.CachePrimaryKey || key === State.CacheMatchedKey key === State.CachePackageManager
? inputs['cache']
: key === State.CachePrimaryKey || key === State.CacheMatchedKey
? yarnFileHash ? yarnFileHash
: key === State.CachePaths : key === State.CachePaths
? '["/foo/bar"]' ? '["/foo/bar"]'
@@ -117,8 +122,8 @@ describe('run', () => {
await run(); await run();
expect(getInputSpy).toHaveBeenCalled(); expect(getInputSpy).not.toHaveBeenCalled();
expect(getStateSpy).toHaveBeenCalledTimes(3); expect(getStateSpy).toHaveBeenCalledTimes(4);
expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
expect(debugSpy).toHaveBeenCalledTimes(0); expect(debugSpy).toHaveBeenCalledTimes(0);
expect(infoSpy).toHaveBeenCalledWith( expect(infoSpy).toHaveBeenCalledWith(
@@ -130,7 +135,9 @@ describe('run', () => {
it('should not save cache for yarn2', async () => { it('should not save cache for yarn2', async () => {
inputs['cache'] = 'yarn'; inputs['cache'] = 'yarn';
getStateSpy.mockImplementation(key => getStateSpy.mockImplementation(key =>
key === State.CachePrimaryKey || key === State.CacheMatchedKey key === State.CachePackageManager
? inputs['cache']
: key === State.CachePrimaryKey || key === State.CacheMatchedKey
? yarnFileHash ? yarnFileHash
: key === State.CachePaths : key === State.CachePaths
? '["/foo/bar"]' ? '["/foo/bar"]'
@@ -139,8 +146,8 @@ describe('run', () => {
await run(); await run();
expect(getInputSpy).toHaveBeenCalled(); expect(getInputSpy).not.toHaveBeenCalled();
expect(getStateSpy).toHaveBeenCalledTimes(3); expect(getStateSpy).toHaveBeenCalledTimes(4);
expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
expect(debugSpy).toHaveBeenCalledTimes(0); expect(debugSpy).toHaveBeenCalledTimes(0);
expect(infoSpy).toHaveBeenCalledWith( expect(infoSpy).toHaveBeenCalledWith(
@@ -152,7 +159,9 @@ describe('run', () => {
it('should not save cache for npm', async () => { it('should not save cache for npm', async () => {
inputs['cache'] = 'npm'; inputs['cache'] = 'npm';
getStateSpy.mockImplementation(key => getStateSpy.mockImplementation(key =>
key === State.CachePrimaryKey || key === State.CacheMatchedKey key === State.CachePackageManager
? inputs['cache']
: key === State.CachePrimaryKey || key === State.CacheMatchedKey
? yarnFileHash ? yarnFileHash
: key === State.CachePaths : key === State.CachePaths
? '["/foo/bar"]' ? '["/foo/bar"]'
@@ -162,8 +171,8 @@ describe('run', () => {
await run(); await run();
expect(getInputSpy).toHaveBeenCalled(); expect(getInputSpy).not.toHaveBeenCalled();
expect(getStateSpy).toHaveBeenCalledTimes(3); expect(getStateSpy).toHaveBeenCalledTimes(4);
expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
expect(debugSpy).toHaveBeenCalledTimes(0); expect(debugSpy).toHaveBeenCalledTimes(0);
expect(setFailedSpy).not.toHaveBeenCalled(); expect(setFailedSpy).not.toHaveBeenCalled();
@@ -172,7 +181,9 @@ describe('run', () => {
it('should not save cache for pnpm', async () => { it('should not save cache for pnpm', async () => {
inputs['cache'] = 'pnpm'; inputs['cache'] = 'pnpm';
getStateSpy.mockImplementation(key => getStateSpy.mockImplementation(key =>
key === State.CachePrimaryKey || key === State.CacheMatchedKey key === State.CachePackageManager
? inputs['cache']
: key === State.CachePrimaryKey || key === State.CacheMatchedKey
? yarnFileHash ? yarnFileHash
: key === State.CachePaths : key === State.CachePaths
? '["/foo/bar"]' ? '["/foo/bar"]'
@@ -181,8 +192,8 @@ describe('run', () => {
await run(); await run();
expect(getInputSpy).toHaveBeenCalled(); expect(getInputSpy).not.toHaveBeenCalled();
expect(getStateSpy).toHaveBeenCalledTimes(3); expect(getStateSpy).toHaveBeenCalledTimes(4);
expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
expect(debugSpy).toHaveBeenCalledTimes(0); expect(debugSpy).toHaveBeenCalledTimes(0);
expect(setFailedSpy).not.toHaveBeenCalled(); expect(setFailedSpy).not.toHaveBeenCalled();
@@ -193,7 +204,9 @@ describe('run', () => {
it('saves cache from yarn 1', async () => { it('saves cache from yarn 1', async () => {
inputs['cache'] = 'yarn'; inputs['cache'] = 'yarn';
getStateSpy.mockImplementation((key: string) => getStateSpy.mockImplementation((key: string) =>
key === State.CacheMatchedKey key === State.CachePackageManager
? inputs['cache']
: key === State.CacheMatchedKey
? yarnFileHash ? yarnFileHash
: key === State.CachePrimaryKey : key === State.CachePrimaryKey
? npmFileHash ? npmFileHash
@@ -204,8 +217,8 @@ describe('run', () => {
await run(); await run();
expect(getInputSpy).toHaveBeenCalled(); expect(getInputSpy).not.toHaveBeenCalled();
expect(getStateSpy).toHaveBeenCalledTimes(3); expect(getStateSpy).toHaveBeenCalledTimes(4);
expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
expect(debugSpy).toHaveBeenCalledTimes(0); expect(debugSpy).toHaveBeenCalledTimes(0);
expect(infoSpy).not.toHaveBeenCalledWith( expect(infoSpy).not.toHaveBeenCalledWith(
@@ -221,7 +234,9 @@ describe('run', () => {
it('saves cache from yarn 2', async () => { it('saves cache from yarn 2', async () => {
inputs['cache'] = 'yarn'; inputs['cache'] = 'yarn';
getStateSpy.mockImplementation((key: string) => getStateSpy.mockImplementation((key: string) =>
key === State.CacheMatchedKey key === State.CachePackageManager
? inputs['cache']
: key === State.CacheMatchedKey
? yarnFileHash ? yarnFileHash
: key === State.CachePrimaryKey : key === State.CachePrimaryKey
? npmFileHash ? npmFileHash
@@ -232,8 +247,8 @@ describe('run', () => {
await run(); await run();
expect(getInputSpy).toHaveBeenCalled(); expect(getInputSpy).not.toHaveBeenCalled();
expect(getStateSpy).toHaveBeenCalledTimes(3); expect(getStateSpy).toHaveBeenCalledTimes(4);
expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
expect(debugSpy).toHaveBeenCalledTimes(0); expect(debugSpy).toHaveBeenCalledTimes(0);
expect(infoSpy).not.toHaveBeenCalledWith( expect(infoSpy).not.toHaveBeenCalledWith(
@@ -249,7 +264,9 @@ describe('run', () => {
it('saves cache from npm', async () => { it('saves cache from npm', async () => {
inputs['cache'] = 'npm'; inputs['cache'] = 'npm';
getStateSpy.mockImplementation((key: string) => getStateSpy.mockImplementation((key: string) =>
key === State.CacheMatchedKey key === State.CachePackageManager
? inputs['cache']
: key === State.CacheMatchedKey
? npmFileHash ? npmFileHash
: key === State.CachePrimaryKey : key === State.CachePrimaryKey
? yarnFileHash ? yarnFileHash
@@ -260,8 +277,8 @@ describe('run', () => {
await run(); await run();
expect(getInputSpy).toHaveBeenCalled(); expect(getInputSpy).not.toHaveBeenCalled();
expect(getStateSpy).toHaveBeenCalledTimes(3); expect(getStateSpy).toHaveBeenCalledTimes(4);
expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
expect(debugSpy).toHaveBeenCalledTimes(0); expect(debugSpy).toHaveBeenCalledTimes(0);
expect(infoSpy).not.toHaveBeenCalledWith( expect(infoSpy).not.toHaveBeenCalledWith(
@@ -277,7 +294,9 @@ describe('run', () => {
it('saves cache from pnpm', async () => { it('saves cache from pnpm', async () => {
inputs['cache'] = 'pnpm'; inputs['cache'] = 'pnpm';
getStateSpy.mockImplementation((key: string) => getStateSpy.mockImplementation((key: string) =>
key === State.CacheMatchedKey key === State.CachePackageManager
? inputs['cache']
: key === State.CacheMatchedKey
? pnpmFileHash ? pnpmFileHash
: key === State.CachePrimaryKey : key === State.CachePrimaryKey
? npmFileHash ? npmFileHash
@@ -288,8 +307,8 @@ describe('run', () => {
await run(); await run();
expect(getInputSpy).toHaveBeenCalled(); expect(getInputSpy).not.toHaveBeenCalled();
expect(getStateSpy).toHaveBeenCalledTimes(3); expect(getStateSpy).toHaveBeenCalledTimes(4);
expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
expect(debugSpy).toHaveBeenCalledTimes(0); expect(debugSpy).toHaveBeenCalledTimes(0);
expect(infoSpy).not.toHaveBeenCalledWith( expect(infoSpy).not.toHaveBeenCalledWith(
@@ -305,7 +324,9 @@ describe('run', () => {
it('save with -1 cacheId , should not fail workflow', async () => { it('save with -1 cacheId , should not fail workflow', async () => {
inputs['cache'] = 'npm'; inputs['cache'] = 'npm';
getStateSpy.mockImplementation((key: string) => getStateSpy.mockImplementation((key: string) =>
key === State.CacheMatchedKey key === State.CachePackageManager
? inputs['cache']
: key === State.CacheMatchedKey
? npmFileHash ? npmFileHash
: key === State.CachePrimaryKey : key === State.CachePrimaryKey
? yarnFileHash ? yarnFileHash
@@ -319,8 +340,8 @@ describe('run', () => {
await run(); await run();
expect(getInputSpy).toHaveBeenCalled(); expect(getInputSpy).not.toHaveBeenCalled();
expect(getStateSpy).toHaveBeenCalledTimes(3); expect(getStateSpy).toHaveBeenCalledTimes(4);
expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
expect(debugSpy).toHaveBeenCalledTimes(0); expect(debugSpy).toHaveBeenCalledTimes(0);
expect(infoSpy).not.toHaveBeenCalledWith( expect(infoSpy).not.toHaveBeenCalledWith(
@@ -336,7 +357,9 @@ describe('run', () => {
it('saves with error from toolkit, should fail workflow', async () => { it('saves with error from toolkit, should fail workflow', async () => {
inputs['cache'] = 'npm'; inputs['cache'] = 'npm';
getStateSpy.mockImplementation((key: string) => getStateSpy.mockImplementation((key: string) =>
key === State.CacheMatchedKey key === State.CachePackageManager
? inputs['cache']
: key === State.CacheMatchedKey
? npmFileHash ? npmFileHash
: key === State.CachePrimaryKey : key === State.CachePrimaryKey
? yarnFileHash ? yarnFileHash
@@ -350,8 +373,8 @@ describe('run', () => {
await run(); await run();
expect(getInputSpy).toHaveBeenCalled(); expect(getInputSpy).not.toHaveBeenCalled();
expect(getStateSpy).toHaveBeenCalledTimes(3); expect(getStateSpy).toHaveBeenCalledTimes(4);
expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
expect(debugSpy).toHaveBeenCalledTimes(0); expect(debugSpy).toHaveBeenCalledTimes(0);
expect(infoSpy).not.toHaveBeenCalledWith( expect(infoSpy).not.toHaveBeenCalledWith(

View File

@@ -60332,91 +60332,86 @@ exports.debug = debug; // for test
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
})); }));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true }));
return (mod && mod.__esModule) ? mod : { "default": mod }; exports.run = void 0;
}; const core = __importStar(__nccwpck_require__(2186));
Object.defineProperty(exports, "__esModule", ({ value: true })); const cache = __importStar(__nccwpck_require__(7799));
exports.run = void 0; const constants_1 = __nccwpck_require__(9042);
const core = __importStar(__nccwpck_require__(2186)); const cache_utils_1 = __nccwpck_require__(1678);
const cache = __importStar(__nccwpck_require__(7799)); // Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
const fs_1 = __importDefault(__nccwpck_require__(7147)); // @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
const constants_1 = __nccwpck_require__(9042); // throw an uncaught exception. Instead of failing this action, just warn.
const cache_utils_1 = __nccwpck_require__(1678); process.on('uncaughtException', e => {
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in const warningPrefix = '[warning]';
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to core.info(`${warningPrefix}${e.message}`);
// throw an uncaught exception. Instead of failing this action, just warn. });
process.on('uncaughtException', e => { function run() {
const warningPrefix = '[warning]'; return __awaiter(this, void 0, void 0, function* () {
core.info(`${warningPrefix}${e.message}`); try {
}); const cacheLock = core.getState(constants_1.State.CachePackageManager);
function run() { yield cachePackages(cacheLock);
return __awaiter(this, void 0, void 0, function* () { }
try { catch (error) {
const cacheLock = core.getInput('cache'); core.setFailed(error.message);
yield cachePackages(cacheLock); }
} });
catch (error) { }
core.setFailed(error.message); exports.run = run;
} const cachePackages = (packageManager) => __awaiter(void 0, void 0, void 0, function* () {
}); const state = core.getState(constants_1.State.CacheMatchedKey);
} const primaryKey = core.getState(constants_1.State.CachePrimaryKey);
exports.run = run; const cachePaths = JSON.parse(core.getState(constants_1.State.CachePaths) || '[]');
const cachePackages = (packageManager) => __awaiter(void 0, void 0, void 0, function* () { const packageManagerInfo = yield cache_utils_1.getPackageManagerInfo(packageManager);
const state = core.getState(constants_1.State.CacheMatchedKey); if (!packageManagerInfo) {
const primaryKey = core.getState(constants_1.State.CachePrimaryKey); core.debug(`Caching for '${packageManager}' is not supported`);
let cachePaths = JSON.parse(core.getState(constants_1.State.CachePaths) || '[]'); return;
cachePaths = cachePaths.filter(fs_1.default.existsSync); }
const packageManagerInfo = yield cache_utils_1.getPackageManagerInfo(packageManager); if (!cachePaths.length) {
if (!packageManagerInfo) { // TODO: core.getInput has a bug - it can return undefined despite its definition (tests only?)
core.debug(`Caching for '${packageManager}' is not supported`); // export declare function getInput(name: string, options?: InputOptions): string;
return; const cacheDependencyPath = core.getInput('cache-dependency-path') || '';
} throw new Error(`Cache folder paths are not retrieved for ${packageManager} with cache-dependency-path = ${cacheDependencyPath}`);
if (!cachePaths.length) { }
// TODO: core.getInput has a bug - it can return undefined despite its definition (tests only?) if (primaryKey === state) {
// export declare function getInput(name: string, options?: InputOptions): string; core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`);
const cacheDependencyPath = core.getInput('cache-dependency-path') || ''; return;
throw new Error(`Cache folder paths are not retrieved for ${packageManager} with cache-dependency-path = ${cacheDependencyPath}`); }
} const cacheId = yield cache.saveCache(cachePaths, primaryKey);
if (primaryKey === state) { if (cacheId == -1) {
core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`); return;
return; }
} core.info(`Cache saved with the key: ${primaryKey}`);
const cacheId = yield cache.saveCache(cachePaths, primaryKey); });
if (cacheId == -1) { run();
return;
}
core.info(`Cache saved with the key: ${primaryKey}`);
});
run();
/***/ }), /***/ }),
@@ -60425,254 +60420,254 @@ run();
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
})); }));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
var __importDefault = (this && this.__importDefault) || function (mod) { var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isCacheFeatureAvailable = exports.isGhes = exports.repoHasYarnBerryManagedDependencies = exports.getCacheDirectories = exports.resetProjectDirectoriesMemoized = exports.getPackageManagerInfo = exports.getCommandOutputNotEmpty = exports.getCommandOutput = exports.supportedPackageManagers = void 0; exports.isCacheFeatureAvailable = exports.isGhes = exports.repoHasYarnBerryManagedDependencies = exports.getCacheDirectories = exports.resetProjectDirectoriesMemoized = exports.getPackageManagerInfo = exports.getCommandOutputNotEmpty = exports.getCommandOutput = exports.supportedPackageManagers = void 0;
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const exec = __importStar(__nccwpck_require__(1514)); const exec = __importStar(__nccwpck_require__(1514));
const cache = __importStar(__nccwpck_require__(7799)); const cache = __importStar(__nccwpck_require__(7799));
const glob = __importStar(__nccwpck_require__(8090)); const glob = __importStar(__nccwpck_require__(8090));
const path_1 = __importDefault(__nccwpck_require__(1017)); const path_1 = __importDefault(__nccwpck_require__(1017));
const fs_1 = __importDefault(__nccwpck_require__(7147)); const fs_1 = __importDefault(__nccwpck_require__(7147));
const util_1 = __nccwpck_require__(2629); const util_1 = __nccwpck_require__(2629);
exports.supportedPackageManagers = { exports.supportedPackageManagers = {
npm: { npm: {
name: 'npm', name: 'npm',
lockFilePatterns: ['package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock'], lockFilePatterns: ['package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock'],
getCacheFolderPath: () => exports.getCommandOutputNotEmpty('npm config get cache', 'Could not get npm cache folder path') getCacheFolderPath: () => exports.getCommandOutputNotEmpty('npm config get cache', 'Could not get npm cache folder path')
}, },
pnpm: { pnpm: {
name: 'pnpm', name: 'pnpm',
lockFilePatterns: ['pnpm-lock.yaml'], lockFilePatterns: ['pnpm-lock.yaml'],
getCacheFolderPath: () => exports.getCommandOutputNotEmpty('pnpm store path --silent', 'Could not get pnpm cache folder path') getCacheFolderPath: () => exports.getCommandOutputNotEmpty('pnpm store path --silent', 'Could not get pnpm cache folder path')
}, },
yarn: { yarn: {
name: 'yarn', name: 'yarn',
lockFilePatterns: ['yarn.lock'], lockFilePatterns: ['yarn.lock'],
getCacheFolderPath: (projectDir) => __awaiter(void 0, void 0, void 0, function* () { getCacheFolderPath: (projectDir) => __awaiter(void 0, void 0, void 0, function* () {
const yarnVersion = yield exports.getCommandOutputNotEmpty(`yarn --version`, 'Could not retrieve version of yarn', projectDir); const yarnVersion = yield exports.getCommandOutputNotEmpty(`yarn --version`, 'Could not retrieve version of yarn', projectDir);
core.debug(`Consumed yarn version is ${yarnVersion} (working dir: "${projectDir || ''}")`); core.debug(`Consumed yarn version is ${yarnVersion} (working dir: "${projectDir || ''}")`);
const stdOut = yarnVersion.startsWith('1.') const stdOut = yarnVersion.startsWith('1.')
? yield exports.getCommandOutput('yarn cache dir', projectDir) ? yield exports.getCommandOutput('yarn cache dir', projectDir)
: yield exports.getCommandOutput('yarn config get cacheFolder', projectDir); : yield exports.getCommandOutput('yarn config get cacheFolder', projectDir);
if (!stdOut) { if (!stdOut) {
throw new Error(`Could not get yarn cache folder path for ${projectDir}`); throw new Error(`Could not get yarn cache folder path for ${projectDir}`);
} }
return stdOut; return stdOut;
}) })
} }
}; };
const getCommandOutput = (toolCommand, cwd) => __awaiter(void 0, void 0, void 0, function* () { const getCommandOutput = (toolCommand, cwd) => __awaiter(void 0, void 0, void 0, function* () {
let { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand, undefined, Object.assign({ ignoreReturnCode: true }, (cwd && { cwd }))); let { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand, undefined, Object.assign({ ignoreReturnCode: true }, (cwd && { cwd })));
if (exitCode) { if (exitCode) {
stderr = !stderr.trim() stderr = !stderr.trim()
? `The '${toolCommand}' command failed with exit code: ${exitCode}` ? `The '${toolCommand}' command failed with exit code: ${exitCode}`
: stderr; : stderr;
throw new Error(stderr); throw new Error(stderr);
} }
return stdout.trim(); return stdout.trim();
}); });
exports.getCommandOutput = getCommandOutput; exports.getCommandOutput = getCommandOutput;
const getCommandOutputNotEmpty = (toolCommand, error, cwd) => __awaiter(void 0, void 0, void 0, function* () { const getCommandOutputNotEmpty = (toolCommand, error, cwd) => __awaiter(void 0, void 0, void 0, function* () {
const stdOut = exports.getCommandOutput(toolCommand, cwd); const stdOut = exports.getCommandOutput(toolCommand, cwd);
if (!stdOut) { if (!stdOut) {
throw new Error(error); throw new Error(error);
} }
return stdOut; return stdOut;
}); });
exports.getCommandOutputNotEmpty = getCommandOutputNotEmpty; exports.getCommandOutputNotEmpty = getCommandOutputNotEmpty;
const getPackageManagerInfo = (packageManager) => __awaiter(void 0, void 0, void 0, function* () { const getPackageManagerInfo = (packageManager) => __awaiter(void 0, void 0, void 0, function* () {
if (packageManager === 'npm') { if (packageManager === 'npm') {
return exports.supportedPackageManagers.npm; return exports.supportedPackageManagers.npm;
} }
else if (packageManager === 'pnpm') { else if (packageManager === 'pnpm') {
return exports.supportedPackageManagers.pnpm; return exports.supportedPackageManagers.pnpm;
} }
else if (packageManager === 'yarn') { else if (packageManager === 'yarn') {
return exports.supportedPackageManagers.yarn; return exports.supportedPackageManagers.yarn;
} }
else { else {
return null; return null;
} }
}); });
exports.getPackageManagerInfo = getPackageManagerInfo; exports.getPackageManagerInfo = getPackageManagerInfo;
/** /**
* getProjectDirectoriesFromCacheDependencyPath is called twice during `restoreCache` * getProjectDirectoriesFromCacheDependencyPath is called twice during `restoreCache`
* - first through `getCacheDirectories` * - first through `getCacheDirectories`
* - second from `repoHasYarn3ManagedCache` * - second from `repoHasYarn3ManagedCache`
* *
* it contains expensive IO operation and thus should be memoized * it contains expensive IO operation and thus should be memoized
*/ */
let projectDirectoriesMemoized = null; let projectDirectoriesMemoized = null;
/** /**
* unit test must reset memoized variables * unit test must reset memoized variables
*/ */
const resetProjectDirectoriesMemoized = () => (projectDirectoriesMemoized = null); const resetProjectDirectoriesMemoized = () => (projectDirectoriesMemoized = null);
exports.resetProjectDirectoriesMemoized = resetProjectDirectoriesMemoized; exports.resetProjectDirectoriesMemoized = resetProjectDirectoriesMemoized;
/** /**
* Expands (converts) the string input `cache-dependency-path` to list of directories that * Expands (converts) the string input `cache-dependency-path` to list of directories that
* may be project roots * may be project roots
* @param cacheDependencyPath - either a single string or multiline string with possible glob patterns * @param cacheDependencyPath - either a single string or multiline string with possible glob patterns
* expected to be the result of `core.getInput('cache-dependency-path')` * expected to be the result of `core.getInput('cache-dependency-path')`
* @return list of directories and possible * @return list of directories and possible
*/ */
const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () { const getProjectDirectoriesFromCacheDependencyPath = (cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
if (projectDirectoriesMemoized !== null) { if (projectDirectoriesMemoized !== null) {
return projectDirectoriesMemoized; return projectDirectoriesMemoized;
} }
const globber = yield glob.create(cacheDependencyPath); const globber = yield glob.create(cacheDependencyPath);
const cacheDependenciesPaths = yield globber.glob(); const cacheDependenciesPaths = yield globber.glob();
const existingDirectories = cacheDependenciesPaths const existingDirectories = cacheDependenciesPaths
.map(path_1.default.dirname) .map(path_1.default.dirname)
.filter(util_1.unique()) .filter(util_1.unique())
.map(dirName => fs_1.default.realpathSync(dirName)) .map(dirName => fs_1.default.realpathSync(dirName))
.filter(directory => fs_1.default.lstatSync(directory).isDirectory()); .filter(directory => fs_1.default.lstatSync(directory).isDirectory());
if (!existingDirectories.length) if (!existingDirectories.length)
core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`); core.warning(`No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`);
projectDirectoriesMemoized = existingDirectories; projectDirectoriesMemoized = existingDirectories;
return existingDirectories; return existingDirectories;
}); });
/** /**
* Finds the cache directories configured for the repo if cache-dependency-path is not empty * Finds the cache directories configured for the repo if cache-dependency-path is not empty
* @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM * @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM
* @param cacheDependencyPath - either a single string or multiline string with possible glob patterns * @param cacheDependencyPath - either a single string or multiline string with possible glob patterns
* expected to be the result of `core.getInput('cache-dependency-path')` * expected to be the result of `core.getInput('cache-dependency-path')`
* @return list of files on which the cache depends * @return list of files on which the cache depends
*/ */
const getCacheDirectoriesFromCacheDependencyPath = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () { const getCacheDirectoriesFromCacheDependencyPath = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
const projectDirectories = yield getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath); const projectDirectories = yield getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath);
const cacheFoldersPaths = yield Promise.all(projectDirectories.map((projectDirectory) => __awaiter(void 0, void 0, void 0, function* () { const cacheFoldersPaths = yield Promise.all(projectDirectories.map((projectDirectory) => __awaiter(void 0, void 0, void 0, function* () {
const cacheFolderPath = yield packageManagerInfo.getCacheFolderPath(projectDirectory); const cacheFolderPath = yield packageManagerInfo.getCacheFolderPath(projectDirectory);
core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the directory "${projectDirectory}"`); core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the directory "${projectDirectory}"`);
return cacheFolderPath; return cacheFolderPath;
}))); })));
// uniq in order to do not cache the same directories twice // uniq in order to do not cache the same directories twice
return cacheFoldersPaths.filter(util_1.unique()); return cacheFoldersPaths.filter(util_1.unique());
}); });
/** /**
* Finds the cache directories configured for the repo ignoring cache-dependency-path * Finds the cache directories configured for the repo ignoring cache-dependency-path
* @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM * @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM
* @return list of files on which the cache depends * @return list of files on which the cache depends
*/ */
const getCacheDirectoriesForRootProject = (packageManagerInfo) => __awaiter(void 0, void 0, void 0, function* () { const getCacheDirectoriesForRootProject = (packageManagerInfo) => __awaiter(void 0, void 0, void 0, function* () {
const cacheFolderPath = yield packageManagerInfo.getCacheFolderPath(); const cacheFolderPath = yield packageManagerInfo.getCacheFolderPath();
core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the root directory`); core.debug(`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the root directory`);
return [cacheFolderPath]; return [cacheFolderPath];
}); });
/** /**
* A function to find the cache directories configured for the repo * A function to find the cache directories configured for the repo
* currently it handles only the case of PM=yarn && cacheDependencyPath is not empty * currently it handles only the case of PM=yarn && cacheDependencyPath is not empty
* @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM * @param packageManagerInfo - an object having getCacheFolderPath method specific to given PM
* @param cacheDependencyPath - either a single string or multiline string with possible glob patterns * @param cacheDependencyPath - either a single string or multiline string with possible glob patterns
* expected to be the result of `core.getInput('cache-dependency-path')` * expected to be the result of `core.getInput('cache-dependency-path')`
* @return list of files on which the cache depends * @return list of files on which the cache depends
*/ */
const getCacheDirectories = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () { const getCacheDirectories = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
// For yarn, if cacheDependencyPath is set, ask information about cache folders in each project // For yarn, if cacheDependencyPath is set, ask information about cache folders in each project
// folder satisfied by cacheDependencyPath https://github.com/actions/setup-node/issues/488 // folder satisfied by cacheDependencyPath https://github.com/actions/setup-node/issues/488
if (packageManagerInfo.name === 'yarn' && cacheDependencyPath) { if (packageManagerInfo.name === 'yarn' && cacheDependencyPath) {
return getCacheDirectoriesFromCacheDependencyPath(packageManagerInfo, cacheDependencyPath); return getCacheDirectoriesFromCacheDependencyPath(packageManagerInfo, cacheDependencyPath);
} }
return getCacheDirectoriesForRootProject(packageManagerInfo); return getCacheDirectoriesForRootProject(packageManagerInfo);
}); });
exports.getCacheDirectories = getCacheDirectories; exports.getCacheDirectories = getCacheDirectories;
/** /**
* A function to check if the directory is a yarn project configured to manage * A function to check if the directory is a yarn project configured to manage
* obsolete dependencies in the local cache * obsolete dependencies in the local cache
* @param directory - a path to the folder * @param directory - a path to the folder
* @return - true if the directory's project is yarn managed * @return - true if the directory's project is yarn managed
* - if there's .yarn/cache folder do not mess with the dependencies kept in the repo, return false * - if there's .yarn/cache folder do not mess with the dependencies kept in the repo, return false
* - global cache is not managed by yarn @see https://yarnpkg.com/features/offline-cache, return false * - global cache is not managed by yarn @see https://yarnpkg.com/features/offline-cache, return false
* - if local cache is not explicitly enabled (not yarn3), return false * - if local cache is not explicitly enabled (not yarn3), return false
* - return true otherwise * - return true otherwise
*/ */
const projectHasYarnBerryManagedDependencies = (directory) => __awaiter(void 0, void 0, void 0, function* () { const projectHasYarnBerryManagedDependencies = (directory) => __awaiter(void 0, void 0, void 0, function* () {
const workDir = directory || process.env.GITHUB_WORKSPACE || '.'; const workDir = directory || process.env.GITHUB_WORKSPACE || '.';
core.debug(`check if "${workDir}" has locally managed yarn3 dependencies`); core.debug(`check if "${workDir}" has locally managed yarn3 dependencies`);
// if .yarn/cache directory exists the cache is managed by version control system // if .yarn/cache directory exists the cache is managed by version control system
const yarnCacheFile = path_1.default.join(workDir, '.yarn', 'cache'); const yarnCacheFile = path_1.default.join(workDir, '.yarn', 'cache');
if (fs_1.default.existsSync(yarnCacheFile) && if (fs_1.default.existsSync(yarnCacheFile) &&
fs_1.default.lstatSync(yarnCacheFile).isDirectory()) { fs_1.default.lstatSync(yarnCacheFile).isDirectory()) {
core.debug(`"${workDir}" has .yarn/cache - dependencies are kept in the repository`); core.debug(`"${workDir}" has .yarn/cache - dependencies are kept in the repository`);
return Promise.resolve(false); return Promise.resolve(false);
} }
// NOTE: yarn1 returns 'undefined' with return code = 0 // NOTE: yarn1 returns 'undefined' with return code = 0
const enableGlobalCache = yield exports.getCommandOutput('yarn config get enableGlobalCache', workDir); const enableGlobalCache = yield exports.getCommandOutput('yarn config get enableGlobalCache', workDir);
// only local cache is not managed by yarn // only local cache is not managed by yarn
const managed = enableGlobalCache.includes('false'); const managed = enableGlobalCache.includes('false');
if (managed) { if (managed) {
core.debug(`"${workDir}" dependencies are managed by yarn 3 locally`); core.debug(`"${workDir}" dependencies are managed by yarn 3 locally`);
return true; return true;
} }
else { else {
core.debug(`"${workDir}" dependencies are not managed by yarn 3 locally`); core.debug(`"${workDir}" dependencies are not managed by yarn 3 locally`);
return false; return false;
} }
}); });
/** /**
* A function to report the repo contains Yarn managed projects * A function to report the repo contains Yarn managed projects
* @param packageManagerInfo - used to make sure current package manager is yarn * @param packageManagerInfo - used to make sure current package manager is yarn
* @param cacheDependencyPath - either a single string or multiline string with possible glob patterns * @param cacheDependencyPath - either a single string or multiline string with possible glob patterns
* expected to be the result of `core.getInput('cache-dependency-path')` * expected to be the result of `core.getInput('cache-dependency-path')`
* @return - true if all project directories configured to be Yarn managed * @return - true if all project directories configured to be Yarn managed
*/ */
const repoHasYarnBerryManagedDependencies = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () { const repoHasYarnBerryManagedDependencies = (packageManagerInfo, cacheDependencyPath) => __awaiter(void 0, void 0, void 0, function* () {
if (packageManagerInfo.name !== 'yarn') if (packageManagerInfo.name !== 'yarn')
return false; return false;
const yarnDirs = cacheDependencyPath const yarnDirs = cacheDependencyPath
? yield getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath) ? yield getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath)
: ['']; : [''];
const isManagedList = yield Promise.all(yarnDirs.map(projectHasYarnBerryManagedDependencies)); const isManagedList = yield Promise.all(yarnDirs.map(projectHasYarnBerryManagedDependencies));
return isManagedList.every(Boolean); return isManagedList.every(Boolean);
}); });
exports.repoHasYarnBerryManagedDependencies = repoHasYarnBerryManagedDependencies; exports.repoHasYarnBerryManagedDependencies = repoHasYarnBerryManagedDependencies;
function isGhes() { function isGhes() {
const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com'); const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM'; return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
} }
exports.isGhes = isGhes; exports.isGhes = isGhes;
function isCacheFeatureAvailable() { function isCacheFeatureAvailable() {
if (cache.isFeatureAvailable()) if (cache.isFeatureAvailable())
return true; return true;
if (isGhes()) { if (isGhes()) {
core.warning('Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.'); core.warning('Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.');
return false; return false;
} }
core.warning('The runner was not able to contact the cache service. Caching will be skipped'); core.warning('The runner was not able to contact the cache service. Caching will be skipped');
return false; return false;
} }
exports.isCacheFeatureAvailable = isCacheFeatureAvailable; exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/***/ }), /***/ }),
@@ -60681,25 +60676,26 @@ exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/***/ ((__unused_webpack_module, exports) => { /***/ ((__unused_webpack_module, exports) => {
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.Outputs = exports.State = exports.LockType = void 0; exports.Outputs = exports.State = exports.LockType = void 0;
var LockType; var LockType;
(function (LockType) { (function (LockType) {
LockType["Npm"] = "npm"; LockType["Npm"] = "npm";
LockType["Pnpm"] = "pnpm"; LockType["Pnpm"] = "pnpm";
LockType["Yarn"] = "yarn"; LockType["Yarn"] = "yarn";
})(LockType = exports.LockType || (exports.LockType = {})); })(LockType = exports.LockType || (exports.LockType = {}));
var State; var State;
(function (State) { (function (State) {
State["CachePrimaryKey"] = "CACHE_KEY"; State["CachePackageManager"] = "SETUP_NODE_CACHE_PACKAGE_MANAGER";
State["CacheMatchedKey"] = "CACHE_RESULT"; State["CachePrimaryKey"] = "CACHE_KEY";
State["CachePaths"] = "CACHE_PATHS"; State["CacheMatchedKey"] = "CACHE_RESULT";
})(State = exports.State || (exports.State = {})); State["CachePaths"] = "CACHE_PATHS";
var Outputs; })(State = exports.State || (exports.State = {}));
(function (Outputs) { var Outputs;
Outputs["CacheHit"] = "cache-hit"; (function (Outputs) {
})(Outputs = exports.Outputs || (exports.Outputs = {})); Outputs["CacheHit"] = "cache-hit";
})(Outputs = exports.Outputs || (exports.Outputs = {}));
/***/ }), /***/ }),
@@ -60708,108 +60704,108 @@ var Outputs;
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
})); }));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) { return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next()); step((generator = generator.apply(thisArg, _arguments || [])).next());
}); });
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.unique = exports.printEnvDetailsAndSetOutput = exports.parseNodeVersionFile = void 0; exports.unique = exports.printEnvDetailsAndSetOutput = exports.parseNodeVersionFile = void 0;
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const exec = __importStar(__nccwpck_require__(1514)); const exec = __importStar(__nccwpck_require__(1514));
function parseNodeVersionFile(contents) { function parseNodeVersionFile(contents) {
var _a, _b, _c; var _a, _b, _c;
let nodeVersion; let nodeVersion;
// Try parsing the file as an NPM `package.json` file. // Try parsing the file as an NPM `package.json` file.
try { try {
nodeVersion = (_a = JSON.parse(contents).volta) === null || _a === void 0 ? void 0 : _a.node; nodeVersion = (_a = JSON.parse(contents).volta) === null || _a === void 0 ? void 0 : _a.node;
if (!nodeVersion) if (!nodeVersion)
nodeVersion = (_b = JSON.parse(contents).engines) === null || _b === void 0 ? void 0 : _b.node; nodeVersion = (_b = JSON.parse(contents).engines) === null || _b === void 0 ? void 0 : _b.node;
} }
catch (_d) { catch (_d) {
core.info('Node version file is not JSON file'); core.info('Node version file is not JSON file');
} }
if (!nodeVersion) { if (!nodeVersion) {
const found = contents.match(/^(?:node(js)?\s+)?v?(?<version>[^\s]+)$/m); const found = contents.match(/^(?:node(js)?\s+)?v?(?<version>[^\s]+)$/m);
nodeVersion = (_c = found === null || found === void 0 ? void 0 : found.groups) === null || _c === void 0 ? void 0 : _c.version; nodeVersion = (_c = found === null || found === void 0 ? void 0 : found.groups) === null || _c === void 0 ? void 0 : _c.version;
} }
// In the case of an unknown format, // In the case of an unknown format,
// return as is and evaluate the version separately. // return as is and evaluate the version separately.
if (!nodeVersion) if (!nodeVersion)
nodeVersion = contents.trim(); nodeVersion = contents.trim();
return nodeVersion; return nodeVersion;
} }
exports.parseNodeVersionFile = parseNodeVersionFile; exports.parseNodeVersionFile = parseNodeVersionFile;
function printEnvDetailsAndSetOutput() { function printEnvDetailsAndSetOutput() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
core.startGroup('Environment details'); core.startGroup('Environment details');
const promises = ['node', 'npm', 'yarn'].map((tool) => __awaiter(this, void 0, void 0, function* () { const promises = ['node', 'npm', 'yarn'].map((tool) => __awaiter(this, void 0, void 0, function* () {
const output = yield getToolVersion(tool, ['--version']); const output = yield getToolVersion(tool, ['--version']);
return { tool, output }; return { tool, output };
})); }));
const tools = yield Promise.all(promises); const tools = yield Promise.all(promises);
tools.forEach(({ tool, output }) => { tools.forEach(({ tool, output }) => {
if (tool === 'node') { if (tool === 'node') {
core.setOutput(`${tool}-version`, output); core.setOutput(`${tool}-version`, output);
} }
core.info(`${tool}: ${output}`); core.info(`${tool}: ${output}`);
}); });
core.endGroup(); core.endGroup();
}); });
} }
exports.printEnvDetailsAndSetOutput = printEnvDetailsAndSetOutput; exports.printEnvDetailsAndSetOutput = printEnvDetailsAndSetOutput;
function getToolVersion(tool, options) { function getToolVersion(tool, options) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
try { try {
const { stdout, stderr, exitCode } = yield exec.getExecOutput(tool, options, { const { stdout, stderr, exitCode } = yield exec.getExecOutput(tool, options, {
ignoreReturnCode: true, ignoreReturnCode: true,
silent: true silent: true
}); });
if (exitCode > 0) { if (exitCode > 0) {
core.info(`[warning]${stderr}`); core.info(`[warning]${stderr}`);
return ''; return '';
} }
return stdout.trim(); return stdout.trim();
} }
catch (err) { catch (err) {
return ''; return '';
} }
}); });
} }
const unique = () => { const unique = () => {
const encountered = new Set(); const encountered = new Set();
return (value) => { return (value) => {
if (encountered.has(value)) if (encountered.has(value))
return false; return false;
encountered.add(value); encountered.add(value);
return true; return true;
}; };
}; };
exports.unique = unique; exports.unique = unique;
/***/ }), /***/ }),

2617
dist/setup/index.js vendored

File diff suppressed because it is too large Load Diff

84
package-lock.json generated
View File

@@ -1755,9 +1755,9 @@
} }
}, },
"node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": {
"version": "7.3.8", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -1881,9 +1881,9 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": {
"version": "7.3.8", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -1928,9 +1928,9 @@
"dev": true "dev": true
}, },
"node_modules/@typescript-eslint/utils/node_modules/semver": { "node_modules/@typescript-eslint/utils/node_modules/semver": {
"version": "7.3.8", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -2480,9 +2480,9 @@
} }
}, },
"node_modules/cross-spawn/node_modules/semver": { "node_modules/cross-spawn/node_modules/semver": {
"version": "5.7.0", "version": "5.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
"bin": { "bin": {
"semver": "bin/semver" "semver": "bin/semver"
} }
@@ -4683,9 +4683,9 @@
} }
}, },
"node_modules/jest-snapshot/node_modules/semver": { "node_modules/jest-snapshot/node_modules/semver": {
"version": "7.3.5", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -6052,9 +6052,9 @@
} }
}, },
"node_modules/ts-jest/node_modules/semver": { "node_modules/ts-jest/node_modules/semver": {
"version": "7.3.5", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -6307,9 +6307,9 @@
} }
}, },
"node_modules/word-wrap": { "node_modules/word-wrap": {
"version": "1.2.3", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz",
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=0.10.0" "node": ">=0.10.0"
@@ -7883,9 +7883,9 @@
}, },
"dependencies": { "dependencies": {
"semver": { "semver": {
"version": "7.3.8", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true, "dev": true,
"requires": { "requires": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -7949,9 +7949,9 @@
}, },
"dependencies": { "dependencies": {
"semver": { "semver": {
"version": "7.3.8", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true, "dev": true,
"requires": { "requires": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -7982,9 +7982,9 @@
"dev": true "dev": true
}, },
"semver": { "semver": {
"version": "7.3.8", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true, "dev": true,
"requires": { "requires": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -8405,9 +8405,9 @@
}, },
"dependencies": { "dependencies": {
"semver": { "semver": {
"version": "5.7.0", "version": "5.7.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g=="
} }
} }
}, },
@@ -10067,9 +10067,9 @@
}, },
"dependencies": { "dependencies": {
"semver": { "semver": {
"version": "7.3.5", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true, "dev": true,
"requires": { "requires": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -11044,9 +11044,9 @@
}, },
"dependencies": { "dependencies": {
"semver": { "semver": {
"version": "7.3.5", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true, "dev": true,
"requires": { "requires": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
@@ -11242,9 +11242,9 @@
} }
}, },
"word-wrap": { "word-wrap": {
"version": "1.2.3", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz",
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==",
"dev": true "dev": true
}, },
"wrap-ansi": { "wrap-ansi": {

View File

@@ -1,8 +1,6 @@
import * as core from '@actions/core'; import * as core from '@actions/core';
import * as cache from '@actions/cache'; import * as cache from '@actions/cache';
import fs from 'fs';
import {State} from './constants'; import {State} from './constants';
import {getPackageManagerInfo} from './cache-utils'; import {getPackageManagerInfo} from './cache-utils';
@@ -16,7 +14,7 @@ process.on('uncaughtException', e => {
export async function run() { export async function run() {
try { try {
const cacheLock = core.getInput('cache'); const cacheLock = core.getState(State.CachePackageManager);
await cachePackages(cacheLock); await cachePackages(cacheLock);
} catch (error) { } catch (error) {
core.setFailed(error.message); core.setFailed(error.message);
@@ -26,10 +24,9 @@ export async function run() {
const cachePackages = async (packageManager: string) => { const cachePackages = async (packageManager: string) => {
const state = core.getState(State.CacheMatchedKey); const state = core.getState(State.CacheMatchedKey);
const primaryKey = core.getState(State.CachePrimaryKey); const primaryKey = core.getState(State.CachePrimaryKey);
let cachePaths = JSON.parse( const cachePaths = JSON.parse(
core.getState(State.CachePaths) || '[]' core.getState(State.CachePaths) || '[]'
) as string[]; ) as string[];
cachePaths = cachePaths.filter(fs.existsSync);
const packageManagerInfo = await getPackageManagerInfo(packageManager); const packageManagerInfo = await getPackageManagerInfo(packageManager);
if (!packageManagerInfo) { if (!packageManagerInfo) {

View File

@@ -5,6 +5,7 @@ export enum LockType {
} }
export enum State { export enum State {
CachePackageManager = 'SETUP_NODE_CACHE_PACKAGE_MANAGER',
CachePrimaryKey = 'CACHE_KEY', CachePrimaryKey = 'CACHE_KEY',
CacheMatchedKey = 'CACHE_RESULT', CacheMatchedKey = 'CACHE_RESULT',
CachePaths = 'CACHE_PATHS' CachePaths = 'CACHE_PATHS'

View File

@@ -9,6 +9,7 @@ import {restoreCache} from './cache-restore';
import {isCacheFeatureAvailable} from './cache-utils'; import {isCacheFeatureAvailable} from './cache-utils';
import {getNodejsDistribution} from './distributions/installer-factory'; import {getNodejsDistribution} from './distributions/installer-factory';
import {parseNodeVersionFile, printEnvDetailsAndSetOutput} from './util'; import {parseNodeVersionFile, printEnvDetailsAndSetOutput} from './util';
import {State} from './constants';
export async function run() { export async function run() {
try { try {
@@ -60,6 +61,7 @@ export async function run() {
} }
if (cache && isCacheFeatureAvailable()) { if (cache && isCacheFeatureAvailable()) {
core.saveState(State.CachePackageManager, cache);
const cacheDependencyPath = core.getInput('cache-dependency-path'); const cacheDependencyPath = core.getInput('cache-dependency-path');
await restoreCache(cache, cacheDependencyPath); await restoreCache(cache, cacheDependencyPath);
} }