Skip to content

Commit f90c7b3

Browse files
authored
follow proxy settings (#144)
1 parent 090d9c9 commit f90c7b3

File tree

7 files changed

+1831
-795
lines changed

7 files changed

+1831
-795
lines changed

.github/workflows/test.yml

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14+
- uses: actions/setup-node@v1
15+
with:
16+
node-version: 12.x
1417
- uses: actions/checkout@v2
1518
- run: npm ci
1619
- run: npm run build
@@ -83,19 +86,95 @@ jobs:
8386
shell: bash
8487
run: __test__/verify-lfs.sh
8588

86-
test-job-container:
89+
# Basic checkout using REST API
90+
- name: Remove basic
91+
if: runner.os != 'windows'
92+
run: rm -rf basic
93+
- name: Remove basic (Windows)
94+
if: runner.os == 'windows'
95+
shell: cmd
96+
run: rmdir /s /q basic
97+
- name: Override git version
98+
if: runner.os != 'windows'
99+
run: __test__/override-git-version.sh
100+
- name: Override git version (Windows)
101+
if: runner.os == 'windows'
102+
run: __test__\\override-git-version.cmd
103+
- name: Basic checkout using REST API
104+
uses: ./
105+
with:
106+
ref: test-data/v2/basic
107+
path: basic
108+
- name: Verify basic
109+
run: __test__/verify-basic.sh --archive
110+
111+
test-proxy:
112+
runs-on: ubuntu-latest
113+
container:
114+
image: alpine/git:latest
115+
options: --dns 127.0.0.1
116+
services:
117+
squid-proxy:
118+
image: datadog/squid:latest
119+
ports:
120+
- 3128:3128
121+
env:
122+
https_proxy: http://squid-proxy:3128
123+
steps:
124+
# Clone this repo
125+
- name: Checkout
126+
uses: actions/checkout@users/ericsciple/m165proxy # todo: switch to v2
127+
128+
# Basic checkout using git
129+
- name: Basic checkout
130+
uses: ./
131+
with:
132+
ref: test-data/v2/basic
133+
path: basic
134+
- name: Verify basic
135+
run: __test__/verify-basic.sh
136+
137+
# Basic checkout using REST API
138+
- name: Remove basic
139+
run: rm -rf basic
140+
- name: Override git version
141+
run: __test__/override-git-version.sh
142+
- name: Basic checkout using REST API
143+
uses: ./
144+
with:
145+
ref: test-data/v2/basic
146+
path: basic
147+
- name: Verify basic
148+
run: __test__/verify-basic.sh --archive
149+
150+
test-bypass-proxy:
87151
runs-on: ubuntu-latest
88-
container: alpine:latest
152+
env:
153+
https_proxy: http://no-such-proxy:3128
154+
no_proxy: api.github.com,github.com
89155
steps:
90156
# Clone this repo
91157
- name: Checkout
92158
uses: actions/checkout@v2
93159

94-
# Basic checkout
160+
# Basic checkout using git
95161
- name: Basic checkout
96162
uses: ./
97163
with:
98164
ref: test-data/v2/basic
99165
path: basic
166+
- name: Verify basic
167+
run: __test__/verify-basic.sh
168+
- name: Remove basic
169+
run: rm -rf basic
170+
171+
# Basic checkout using REST API
172+
- name: Override git version
173+
run: __test__/override-git-version.sh
174+
- name: Basic checkout using REST API
175+
uses: ./
176+
with:
177+
ref: test-data/v2/basic
178+
path: basic
100179
- name: Verify basic
101180
run: __test__/verify-basic.sh --archive

__test__/override-git-version.cmd

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
mkdir override-git-version
3+
cd override-git-version
4+
echo @echo override git version 1.2.3 > git.cmd
5+
echo ::add-path::%CD%
6+
cd ..

__test__/override-git-version.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
mkdir override-git-version
4+
cd override-git-version
5+
echo "#!/bin/sh" > git
6+
echo "echo override git version 1.2.3" >> git
7+
chmod +x git
8+
echo "::add-path::$(pwd)"
9+
cd ..

0 commit comments

Comments
 (0)