3
0
Fork 0
mirror of https://gitea.com/actions/setup-node.git synced 2024-11-22 01:59:32 +01:00

Rename node-arch to architecture

This commit is contained in:
Amin Yahyaabadi 2020-12-08 16:15:38 -06:00
parent aabe026707
commit 5984462aaa
5 changed files with 12 additions and 12 deletions

View file

@ -91,21 +91,21 @@ jobs:
- 10
- 12
- 14
node_arch:
architecture:
- x64
# an extra windows-x86 run:
include:
- os: windows-2016
node_version: 12
node_arch: x86
name: Node ${{ matrix.node_version }} - ${{ matrix.node_arch }} on ${{ matrix.os }}
architecture: x86
name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
node-arch: ${{ matrix.node_arch }}
architecture: ${{ matrix.architecture }}
- run: npm install
- run: npm test
```

View file

@ -356,7 +356,7 @@ describe('setup-node', () => {
}[os.platform];
inputs['node-version'] = version;
inputs['node-arch'] = arch;
inputs['architecture'] = arch;
inputs['always-auth'] = false;
inputs['token'] = 'faketoken';

View file

@ -7,7 +7,7 @@ inputs:
default: 'false'
node-version:
description: 'Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0'
node-arch:
architecture:
description: 'Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default.'
check-latest:
description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec'

6
dist/index.js vendored
View file

@ -4706,11 +4706,11 @@ function run() {
if (!version) {
version = core.getInput('version');
}
let arch = core.getInput('node-arch');
// if node-arch supplied but node-version is not
let arch = core.getInput('architecture');
// 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('`node-arch` is provided but `node-version` is missing. This results in using an already installed x64 node which is not probably what you meant. To fix this, provide `node-arch` in combination with `node-version`');
core.warning('`architecture` is provided but `node-version` is missing. This results in using an already installed x64 node which is not probably what you meant. To fix this, provide `architecture` in combination with `node-version`');
}
if (!arch) {
arch = os.arch();

View file

@ -16,13 +16,13 @@ export async function run() {
version = core.getInput('version');
}
let arch = core.getInput('node-arch');
let arch = core.getInput('architecture');
// if node-arch supplied but node-version is not
// 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(
'`node-arch` is provided but `node-version` is missing. This results in using an already installed x64 node which is not probably what you meant. To fix this, provide `node-arch` in combination with `node-version`'
'`architecture` is provided but `node-version` is missing. This results in using an already installed x64 node which is not probably what you meant. To fix this, provide `architecture` in combination with `node-version`'
);
}