From 64609a2cc70bf5ea4bacff1e3c011d53ce2291c5 Mon Sep 17 00:00:00 2001
From: eric sciple <ericsciple@users.noreply.github.com>
Date: Fri, 24 Jan 2020 11:12:20 -0500
Subject: [PATCH] follow proxy settings

---
 .github/workflows/workflow.yml   | 56 ++++++++++++++++++++++++--------
 __tests__/verify-node-version.sh | 15 +++++++++
 2 files changed, 57 insertions(+), 14 deletions(-)
 create mode 100755 __tests__/verify-node-version.sh

diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml
index 024c7f1d..ed647d96 100644
--- a/.github/workflows/workflow.yml
+++ b/.github/workflows/workflow.yml
@@ -1,25 +1,53 @@
 name: Main workflow
 on: [push]
 jobs:
-  run:
-    name: Run
+  build:
+    name: Build
     runs-on: ${{ matrix.operating-system }}
     strategy:
       matrix:
         operating-system: [ubuntu-latest, windows-latest]
     steps:
-    - uses: actions/checkout@master
-    
-    - name: Set Node.js 10.x
-      uses: actions/setup-node@master
-      with:
-        version: 10.x
+      - uses: actions/checkout@v2
+      
+      - name: Setup node 12
+        uses: actions/setup-node@v1
+        with:
+          version: 12.x
 
-    - name: npm install
-      run: npm install
+      - name: npm install
+        run: npm install
 
-    - name: Lint
-      run: npm run format-check
+      - name: Lint
+        run: npm run format-check
 
-    - name: npm test
-      run: npm test
+      - name: npm test
+        run: npm test
+
+  test:
+    name: Test E2E
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Setup node 10
+        uses: ./
+        with:
+          version: 10.x
+
+      - name: Verify node version
+        run: __tests__/verify-node-version.sh 10
+
+  test-proxy:
+    name: Test E2E with proxy
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@users/ericsciple/m165proxy
+
+      - name: Setup node 10
+        uses: ./
+        with:
+          version: 10.x
+
+      - name: Verify node version
+        run: __tests__/verify-node-version.sh 10
diff --git a/__tests__/verify-node-version.sh b/__tests__/verify-node-version.sh
new file mode 100755
index 00000000..15a5ae12
--- /dev/null
+++ b/__tests__/verify-node-version.sh
@@ -0,0 +1,15 @@
+#!/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 [[ $node_version =~ "v$1" ]]; then
+  echo "Success. Version matches 'v$1'"
+else
+  echo "Unexpected version"
+  exit 1
+fi
\ No newline at end of file