mirror of
https://github.com/actions/setup-node
synced 2025-04-09 18:35:51 +00:00
.
This commit is contained in:
parent
90d3f7502b
commit
3d683016c5
7 changed files with 37 additions and 25 deletions
11
.github/workflows/workflow.yml
vendored
11
.github/workflows/workflow.yml
vendored
|
@ -9,7 +9,6 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ${{ matrix.operating-system }}
|
||||
strategy:
|
||||
matrix:
|
||||
|
@ -36,7 +35,6 @@ jobs:
|
|||
run: __test__/verify-no-unstaged-changes.sh
|
||||
|
||||
test:
|
||||
name: Test E2E
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -46,11 +44,10 @@ jobs:
|
|||
with:
|
||||
node-version: 10.x
|
||||
|
||||
- name: Verify node version
|
||||
run: __tests__/verify-node-version.sh 10
|
||||
- name: Verify node and npm
|
||||
run: __tests__/verify-node.sh 10 5
|
||||
|
||||
test-proxy:
|
||||
name: Test E2E with proxy
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ubuntu:latest
|
||||
|
@ -70,5 +67,5 @@ jobs:
|
|||
with:
|
||||
node-version: 10.x
|
||||
|
||||
- name: Verify node version
|
||||
run: __tests__/verify-node-version.sh 10
|
||||
- name: Verify node and npm
|
||||
run: __tests__/verify-node.sh 10 5
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
node_modules/
|
||||
lib/
|
||||
__tests__/runner/*
|
||||
|
||||
# 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'
|
||||
runs:
|
||||
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');
|
||||
}
|
||||
if (version) {
|
||||
// TODO: installer doesn't support proxy
|
||||
yield installer.getNode(version);
|
||||
}
|
||||
const registryUrl = core.getInput('registry-url');
|
||||
|
@ -15103,7 +15102,6 @@ function run() {
|
|||
if (registryUrl) {
|
||||
auth.configAuthentication(registryUrl, alwaysAuth);
|
||||
}
|
||||
// TODO: setup proxy from runner proxy config
|
||||
const matchersPath = path.join(__dirname, '..', '.github');
|
||||
console.log(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
|
||||
console.log(`##[add-matcher]${path.join(matchersPath, 'eslint-stylish.json')}`);
|
||||
|
|
|
@ -14,7 +14,6 @@ async function run() {
|
|||
version = core.getInput('node-version');
|
||||
}
|
||||
if (version) {
|
||||
// TODO: installer doesn't support proxy
|
||||
await installer.getNode(version);
|
||||
}
|
||||
|
||||
|
@ -24,7 +23,6 @@ async function run() {
|
|||
auth.configAuthentication(registryUrl, alwaysAuth);
|
||||
}
|
||||
|
||||
// TODO: setup proxy from runner proxy config
|
||||
const matchersPath = path.join(__dirname, '..', '.github');
|
||||
console.log(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
|
||||
console.log(
|
||||
|
|
Loading…
Add table
Reference in a new issue