mirror of
https://github.com/actions/setup-node
synced 2025-04-19 22:53:12 +00:00
.
This commit is contained in:
parent
90d3f7502b
commit
3d683016c5
11
.github/workflows/workflow.yml
vendored
11
.github/workflows/workflow.yml
vendored
@ -9,7 +9,6 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build
|
|
||||||
runs-on: ${{ matrix.operating-system }}
|
runs-on: ${{ matrix.operating-system }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -36,7 +35,6 @@ jobs:
|
|||||||
run: __test__/verify-no-unstaged-changes.sh
|
run: __test__/verify-no-unstaged-changes.sh
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: Test E2E
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -46,11 +44,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 10.x
|
node-version: 10.x
|
||||||
|
|
||||||
- name: Verify node version
|
- name: Verify node and npm
|
||||||
run: __tests__/verify-node-version.sh 10
|
run: __tests__/verify-node.sh 10 5
|
||||||
|
|
||||||
test-proxy:
|
test-proxy:
|
||||||
name: Test E2E with proxy
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: ubuntu:latest
|
image: ubuntu:latest
|
||||||
@ -70,5 +67,5 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: 10.x
|
node-version: 10.x
|
||||||
|
|
||||||
- name: Verify node version
|
- name: Verify node and npm
|
||||||
run: __tests__/verify-node-version.sh 10
|
run: __tests__/verify-node.sh 10 5
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
|
lib/
|
||||||
__tests__/runner/*
|
__tests__/runner/*
|
||||||
|
|
||||||
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
echo "Must supply version argument"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
node_version="$(node --version)"
|
|
||||||
echo "Found node version '$node_version'"
|
|
||||||
if [ -z "$(echo $node_version | grep v$1)" ]; then
|
|
||||||
echo "Unexpected version"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
31
__tests__/verify-node.sh
Executable file
31
__tests__/verify-node.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "Must supply node version argument"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$2" ]; then
|
||||||
|
echo "Must supply npm version argument"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
node_version="$(node --version)"
|
||||||
|
echo "Found node version '$node_version'"
|
||||||
|
if [ -z "$(echo $node_version | grep v$1)" ]; then
|
||||||
|
echo "Unexpected version"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
npm_version="$(npm --version)"
|
||||||
|
echo "Found npm version '$npm_version'"
|
||||||
|
if [ -z "$(echo $npm_version | grep v$2)" ]; then
|
||||||
|
echo "Unexpected version"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Testing npm install"
|
||||||
|
mkdir -p test-npm-install
|
||||||
|
cd test-npm-install
|
||||||
|
npm install @actions/core .
|
||||||
|
cd ..
|
@ -18,4 +18,4 @@ inputs:
|
|||||||
deprecationMessage: 'The version property will not be supported after October 1, 2019. Use node-version instead'
|
deprecationMessage: 'The version property will not be supported after October 1, 2019. Use node-version instead'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'lib/setup-node.js'
|
main: 'dist/index.js'
|
||||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -15095,7 +15095,6 @@ function run() {
|
|||||||
version = core.getInput('node-version');
|
version = core.getInput('node-version');
|
||||||
}
|
}
|
||||||
if (version) {
|
if (version) {
|
||||||
// TODO: installer doesn't support proxy
|
|
||||||
yield installer.getNode(version);
|
yield installer.getNode(version);
|
||||||
}
|
}
|
||||||
const registryUrl = core.getInput('registry-url');
|
const registryUrl = core.getInput('registry-url');
|
||||||
@ -15103,7 +15102,6 @@ function run() {
|
|||||||
if (registryUrl) {
|
if (registryUrl) {
|
||||||
auth.configAuthentication(registryUrl, alwaysAuth);
|
auth.configAuthentication(registryUrl, alwaysAuth);
|
||||||
}
|
}
|
||||||
// TODO: setup proxy from runner proxy config
|
|
||||||
const matchersPath = path.join(__dirname, '..', '.github');
|
const matchersPath = path.join(__dirname, '..', '.github');
|
||||||
console.log(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
|
console.log(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
|
||||||
console.log(`##[add-matcher]${path.join(matchersPath, 'eslint-stylish.json')}`);
|
console.log(`##[add-matcher]${path.join(matchersPath, 'eslint-stylish.json')}`);
|
||||||
|
@ -14,7 +14,6 @@ async function run() {
|
|||||||
version = core.getInput('node-version');
|
version = core.getInput('node-version');
|
||||||
}
|
}
|
||||||
if (version) {
|
if (version) {
|
||||||
// TODO: installer doesn't support proxy
|
|
||||||
await installer.getNode(version);
|
await installer.getNode(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,7 +23,6 @@ async function run() {
|
|||||||
auth.configAuthentication(registryUrl, alwaysAuth);
|
auth.configAuthentication(registryUrl, alwaysAuth);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: setup proxy from runner proxy config
|
|
||||||
const matchersPath = path.join(__dirname, '..', '.github');
|
const matchersPath = path.join(__dirname, '..', '.github');
|
||||||
console.log(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
|
console.log(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
|
||||||
console.log(
|
console.log(
|
||||||
|
Loading…
Reference in New Issue
Block a user