Skip to content

Commit 3fca218

Browse files
committed
Default to nvmrc, various tests
1 parent d9e13ee commit 3fca218

9 files changed

Lines changed: 75 additions & 5 deletions

File tree

.github/workflows/canary.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Use latest v8-canary"
2+
on: [push,pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@master
8+
- uses: dcodeIO/setup-node-nvm@master
9+
with:
10+
node-version: node
11+
node-mirror: https://nodejs.org/download/v8-canary/
12+
- name: Check
13+
run: |
14+
which node
15+
node -v
16+
which npm
17+
npm -v

.github/workflows/lts.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: "Use latest LTS"
2+
on: [push,pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@master
8+
- uses: dcodeIO/setup-node-nvm@master
9+
with:
10+
node-version: lts/*
11+
- name: Check
12+
run: |
13+
which node
14+
node -v
15+
which npm
16+
npm -v

.github/workflows/nvmrc.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Use .nvmrc by default"
2+
on: [push,pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@master
8+
- uses: dcodeIO/setup-node-nvm@master
9+
- name: Check
10+
run: |
11+
which node
12+
node -v
13+
which npm
14+
npm -v
15+
if [ $(node -v) != "v12.9.0" ]; then
16+
exit 1;
17+
fi

.github/workflows/specific.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: "Use specific version"
2+
on: [push,pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@master
8+
- uses: dcodeIO/setup-node-nvm@master
9+
with:
10+
node-version: "10.0.0"
11+
- name: Check
12+
run: |
13+
which node
14+
node -v
15+
which npm
16+
npm -v
17+
if [ $(node -v) != "v10.0.0" ]; then
18+
exit 1;
19+
fi
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: "Use latest stable"
22
on: [push,pull_request]
33
jobs:
44
build:

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
12.9.0

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ This action sets up a specific node.js version on GitHub Actions using nvm, very
66

77
### node-version
88

9-
The node.js version to install and use, according to nvm.
9+
The node.js version to install and use, according to nvm. Uses the version specified in `.nvmrc` if omitted.
1010

1111
### node-mirror
1212

13-
The node.js mirror to use, e.g. `https://nodejs.org/download/v8-canary/` for canary.
13+
The node.js mirror to use, e.g. `https://nodejs.org/download/v8-canary/` for node on V8 lkgr.
1414

1515
## Example usage:
1616

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ author: dcodeIO
44
inputs:
55
node-version:
66
description: The node.js version to use according to nvm
7-
default: node
7+
default: ""
88
node-mirror:
99
description: The node.js mirror to use
1010
default: https://nodejs.org/dist/

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ chmod +x "$NVM_DIR/nvm.sh"
77
. "$NVM_DIR/nvm.sh" --no-use
88
nvm install $1
99
nvm use $1
10-
npm -g install npm
10+
npm -g install npm@latest
1111
echo "SETUP_NODE_NVM_NODE: $(which node)"
1212
echo "SETUP_NODE_NVM_NPM: $(which npm)"

0 commit comments

Comments
 (0)