Skip to content

Commit 55df1a6

Browse files
committed
Merge branch 'js/ci-sdk-download-fix'
Instead of downloading Windows SDK for CI jobs for windows builds from an external site (wingit.blob.core.windows.net), use the one created in the windows-build job, to work around quota issues at the external site. * js/ci-sdk-download-fix: ci: avoid pounding on the poor ci-artifacts container
2 parents abbd1d9 + 857341c commit 55df1a6

File tree

1 file changed

+44
-11
lines changed

1 file changed

+44
-11
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,19 @@ jobs:
4444
- uses: actions/checkout@v1
4545
- name: download git-sdk-64-minimal
4646
shell: bash
47-
run: a=git-sdk-64-minimal && mkdir -p $a && curl -# https://wingit.blob.core.windows.net/ci-artifacts/$a.tar.xz | tar -C $a -xJf -
47+
run: |
48+
## Get artifact
49+
urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
50+
id=$(curl "$urlbase?definitions=22&statusFilter=completed&resultFilter=succeeded&\$top=1" |
51+
jq -r ".value[] | .id")
52+
download_url="$(curl "$urlbase/$id/artifacts" |
53+
jq -r '.value[] | select(.name == "git-sdk-64-minimal").resource.downloadUrl')"
54+
curl --connect-timeout 10 --retry 5 --retry-delay 0 --retry-max-time 240 \
55+
-o artifacts.zip "$download_url"
56+
57+
## Unzip and remove the artifact
58+
unzip artifacts.zip
59+
rm artifacts.zip
4860
- name: build
4961
shell: powershell
5062
env:
@@ -62,6 +74,11 @@ jobs:
6274
with:
6375
name: windows-artifacts
6476
path: artifacts
77+
- name: upload git-sdk-64-minimal
78+
uses: actions/upload-artifact@v1
79+
with:
80+
name: git-sdk-64-minimal
81+
path: git-sdk-64-minimal
6582
windows-test:
6683
runs-on: windows-latest
6784
needs: [windows-build]
@@ -70,9 +87,6 @@ jobs:
7087
nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
7188
steps:
7289
- uses: actions/checkout@v1
73-
- name: download git-sdk-64-minimal
74-
shell: bash
75-
run: a=git-sdk-64-minimal && mkdir -p $a && curl -# https://wingit.blob.core.windows.net/ci-artifacts/$a.tar.xz | tar -C $a -xJf -
7690
- name: download build artifacts
7791
uses: actions/download-artifact@v1
7892
with:
@@ -81,6 +95,11 @@ jobs:
8195
- name: extract build artifacts
8296
shell: bash
8397
run: tar xf artifacts.tar.gz
98+
- name: download git-sdk-64-minimal
99+
uses: actions/download-artifact@v1
100+
with:
101+
name: git-sdk-64-minimal
102+
path: ${{github.workspace}}/git-sdk-64-minimal/
84103
- name: test
85104
shell: powershell
86105
run: |
@@ -113,7 +132,19 @@ jobs:
113132
- uses: actions/checkout@v1
114133
- name: download git-sdk-64-minimal
115134
shell: bash
116-
run: a=git-sdk-64-minimal && mkdir -p $a && curl -# https://wingit.blob.core.windows.net/ci-artifacts/$a.tar.xz | tar -C $a -xJf -
135+
run: |
136+
## Get artifact
137+
urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
138+
id=$(curl "$urlbase?definitions=22&statusFilter=completed&resultFilter=succeeded&\$top=1" |
139+
jq -r ".value[] | .id")
140+
download_url="$(curl "$urlbase/$id/artifacts" |
141+
jq -r '.value[] | select(.name == "git-sdk-64-minimal").resource.downloadUrl')"
142+
curl --connect-timeout 10 --retry 5 --retry-delay 0 --retry-max-time 240 \
143+
-o artifacts.zip "$download_url"
144+
145+
## Unzip and remove the artifact
146+
unzip artifacts.zip
147+
rm artifacts.zip
117148
- name: generate Visual Studio solution
118149
shell: powershell
119150
run: |
@@ -153,15 +184,17 @@ jobs:
153184
path: artifacts
154185
vs-test:
155186
runs-on: windows-latest
156-
needs: [vs-build]
187+
needs: [vs-build, windows-build]
157188
strategy:
158189
matrix:
159190
nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
160191
steps:
161192
- uses: actions/checkout@v1
162-
- name: download git-64-portable
163-
shell: bash
164-
run: a=git-64-portable && mkdir -p $a && curl -# https://wingit.blob.core.windows.net/ci-artifacts/$a.tar.xz | tar -C $a -xJf -
193+
- name: download git-sdk-64-minimal
194+
uses: actions/download-artifact@v1
195+
with:
196+
name: git-sdk-64-minimal
197+
path: ${{github.workspace}}/git-sdk-64-minimal/
165198
- name: download build artifacts
166199
uses: actions/download-artifact@v1
167200
with:
@@ -177,9 +210,9 @@ jobs:
177210
NO_SVN_TESTS: 1
178211
GIT_TEST_SKIP_REBASE_P: 1
179212
run: |
180-
& git-64-portable\git-cmd.exe --command=usr\bin\bash.exe -lc @"
213+
& .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
181214
# Let Git ignore the SDK and the test-cache
182-
printf '%s\n' /git-64-portable/ /test-cache/ >>.git/info/exclude
215+
printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
183216
184217
cd t &&
185218
PATH=\"`$PWD/helper:`$PATH\" &&

0 commit comments

Comments
 (0)