mirror of
https://github.com/actions/setup-node.git
synced 2025-04-16 00:13:29 +00:00

Some checks failed
e2e-cache / Test npm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, macos-13) (push) Waiting to run
e2e-cache / Test npm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, macos-latest) (push) Waiting to run
e2e-cache / Test npm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, windows-latest) (push) Waiting to run
e2e-cache / Test npm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, macos-13) (push) Waiting to run
e2e-cache / Test npm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, macos-latest) (push) Waiting to run
e2e-cache / Test npm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, windows-latest) (push) Waiting to run
e2e-cache / Test npm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (22, macos-13) (push) Waiting to run
e2e-cache / Test npm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (22, macos-latest) (push) Waiting to run
e2e-cache / Test npm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (22, windows-latest) (push) Waiting to run
e2e-cache / Test pnpm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, macos-13) (push) Waiting to run
e2e-cache / Test pnpm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, macos-latest) (push) Waiting to run
e2e-cache / Test pnpm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, windows-latest) (push) Waiting to run
e2e-cache / Test pnpm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, macos-13) (push) Waiting to run
e2e-cache / Test pnpm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, macos-latest) (push) Waiting to run
Basic validation / Basic validation (push) Failing after 0s
e2e-cache / Test pnpm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, windows-latest) (push) Waiting to run
e2e-cache / Test pnpm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (22, macos-13) (push) Waiting to run
e2e-cache / Test pnpm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (22, macos-latest) (push) Waiting to run
e2e-cache / Test pnpm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (22, windows-latest) (push) Waiting to run
e2e-cache / Test yarn 1 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, macos-13) (push) Waiting to run
e2e-cache / Test yarn 1 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, macos-latest) (push) Waiting to run
e2e-cache / Test yarn 1 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, windows-latest) (push) Waiting to run
e2e-cache / Test yarn 1 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, macos-13) (push) Waiting to run
e2e-cache / Test yarn 1 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, macos-latest) (push) Waiting to run
e2e-cache / Test yarn 1 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, windows-latest) (push) Waiting to run
e2e-cache / Test yarn 3 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, macos-13) (push) Waiting to run
e2e-cache / Test yarn 3 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, macos-latest) (push) Waiting to run
e2e-cache / Test yarn 3 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, windows-latest) (push) Waiting to run
e2e-cache / Test yarn 3 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, macos-13) (push) Waiting to run
e2e-cache / Test yarn 3 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, macos-latest) (push) Waiting to run
e2e-cache / Test yarn 3 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, windows-latest) (push) Waiting to run
e2e-cache / Test yarn 3 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (22, macos-13) (push) Waiting to run
e2e-cache / Test yarn 3 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (22, macos-latest) (push) Waiting to run
e2e-cache / Test yarn 3 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (22, windows-latest) (push) Waiting to run
versions / local-cache (18, macos-13) (push) Waiting to run
versions / local-cache (18, macos-latest) (push) Waiting to run
versions / local-cache (18, windows-latest) (push) Waiting to run
versions / local-cache (20, macos-13) (push) Waiting to run
versions / local-cache (20, macos-latest) (push) Waiting to run
versions / local-cache (20, windows-latest) (push) Waiting to run
versions / local-cache (22, macos-13) (push) Waiting to run
versions / local-cache (22, macos-latest) (push) Waiting to run
versions / local-cache (22, windows-latest) (push) Waiting to run
versions / lts-syntax (lts/*, macos-13) (push) Waiting to run
versions / lts-syntax (lts/*, windows-latest) (push) Waiting to run
versions / lts-syntax (lts/-1, macos-13) (push) Waiting to run
versions / lts-syntax (lts/-1, windows-latest) (push) Waiting to run
versions / lts-syntax (lts/dubnium, macos-13) (push) Waiting to run
versions / lts-syntax (lts/dubnium, windows-latest) (push) Waiting to run
versions / lts-syntax (lts/erbium, macos-13) (push) Waiting to run
versions / lts-syntax (lts/erbium, windows-latest) (push) Waiting to run
versions / lts-syntax (lts/fermium, macos-13) (push) Waiting to run
versions / lts-syntax (lts/fermium, windows-latest) (push) Waiting to run
versions / v8-canary-syntax (20-v8-canary, macos-13) (push) Waiting to run
versions / v8-canary-syntax (20-v8-canary, macos-latest) (push) Waiting to run
versions / v8-canary-syntax (20-v8-canary, windows-latest) (push) Waiting to run
versions / v8-canary-syntax (20.0.0-v8-canary, macos-13) (push) Waiting to run
versions / v8-canary-syntax (20.0.0-v8-canary, macos-latest) (push) Waiting to run
versions / v8-canary-syntax (20.0.0-v8-canary, windows-latest) (push) Waiting to run
versions / v8-canary-syntax (20.0.0-v8-canary20221101e50e45c9f8, macos-13) (push) Waiting to run
versions / v8-canary-syntax (20.0.0-v8-canary20221101e50e45c9f8, macos-latest) (push) Waiting to run
versions / v8-canary-syntax (20.0.0-v8-canary20221101e50e45c9f8, windows-latest) (push) Waiting to run
versions / nightly-syntax (18.0.0-nightly, macos-13) (push) Waiting to run
versions / nightly-syntax (18.0.0-nightly, macos-latest) (push) Waiting to run
versions / nightly-syntax (18.0.0-nightly, windows-latest) (push) Waiting to run
versions / nightly-syntax (20-nightly, macos-13) (push) Waiting to run
versions / nightly-syntax (20-nightly, macos-latest) (push) Waiting to run
versions / nightly-syntax (20-nightly, windows-latest) (push) Waiting to run
versions / nightly-syntax (21-nightly, macos-13) (push) Waiting to run
versions / nightly-syntax (21-nightly, macos-latest) (push) Waiting to run
versions / nightly-syntax (21-nightly, windows-latest) (push) Waiting to run
Check dist / Check dist/ (push) Failing after 0s
versions / rc-syntax (18.0.0-rc.2, macos-13) (push) Waiting to run
versions / rc-syntax (18.0.0-rc.2, macos-latest) (push) Waiting to run
versions / rc-syntax (18.0.0-rc.2, windows-latest) (push) Waiting to run
versions / rc-syntax (19.0.0-rc.0, macos-13) (push) Waiting to run
versions / rc-syntax (19.0.0-rc.0, macos-latest) (push) Waiting to run
versions / rc-syntax (19.0.0-rc.0, windows-latest) (push) Waiting to run
versions / rc-syntax (20.0.0-rc.1, macos-13) (push) Waiting to run
versions / rc-syntax (20.0.0-rc.1, macos-latest) (push) Waiting to run
versions / rc-syntax (20.0.0-rc.1, windows-latest) (push) Waiting to run
versions / manifest (18.20.0, macos-13) (push) Waiting to run
versions / manifest (18.20.0, macos-latest) (push) Waiting to run
versions / manifest (18.20.0, windows-latest) (push) Waiting to run
versions / manifest (20.10.0, macos-13) (push) Waiting to run
versions / manifest (20.10.0, macos-latest) (push) Waiting to run
versions / manifest (20.10.0, windows-latest) (push) Waiting to run
versions / manifest (22.0.0, macos-13) (push) Waiting to run
versions / manifest (22.0.0, macos-latest) (push) Waiting to run
versions / manifest (22.0.0, windows-latest) (push) Waiting to run
versions / check-latest (18, macos-13) (push) Waiting to run
versions / check-latest (18, macos-latest) (push) Waiting to run
CodeQL analysis / CodeQL analysis (push) Failing after 1s
versions / check-latest (18, windows-latest) (push) Waiting to run
versions / check-latest (20, macos-13) (push) Waiting to run
versions / check-latest (20, macos-latest) (push) Waiting to run
versions / check-latest (20, windows-latest) (push) Waiting to run
versions / check-latest (22, macos-13) (push) Waiting to run
versions / check-latest (22, macos-latest) (push) Waiting to run
versions / check-latest (22, windows-latest) (push) Waiting to run
versions / version-file (.nvmrc, macos-13) (push) Waiting to run
versions / version-file (.nvmrc, macos-latest) (push) Waiting to run
versions / version-file (.nvmrc, windows-latest) (push) Waiting to run
versions / version-file (.tool-versions, macos-13) (push) Waiting to run
versions / version-file (.tool-versions, macos-latest) (push) Waiting to run
versions / version-file (.tool-versions, windows-latest) (push) Waiting to run
versions / version-file (.tool-versions-node, macos-13) (push) Waiting to run
versions / version-file (.tool-versions-node, macos-latest) (push) Waiting to run
versions / version-file (.tool-versions-node, windows-latest) (push) Waiting to run
versions / version-file (package.json, macos-13) (push) Waiting to run
versions / version-file (package.json, macos-latest) (push) Waiting to run
versions / version-file (package.json, windows-latest) (push) Waiting to run
versions / version-file-volta (macos-13) (push) Waiting to run
versions / version-file-volta (macos-latest) (push) Waiting to run
versions / version-file-volta (windows-latest) (push) Waiting to run
versions / version-file-volta-extends (macos-13) (push) Waiting to run
versions / version-file-volta-extends (macos-latest) (push) Waiting to run
versions / version-file-volta-extends (windows-latest) (push) Waiting to run
versions / node-dist (17, macos-13) (push) Waiting to run
versions / node-dist (17, macos-latest) (push) Waiting to run
versions / node-dist (17, windows-latest) (push) Waiting to run
versions / node-dist (19, macos-13) (push) Waiting to run
versions / node-dist (19, macos-latest) (push) Waiting to run
versions / node-dist (19, windows-latest) (push) Waiting to run
versions / old-versions (macos-13) (push) Waiting to run
versions / old-versions (windows-latest) (push) Waiting to run
versions / arch (push) Waiting to run
versions / node-latest-aliases (current, macos-13) (push) Waiting to run
versions / node-latest-aliases (current, macos-latest) (push) Waiting to run
versions / node-latest-aliases (current, windows-latest) (push) Waiting to run
versions / node-latest-aliases (latest, macos-13) (push) Waiting to run
versions / node-latest-aliases (latest, macos-latest) (push) Waiting to run
versions / node-latest-aliases (latest, windows-latest) (push) Waiting to run
versions / node-latest-aliases (node, macos-13) (push) Waiting to run
versions / node-latest-aliases (node, macos-latest) (push) Waiting to run
versions / node-latest-aliases (node, windows-latest) (push) Waiting to run
Licensed / Licensed (push) Failing after 0s
e2e-cache / Test npm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, ubuntu-latest) (push) Successful in 11m29s
e2e-cache / Test npm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, ubuntu-latest) (push) Failing after 1m31s
e2e-cache / Test npm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (22, ubuntu-latest) (push) Failing after 6m37s
e2e-cache / Test pnpm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, ubuntu-latest) (push) Failing after 39s
e2e-cache / Test pnpm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, ubuntu-latest) (push) Failing after 25s
e2e-cache / Test pnpm (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (22, ubuntu-latest) (push) Failing after 37s
e2e-cache / Test yarn 1 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, ubuntu-latest) (push) Failing after 4s
e2e-cache / Test yarn 1 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, ubuntu-latest) (push) Failing after 4s
e2e-cache / Test yarn 3 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (18, ubuntu-latest) (push) Failing after 4s
e2e-cache / Test yarn 3 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (20, ubuntu-latest) (push) Failing after 4s
e2e-cache / Test yarn 3 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) (22, ubuntu-latest) (push) Failing after 4s
e2e-cache / Test yarn subprojects (18) (push) Failing after 4s
e2e-cache / Test yarn subprojects (20) (push) Failing after 4s
e2e-cache / Test yarn subprojects (22) (push) Failing after 4s
e2e-cache / Test yarn subprojects all locally managed (18) (push) Failing after 3s
e2e-cache / Test yarn subprojects all locally managed (20) (push) Failing after 4s
e2e-cache / Test yarn subprojects all locally managed (22) (push) Failing after 4s
e2e-cache / Test yarn subprojects some locally managed (18) (push) Failing after 4s
e2e-cache / Test yarn subprojects some locally managed (20) (push) Failing after 4s
e2e-cache / Test yarn subprojects some locally managed (22) (push) Failing after 4s
e2e-cache / Test yarn subprojects managed by git (18) (push) Failing after 5s
e2e-cache / Test yarn subprojects managed by git (20) (push) Failing after 5s
e2e-cache / Test yarn subprojects managed by git (22) (push) Failing after 4s
proxy / test-proxy (push) Failing after 26s
proxy / test-bypass-proxy (push) Successful in 28s
versions / local-cache (18, ubuntu-latest) (push) Successful in 37m30s
versions / local-cache (20, ubuntu-latest) (push) Failing after 1m32s
versions / local-cache (22, ubuntu-latest) (push) Failing after 6m44s
versions / lts-syntax (lts/*, ubuntu-latest) (push) Failing after 1m31s
versions / lts-syntax (lts/-1, ubuntu-latest) (push) Failing after 31s
versions / lts-syntax (lts/dubnium, ubuntu-latest) (push) Failing after 31s
versions / lts-syntax (lts/erbium, ubuntu-latest) (push) Failing after 31s
versions / lts-syntax (lts/fermium, ubuntu-latest) (push) Failing after 32s
versions / v8-canary-syntax (20-v8-canary, ubuntu-latest) (push) Failing after 31s
versions / v8-canary-syntax (20.0.0-v8-canary, ubuntu-latest) (push) Failing after 31s
versions / v8-canary-syntax (20.0.0-v8-canary20221101e50e45c9f8, ubuntu-latest) (push) Failing after 31s
versions / nightly-syntax (18.0.0-nightly, ubuntu-latest) (push) Failing after 31s
versions / nightly-syntax (20-nightly, ubuntu-latest) (push) Successful in 26s
versions / nightly-syntax (21-nightly, ubuntu-latest) (push) Successful in 18s
versions / rc-syntax (18.0.0-rc.2, ubuntu-latest) (push) Successful in 17s
versions / rc-syntax (19.0.0-rc.0, ubuntu-latest) (push) Successful in 17s
versions / rc-syntax (20.0.0-rc.1, ubuntu-latest) (push) Successful in 17s
versions / manifest (18.20.0, ubuntu-latest) (push) Successful in 3m42s
versions / manifest (20.10.0, ubuntu-latest) (push) Failing after 1m31s
versions / manifest (22.0.0, ubuntu-latest) (push) Failing after 32s
versions / check-latest (18, ubuntu-latest) (push) Failing after 31s
versions / check-latest (20, ubuntu-latest) (push) Failing after 31s
versions / check-latest (22, ubuntu-latest) (push) Failing after 32s
versions / version-file (.nvmrc, ubuntu-latest) (push) Failing after 31s
versions / version-file (.tool-versions, ubuntu-latest) (push) Failing after 32s
versions / version-file (.tool-versions-node, ubuntu-latest) (push) Failing after 31s
versions / version-file (package.json, ubuntu-latest) (push) Failing after 31s
versions / version-file-volta (ubuntu-latest) (push) Successful in 5m12s
versions / version-file-volta-extends (ubuntu-latest) (push) Failing after 31s
versions / node-dist (17, ubuntu-latest) (push) Failing after 32s
versions / node-dist (19, ubuntu-latest) (push) Failing after 1m31s
versions / old-versions (ubuntu-latest) (push) Failing after 31s
versions / node-latest-aliases (current, ubuntu-latest) (push) Failing after 32s
versions / node-latest-aliases (latest, ubuntu-latest) (push) Failing after 31s
versions / node-latest-aliases (node, ubuntu-latest) (push) Failing after 32s
* feat: support private mirrors * chore: change fallback message with mirrors
120 lines
3.6 KiB
TypeScript
120 lines
3.6 KiB
TypeScript
import * as core from '@actions/core';
|
|
|
|
import os from 'os';
|
|
|
|
import * as auth from './authutil';
|
|
import * as path from 'path';
|
|
import {restoreCache} from './cache-restore';
|
|
import {isCacheFeatureAvailable} from './cache-utils';
|
|
import {getNodejsDistribution} from './distributions/installer-factory';
|
|
import {getNodeVersionFromFile, printEnvDetailsAndSetOutput} from './util';
|
|
import {State} from './constants';
|
|
|
|
export async function run() {
|
|
try {
|
|
//
|
|
// Version is optional. If supplied, install / use from the tool cache
|
|
// If not supplied then task is still used to setup proxy, auth, etc...
|
|
//
|
|
const version = resolveVersionInput();
|
|
|
|
let arch = core.getInput('architecture');
|
|
const cache = core.getInput('cache');
|
|
|
|
// if architecture supplied but node-version is not
|
|
// if we don't throw a warning, the already installed x64 node will be used which is not probably what user meant.
|
|
if (arch && !version) {
|
|
core.warning(
|
|
'`architecture` is provided but `node-version` is missing. In this configuration, the version/architecture of Node will not be changed. To fix this, provide `architecture` in combination with `node-version`'
|
|
);
|
|
}
|
|
|
|
if (!arch) {
|
|
arch = os.arch();
|
|
}
|
|
|
|
if (version) {
|
|
const token = core.getInput('token');
|
|
const auth = !token ? undefined : `token ${token}`;
|
|
const mirror = core.getInput('mirror');
|
|
const mirrorToken = core.getInput('mirror-token');
|
|
const stable =
|
|
(core.getInput('stable') || 'true').toUpperCase() === 'TRUE';
|
|
const checkLatest =
|
|
(core.getInput('check-latest') || 'false').toUpperCase() === 'TRUE';
|
|
const nodejsInfo = {
|
|
versionSpec: version,
|
|
checkLatest,
|
|
auth,
|
|
stable,
|
|
arch,
|
|
mirror,
|
|
mirrorToken
|
|
};
|
|
const nodeDistribution = getNodejsDistribution(nodejsInfo);
|
|
await nodeDistribution.setupNodeJs();
|
|
}
|
|
|
|
await printEnvDetailsAndSetOutput();
|
|
|
|
const registryUrl: string = core.getInput('registry-url');
|
|
const alwaysAuth: string = core.getInput('always-auth');
|
|
if (registryUrl) {
|
|
auth.configAuthentication(registryUrl, alwaysAuth);
|
|
}
|
|
|
|
if (cache && isCacheFeatureAvailable()) {
|
|
core.saveState(State.CachePackageManager, cache);
|
|
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
|
await restoreCache(cache, cacheDependencyPath);
|
|
}
|
|
|
|
const matchersPath = path.join(__dirname, '../..', '.github');
|
|
core.info(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
|
|
core.info(
|
|
`##[add-matcher]${path.join(matchersPath, 'eslint-stylish.json')}`
|
|
);
|
|
core.info(
|
|
`##[add-matcher]${path.join(matchersPath, 'eslint-compact.json')}`
|
|
);
|
|
} catch (err) {
|
|
core.setFailed((err as Error).message);
|
|
}
|
|
}
|
|
|
|
function resolveVersionInput(): string {
|
|
let version = core.getInput('node-version');
|
|
const versionFileInput = core.getInput('node-version-file');
|
|
|
|
if (version && versionFileInput) {
|
|
core.warning(
|
|
'Both node-version and node-version-file inputs are specified, only node-version will be used'
|
|
);
|
|
}
|
|
|
|
if (version) {
|
|
return version;
|
|
}
|
|
|
|
if (versionFileInput) {
|
|
const versionFilePath = path.join(
|
|
process.env.GITHUB_WORKSPACE!,
|
|
versionFileInput
|
|
);
|
|
|
|
const parsedVersion = getNodeVersionFromFile(versionFilePath);
|
|
|
|
if (parsedVersion) {
|
|
version = parsedVersion;
|
|
} else {
|
|
core.warning(
|
|
`Could not determine node version from ${versionFilePath}. Falling back`
|
|
);
|
|
}
|
|
|
|
core.info(`Resolved ${versionFileInput} as ${version}`);
|
|
}
|
|
|
|
return version;
|
|
}
|