From 3d683016c5ef69691dd4f1364e0bf5f19fb9efcc Mon Sep 17 00:00:00 2001 From: eric sciple Date: Fri, 24 Jan 2020 17:01:17 -0500 Subject: [PATCH] . --- .github/workflows/workflow.yml | 11 ++++------- .gitignore | 1 + __tests__/verify-node-version.sh | 13 ------------- __tests__/verify-node.sh | 31 +++++++++++++++++++++++++++++++ action.yml | 2 +- dist/index.js | 2 -- src/setup-node.ts | 2 -- 7 files changed, 37 insertions(+), 25 deletions(-) delete mode 100755 __tests__/verify-node-version.sh create mode 100755 __tests__/verify-node.sh diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index d13390ed..5dd7e93c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -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 diff --git a/.gitignore b/.gitignore index a36e7431..f5235b82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules/ +lib/ __tests__/runner/* # Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore diff --git a/__tests__/verify-node-version.sh b/__tests__/verify-node-version.sh deleted file mode 100755 index 03823666..00000000 --- a/__tests__/verify-node-version.sh +++ /dev/null @@ -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 \ No newline at end of file diff --git a/__tests__/verify-node.sh b/__tests__/verify-node.sh new file mode 100755 index 00000000..016abdb3 --- /dev/null +++ b/__tests__/verify-node.sh @@ -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 .. \ No newline at end of file diff --git a/action.yml b/action.yml index 77b6ca0b..03910a44 100644 --- a/action.yml +++ b/action.yml @@ -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' diff --git a/dist/index.js b/dist/index.js index c6117e21..dee34cfa 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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')}`); diff --git a/src/setup-node.ts b/src/setup-node.ts index 51deccbe..8f61c6fc 100644 --- a/src/setup-node.ts +++ b/src/setup-node.ts @@ -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(