mirror of
https://github.com/actions/setup-node.git
synced 2025-04-22 09:21:00 +00:00
Randomize folder for concurrent builds
This commit is contained in:
parent
1bb67f3744
commit
3af5b19a98
1 changed files with 25 additions and 2 deletions
|
@ -3,8 +3,26 @@ import fs = require('fs');
|
||||||
import os = require('os');
|
import os = require('os');
|
||||||
import path = require('path');
|
import path = require('path');
|
||||||
|
|
||||||
const toolDir = path.join(process.cwd(), 'runner', 'tools');
|
const toolDir = path.join(
|
||||||
const tempDir = path.join(process.cwd(), 'runner', 'temp');
|
process.cwd(),
|
||||||
|
'runner',
|
||||||
|
path.join(
|
||||||
|
Math.random()
|
||||||
|
.toString(36)
|
||||||
|
.substring(7)
|
||||||
|
),
|
||||||
|
'tools'
|
||||||
|
);
|
||||||
|
const tempDir = path.join(
|
||||||
|
process.cwd(),
|
||||||
|
'runner',
|
||||||
|
path.join(
|
||||||
|
Math.random()
|
||||||
|
.toString(36)
|
||||||
|
.substring(7)
|
||||||
|
),
|
||||||
|
'temp'
|
||||||
|
);
|
||||||
|
|
||||||
process.env['RUNNER_TOOLSDIRECTORY'] = toolDir;
|
process.env['RUNNER_TOOLSDIRECTORY'] = toolDir;
|
||||||
process.env['RUNNER_TEMPDIRECTORY'] = tempDir;
|
process.env['RUNNER_TEMPDIRECTORY'] = tempDir;
|
||||||
|
@ -18,6 +36,11 @@ describe('installer tests', () => {
|
||||||
await io.rmRF(tempDir);
|
await io.rmRF(tempDir);
|
||||||
}, 100000);
|
}, 100000);
|
||||||
|
|
||||||
|
afterAll(async () => {
|
||||||
|
await io.rmRF(toolDir);
|
||||||
|
await io.rmRF(tempDir);
|
||||||
|
}, 100000);
|
||||||
|
|
||||||
it('Acquires version of node if no matching version is installed', async () => {
|
it('Acquires version of node if no matching version is installed', async () => {
|
||||||
await installer.getNode('10.16.0');
|
await installer.getNode('10.16.0');
|
||||||
const nodeDir = path.join(toolDir, 'node', '10.16.0', os.arch());
|
const nodeDir = path.join(toolDir, 'node', '10.16.0', os.arch());
|
||||||
|
|
Loading…
Add table
Reference in a new issue