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: download vcpkg artifacts
151 $urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
152 $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
153 $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
154 (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
155 Expand-Archive compat.zip -DestinationPath . -Force
156 Remove-Item compat.zip
157 - name: add msbuild to PATH
158 uses: microsoft/setup-msbuild@v1.0.0
159 - name: copy dlls to root
162 & compat\vcbuild\vcpkg_copy_dlls.bat release
164 - name: generate Visual Studio solution
167 cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
168 -DIconv_LIBRARY=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/lib/libiconv.lib -DIconv_INCLUDE_DIR=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/include \
169 -DMSGFMT_EXE=`pwd`/git-sdk-64-minimal/mingw64/bin/msgfmt.exe -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
171 run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
172 - name: bundle artifact tar
176 VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg
178 & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
179 mkdir -p artifacts &&
180 eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts 2>&1 | grep ^tar)\"
182 - name: upload build artifacts
183 uses: actions/upload-artifact@v1
188 runs-on: windows-latest
189 needs: [vs-build, windows-build]
192 nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
194 - uses: actions/checkout@v1
195 - name: download git-sdk-64-minimal
196 uses: actions/download-artifact@v1
198 name: git-sdk-64-minimal
199 path: ${{github.workspace}}/git-sdk-64-minimal/
200 - name: download build artifacts
201 uses: actions/download-artifact@v1
204 path: ${{github.workspace}}
205 - name: extract build artifacts
207 run: tar xf artifacts.tar.gz
213 GIT_TEST_SKIP_REBASE_P: 1
215 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
216 # Let Git ignore the SDK and the test-cache
217 printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
219 ci/run-test-slice.sh ${{matrix.nr}} 10
221 - name: ci/print-test-failures.sh
225 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
226 - name: Upload failed tests' directories
227 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
228 uses: actions/upload-artifact@v1
230 name: failed-tests-windows
231 path: ${{env.FAILED_TEST_ARTIFACTS}}
234 if: needs.ci-config.outputs.enabled == 'yes'
238 - jobname: linux-clang
250 - jobname: GETTEXT_POISON
254 CC: ${{matrix.vector.cc}}
255 jobname: ${{matrix.vector.jobname}}
256 runs-on: ${{matrix.vector.pool}}
258 - uses: actions/checkout@v1
259 - run: ci/install-dependencies.sh
260 - run: ci/run-build-and-tests.sh
261 - run: ci/print-test-failures.sh
263 - name: Upload failed tests' directories
264 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
265 uses: actions/upload-artifact@v1
267 name: failed-tests-${{matrix.vector.jobname}}
268 path: ${{env.FAILED_TEST_ARTIFACTS}}
271 if: needs.ci-config.outputs.enabled == 'yes'
275 - jobname: linux-musl
278 image: daald/ubuntu32:xenial
280 jobname: ${{matrix.vector.jobname}}
281 runs-on: ubuntu-latest
282 container: ${{matrix.vector.image}}
284 - uses: actions/checkout@v1
285 - run: ci/install-docker-dependencies.sh
286 - run: ci/run-build-and-tests.sh
287 - run: ci/print-test-failures.sh
289 - name: Upload failed tests' directories
290 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
291 uses: actions/upload-artifact@v1
293 name: failed-tests-${{matrix.vector.jobname}}
294 path: ${{env.FAILED_TEST_ARTIFACTS}}
297 if: needs.ci-config.outputs.enabled == 'yes'
299 jobname: StaticAnalysis
300 runs-on: ubuntu-latest
302 - uses: actions/checkout@v1
303 - run: ci/install-dependencies.sh
304 - run: ci/run-static-analysis.sh
307 if: needs.ci-config.outputs.enabled == 'yes'
309 jobname: Documentation
310 runs-on: ubuntu-latest
312 - uses: actions/checkout@v1
313 - run: ci/install-dependencies.sh
314 - run: ci/test-documentation.sh