mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2024-12-25 12:05:48 +00:00
docs: add package.json information
This commit is contained in:
parent
bb59d50268
commit
d79e93a91d
1 changed files with 16 additions and 3 deletions
|
@ -48,7 +48,7 @@ steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '14'
|
node-version: '16'
|
||||||
check-latest: true
|
check-latest: true
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm test
|
- run: npm test
|
||||||
|
@ -56,8 +56,8 @@ steps:
|
||||||
|
|
||||||
## Node version file
|
## Node version file
|
||||||
|
|
||||||
The `node-version-file` input accepts a path to a file containing the version of Node.js to be used by a project, for example `.nvmrc`, `.node-version` or `.tool-versions`. If both the `node-version` and the `node-version-file` inputs are provided then the `node-version` input is used.
|
The `node-version-file` input accepts a path to a file containing the version of Node.js to be used by a project, for example `.nvmrc`, `.node-version`, `.tool-versions`, or `package.json`. If both the `node-version` and the `node-version-file` inputs are provided then the `node-version` input is used.
|
||||||
See [supported version syntax](https://github.com/actions/setup-node#supported-version-syntax)
|
See [supported version syntax](https://github.com/actions/setup-node#supported-version-syntax).
|
||||||
|
|
||||||
> The action will search for the node version file relative to the repository root.
|
> The action will search for the node version file relative to the repository root.
|
||||||
|
|
||||||
|
@ -71,6 +71,19 @@ steps:
|
||||||
- run: npm test
|
- run: npm test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
When using the `package.json` input, the action will look for `volta.node` first. If `volta.node` isn't defined, then it will look for `engines.node`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.0.0"
|
||||||
|
},
|
||||||
|
"volta": {
|
||||||
|
"node": "16.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
You can use any of the [supported operating systems](https://docs.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners), and the compatible `architecture` can be selected using `architecture`. Values are `x86`, `x64`, `arm64`, `armv6l`, `armv7l`, `ppc64le`, `s390x` (not all of the architectures are available on all platforms).
|
You can use any of the [supported operating systems](https://docs.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners), and the compatible `architecture` can be selected using `architecture`. Values are `x86`, `x64`, `arm64`, `armv6l`, `armv7l`, `ppc64le`, `s390x` (not all of the architectures are available on all platforms).
|
||||||
|
|
Loading…
Reference in a new issue