Skip to content

Commit d123f10

Browse files
authored
follow proxy settings (#105)
1 parent 9a99bb3 commit d123f10

File tree

568 files changed

+15974
-93742
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

568 files changed

+15974
-93742
lines changed

.github/workflows/workflow.yml

+71-15
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,81 @@
11
name: Main workflow
2-
on: [push]
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- releases/*
9+
310
jobs:
4-
run:
5-
name: Run
11+
build:
612
runs-on: ${{ matrix.operating-system }}
713
strategy:
814
matrix:
915
operating-system: [ubuntu-latest, windows-latest]
1016
steps:
11-
- uses: actions/checkout@master
12-
13-
- name: Set Node.js 10.x
14-
uses: actions/setup-node@master
15-
with:
16-
version: 10.x
17+
- uses: actions/checkout@v2
18+
- name: Setup node 12
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 12.x
22+
- run: npm ci
23+
- run: npm run build
24+
- run: npm run format-check
25+
- run: npm run pack
26+
- run: npm test
27+
- name: Verify no unstaged changes
28+
if: runner.os != 'windows'
29+
run: __tests__/verify-no-unstaged-changes.sh
1730

18-
- name: npm install
19-
run: npm install
31+
test:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v2
35+
- name: Clear tool cache
36+
run: rm -rf $RUNNER_TOOL_CACHE/*
37+
- name: Setup node 10
38+
uses: ./
39+
with:
40+
node-version: 10.x
41+
- name: Verify node and npm
42+
run: __tests__/verify-node.sh 10
2043

21-
- name: Lint
22-
run: npm run format-check
44+
test-proxy:
45+
runs-on: ubuntu-latest
46+
container:
47+
image: ubuntu:latest
48+
options: --dns 127.0.0.1
49+
services:
50+
squid-proxy:
51+
image: datadog/squid:latest
52+
ports:
53+
- 3128:3128
54+
env:
55+
https_proxy: http://squid-proxy:3128
56+
steps:
57+
- uses: actions/checkout@v2
58+
- name: Clear tool cache
59+
run: rm -rf $RUNNER_TOOL_CACHE/*
60+
- name: Setup node 10
61+
uses: ./
62+
with:
63+
node-version: 10.x
64+
- name: Verify node and npm
65+
run: __tests__/verify-node.sh 10
2366

24-
- name: npm test
25-
run: npm test
67+
test-bypass-proxy:
68+
runs-on: ubuntu-latest
69+
env:
70+
https_proxy: http://no-such-proxy:3128
71+
no_proxy: github.com,nodejs.org,registry.npmjs.org
72+
steps:
73+
- uses: actions/checkout@v2
74+
- name: Clear tool cache
75+
run: rm -rf $RUNNER_TOOL_CACHE/*
76+
- name: Setup node 10
77+
uses: ./
78+
with:
79+
node-version: 10.x
80+
- name: Verify node and npm
81+
run: __tests__/verify-node.sh 10

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Explicitly not ignoring node_modules so that they are included in package downloaded by runner
2-
!node_modules/
1+
node_modules/
2+
lib/
33
__tests__/runner/*
44

55
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
if [[ "$(git status --porcelain)" != "" ]]; then
4+
echo ----------------------------------------
5+
echo git status
6+
echo ----------------------------------------
7+
git status
8+
echo ----------------------------------------
9+
echo git diff
10+
echo ----------------------------------------
11+
git diff
12+
echo ----------------------------------------
13+
echo Troubleshooting
14+
echo ----------------------------------------
15+
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && npm ci && npm run all"
16+
exit 1
17+
fi

__tests__/verify-node.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
3+
if [ -z "$1" ]; then
4+
echo "Must supply node version argument"
5+
exit 1
6+
fi
7+
8+
node_version="$(node --version)"
9+
echo "Found node version '$node_version'"
10+
if [ -z "$(echo $node_version | grep v$1)" ]; then
11+
echo "Unexpected version"
12+
exit 1
13+
fi
14+
15+
echo "Testing npm install"
16+
mkdir -p test-npm-install
17+
cd test-npm-install
18+
npm init -y || exit 1
19+
npm install @actions/core || exit 1

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ inputs:
1818
deprecationMessage: 'The version property will not be supported after October 1, 2019. Use node-version instead'
1919
runs:
2020
using: 'node12'
21-
main: 'lib/setup-node.js'
21+
main: 'dist/index.js'

0 commit comments

Comments
 (0)