mirror of
https://github.com/actions/setup-node.git
synced 2024-11-12 09:38:04 +00:00
Compare commits
4 Commits
6a3807b324
...
41f81985b3
Author | SHA1 | Date | |
---|---|---|---|
|
41f81985b3 | ||
|
408bb570d1 | ||
|
2db60599dd | ||
|
9c006494f6 |
@ -9,7 +9,10 @@ import {restoreCache} from '../src/cache-restore';
|
|||||||
|
|
||||||
describe('cache-restore', () => {
|
describe('cache-restore', () => {
|
||||||
process.env['GITHUB_WORKSPACE'] = path.join(__dirname, 'data');
|
process.env['GITHUB_WORKSPACE'] = path.join(__dirname, 'data');
|
||||||
const platform = 'Linux';
|
if (!process.env.RUNNER_OS) {
|
||||||
|
process.env.RUNNER_OS = 'Linux';
|
||||||
|
}
|
||||||
|
const platform = process.env.RUNNER_OS;
|
||||||
const arch = 'arm64';
|
const arch = 'arm64';
|
||||||
const commonPath = '/some/random/path';
|
const commonPath = '/some/random/path';
|
||||||
const npmCachePath = `${commonPath}/npm`;
|
const npmCachePath = `${commonPath}/npm`;
|
||||||
@ -52,7 +55,6 @@ describe('cache-restore', () => {
|
|||||||
let restoreCacheSpy: jest.SpyInstance;
|
let restoreCacheSpy: jest.SpyInstance;
|
||||||
let hashFilesSpy: jest.SpyInstance;
|
let hashFilesSpy: jest.SpyInstance;
|
||||||
let archSpy: jest.SpyInstance;
|
let archSpy: jest.SpyInstance;
|
||||||
let platformSpy: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// core
|
// core
|
||||||
@ -107,9 +109,6 @@ describe('cache-restore', () => {
|
|||||||
// os
|
// os
|
||||||
archSpy = jest.spyOn(osm, 'arch');
|
archSpy = jest.spyOn(osm, 'arch');
|
||||||
archSpy.mockImplementation(() => arch);
|
archSpy.mockImplementation(() => arch);
|
||||||
|
|
||||||
platformSpy = jest.spyOn(osm, 'platform');
|
|
||||||
platformSpy.mockImplementation(() => platform);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Validate provided package manager', () => {
|
describe('Validate provided package manager', () => {
|
||||||
|
2
dist/setup/index.js
vendored
2
dist/setup/index.js
vendored
@ -93311,7 +93311,7 @@ const restoreCache = (packageManager, cacheDependencyPath) => __awaiter(void 0,
|
|||||||
if (!packageManagerInfo) {
|
if (!packageManagerInfo) {
|
||||||
throw new Error(`Caching for '${packageManager}' is not supported`);
|
throw new Error(`Caching for '${packageManager}' is not supported`);
|
||||||
}
|
}
|
||||||
const platform = os_1.default.platform();
|
const platform = process.env.RUNNER_OS;
|
||||||
const arch = os_1.default.arch();
|
const arch = os_1.default.arch();
|
||||||
const cachePaths = yield (0, cache_utils_1.getCacheDirectories)(packageManagerInfo, cacheDependencyPath);
|
const cachePaths = yield (0, cache_utils_1.getCacheDirectories)(packageManagerInfo, cacheDependencyPath);
|
||||||
core.saveState(constants_1.State.CachePaths, cachePaths);
|
core.saveState(constants_1.State.CachePaths, cachePaths);
|
||||||
|
@ -21,7 +21,7 @@ export const restoreCache = async (
|
|||||||
if (!packageManagerInfo) {
|
if (!packageManagerInfo) {
|
||||||
throw new Error(`Caching for '${packageManager}' is not supported`);
|
throw new Error(`Caching for '${packageManager}' is not supported`);
|
||||||
}
|
}
|
||||||
const platform = os.platform();
|
const platform = process.env.RUNNER_OS;
|
||||||
const arch = os.arch();
|
const arch = os.arch();
|
||||||
|
|
||||||
const cachePaths = await getCacheDirectories(
|
const cachePaths = await getCacheDirectories(
|
||||||
|
Loading…
Reference in New Issue
Block a user