Skip to content

Commit 4d0182a

Browse files
Merge pull request #310 from actions/revert-308-v-alsvir/disable-cache-usage-temp-v2
Revert "Temporarily disabled cache usage for v2"
2 parents d6e3b55 + 896ee80 commit 4d0182a

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

__tests__/installer.test.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ describe('setup-node', () => {
171171
// Found in cache tests
172172
//--------------------------------------------------
173173

174-
// Usage of pre-cached Node.js versions is temporarily disabled.
175-
xit('finds version in cache with stable true', async () => {
174+
it('finds version in cache with stable true', async () => {
176175
inputs['node-version'] = '12';
177176
inputs.stable = 'true';
178177

@@ -183,8 +182,7 @@ describe('setup-node', () => {
183182
expect(logSpy).toHaveBeenCalledWith(`Found in cache @ ${toolPath}`);
184183
});
185184

186-
// Usage of pre-cached Node.js versions is temporarily disabled.
187-
xit('finds version in cache with stable not supplied', async () => {
185+
it('finds version in cache with stable not supplied', async () => {
188186
inputs['node-version'] = '12';
189187

190188
inSpy.mockImplementation(name => inputs[name]);
@@ -196,8 +194,7 @@ describe('setup-node', () => {
196194
expect(logSpy).toHaveBeenCalledWith(`Found in cache @ ${toolPath}`);
197195
});
198196

199-
// Usage of pre-cached Node.js versions is temporarily disabled.
200-
xit('finds version in cache and adds it to the path', async () => {
197+
it('finds version in cache and adds it to the path', async () => {
201198
inputs['node-version'] = '12';
202199

203200
inSpy.mockImplementation(name => inputs[name]);
@@ -387,8 +384,7 @@ describe('setup-node', () => {
387384
}, 100000);
388385

389386
describe('check-latest flag', () => {
390-
// Usage of pre-cached Node.js versions is temporarily disabled.
391-
xit('use local version and dont check manifest if check-latest is not specified', async () => {
387+
it('use local version and dont check manifest if check-latest is not specified', async () => {
392388
os.platform = 'linux';
393389
os.arch = 'x64';
394390

@@ -409,8 +405,7 @@ describe('setup-node', () => {
409405
);
410406
});
411407

412-
// Usage of pre-cached Node.js versions is temporarily disabled.
413-
xit('check latest version and resolve it from local cache', async () => {
408+
it('check latest version and resolve it from local cache', async () => {
414409
os.platform = 'linux';
415410
os.arch = 'x64';
416411

@@ -561,8 +556,7 @@ describe('setup-node', () => {
561556
inputs.stable = 'true';
562557
});
563558

564-
// Usage of pre-cached Node.js versions is temporarily disabled.
565-
xit('find latest LTS version and resolve it from local cache (lts/erbium)', async () => {
559+
it('find latest LTS version and resolve it from local cache (lts/erbium)', async () => {
566560
// arrange
567561
inputs['node-version'] = 'lts/erbium';
568562

@@ -632,8 +626,7 @@ describe('setup-node', () => {
632626
);
633627
});
634628

635-
// Usage of pre-cached Node.js versions is temporarily disabled.
636-
xit('find latest LTS version and resolve it from local cache (lts/*)', async () => {
629+
it('find latest LTS version and resolve it from local cache (lts/*)', async () => {
637630
// arrange
638631
inputs['node-version'] = 'lts/*';
639632

dist/setup/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65086,8 +65086,9 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
6508665086
let toolPath;
6508765087
toolPath = tc.find('node', versionSpec, osArch);
6508865088
// If not found in cache, download
65089-
// Usage of pre-cached Node.js versions is temporarily disabled.
65090-
if (false) {}
65089+
if (toolPath) {
65090+
core.info(`Found in cache @ ${toolPath}`);
65091+
}
6509165092
else {
6509265093
core.info(`Attempting to download ${versionSpec}...`);
6509365094
let downloadPath = '';

src/installer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ export async function getNode(
7171
toolPath = tc.find('node', versionSpec, osArch);
7272

7373
// If not found in cache, download
74-
// Usage of pre-cached Node.js versions is temporarily disabled.
75-
if (false) {
74+
if (toolPath) {
7675
core.info(`Found in cache @ ${toolPath}`);
7776
} else {
7877
core.info(`Attempting to download ${versionSpec}...`);

0 commit comments

Comments
 (0)