3 on: [push, pull_request]
10 runs-on: ubuntu-latest
12 enabled: ${{ steps.check-ref.outputs.enabled }}
14 - name: try to clone ci-config branch
15 continue-on-error: true
17 git -c protocol.version=2 clone \
24 https://github.com/${{ github.repository }} \
27 git checkout HEAD -- ci/config
29 name: check whether CI is enabled for ref
32 if test -x config-repo/ci/config/allow-ref &&
33 ! config-repo/ci/config/allow-ref '${{ github.ref }}'
37 echo "::set-output name=enabled::$enabled"
41 if: needs.ci-config.outputs.enabled == 'yes'
42 runs-on: windows-latest
44 - uses: actions/checkout@v1
45 - name: download git-sdk-64-minimal
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"
57 ## Unzip and remove the artifact
63 HOME: ${{runner.workspace}}
67 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
68 printf '%s\n' /git-sdk-64-minimal/ >>.git/info/exclude
70 ci/make-test-artifacts.sh artifacts
72 - name: upload build artifacts
73 uses: actions/upload-artifact@v1
75 name: windows-artifacts
77 - name: upload git-sdk-64-minimal
78 uses: actions/upload-artifact@v1
80 name: git-sdk-64-minimal
81 path: git-sdk-64-minimal
83 runs-on: windows-latest
84 needs: [windows-build]
87 nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
89 - uses: actions/checkout@v1
90 - name: download build artifacts
91 uses: actions/download-artifact@v1
93 name: windows-artifacts
94 path: ${{github.workspace}}
95 - name: extract build artifacts
97 run: tar xf artifacts.tar.gz
98 - name: download git-sdk-64-minimal
99 uses: actions/download-artifact@v1
101 name: git-sdk-64-minimal
102 path: ${{github.workspace}}/git-sdk-64-minimal/
106 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
107 # Let Git ignore the SDK
108 printf '%s\n' /git-sdk-64-minimal/ >>.git/info/exclude
110 ci/run-test-slice.sh ${{matrix.nr}} 10
112 - name: ci/print-test-failures.sh
116 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
117 - name: Upload failed tests' directories
118 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
119 uses: actions/upload-artifact@v1
121 name: failed-tests-windows
122 path: ${{env.FAILED_TEST_ARTIFACTS}}
125 if: needs.ci-config.outputs.enabled == 'yes'
129 GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
130 runs-on: windows-latest
132 - uses: actions/checkout@v1
133 - name: download git-sdk-64-minimal
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"
145 ## Unzip and remove the artifact
148 - name: generate Visual Studio solution
151 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
152 make NDEBUG=1 DEVELOPER=1 vcxproj
155 - name: download vcpkg artifacts
158 $urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
159 $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
160 $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
161 (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
162 Expand-Archive compat.zip -DestinationPath . -Force
163 Remove-Item compat.zip
164 - name: add msbuild to PATH
165 uses: microsoft/setup-msbuild@v1.0.0
167 run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
168 - name: bundle artifact tar
172 VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg
174 & compat\vcbuild\vcpkg_copy_dlls.bat release
176 & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
177 mkdir -p artifacts &&
178 eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts 2>&1 | grep ^tar)\"
180 - name: upload build artifacts
181 uses: actions/upload-artifact@v1
186 runs-on: windows-latest
187 needs: [vs-build, windows-build]
190 nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
192 - uses: actions/checkout@v1
193 - name: download git-sdk-64-minimal
194 uses: actions/download-artifact@v1
196 name: git-sdk-64-minimal
197 path: ${{github.workspace}}/git-sdk-64-minimal/
198 - name: download build artifacts
199 uses: actions/download-artifact@v1
202 path: ${{github.workspace}}
203 - name: extract build artifacts
205 run: tar xf artifacts.tar.gz
206 - name: test (parallel)
211 GIT_TEST_SKIP_REBASE_P: 1
213 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
214 # Let Git ignore the SDK and the test-cache
215 printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
218 PATH=\"`$PWD/helper:`$PATH\" &&
219 test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \
220 `$(test-tool.exe path-utils slice-tests \
221 ${{matrix.nr}} 10 t[0-9]*.sh)
225 if: needs.ci-config.outputs.enabled == 'yes'
229 - jobname: linux-clang
241 - jobname: GETTEXT_POISON
245 CC: ${{matrix.vector.cc}}
246 jobname: ${{matrix.vector.jobname}}
247 runs-on: ${{matrix.vector.pool}}
249 - uses: actions/checkout@v1
250 - run: ci/install-dependencies.sh
251 - run: ci/run-build-and-tests.sh
252 - run: ci/print-test-failures.sh
254 - name: Upload failed tests' directories
255 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
256 uses: actions/upload-artifact@v1
258 name: failed-tests-${{matrix.vector.jobname}}
259 path: ${{env.FAILED_TEST_ARTIFACTS}}
262 if: needs.ci-config.outputs.enabled == 'yes'
266 - jobname: linux-musl
269 image: daald/ubuntu32:xenial
271 jobname: ${{matrix.vector.jobname}}
272 runs-on: ubuntu-latest
273 container: ${{matrix.vector.image}}
275 - uses: actions/checkout@v1
276 - run: ci/install-docker-dependencies.sh
277 - run: ci/run-build-and-tests.sh
278 - run: ci/print-test-failures.sh
280 - name: Upload failed tests' directories
281 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
282 uses: actions/upload-artifact@v1
284 name: failed-tests-${{matrix.vector.jobname}}
285 path: ${{env.FAILED_TEST_ARTIFACTS}}
288 if: needs.ci-config.outputs.enabled == 'yes'
290 jobname: StaticAnalysis
291 runs-on: ubuntu-latest
293 - uses: actions/checkout@v1
294 - run: ci/install-dependencies.sh
295 - run: ci/run-static-analysis.sh
298 if: needs.ci-config.outputs.enabled == 'yes'
300 jobname: Documentation
301 runs-on: ubuntu-latest
303 - uses: actions/checkout@v1
304 - run: ci/install-dependencies.sh
305 - run: ci/test-documentation.sh