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
16 git -c protocol.version=2 clone \
23 https://github.com/${{ github.repository }} \
26 git checkout HEAD -- ci/config || : ignore
28 name: check whether CI is enabled for ref
31 if test -x config-repo/ci/config/allow-ref &&
32 ! config-repo/ci/config/allow-ref '${{ github.ref }}'
36 echo "::set-output name=enabled::$enabled"
40 if: needs.ci-config.outputs.enabled == 'yes'
41 runs-on: windows-latest
43 - uses: actions/checkout@v1
44 - name: download git-sdk-64-minimal
48 urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
49 id=$(curl "$urlbase?definitions=22&statusFilter=completed&resultFilter=succeeded&\$top=1" |
50 jq -r ".value[] | .id")
51 download_url="$(curl "$urlbase/$id/artifacts" |
52 jq -r '.value[] | select(.name == "git-sdk-64-minimal").resource.downloadUrl')"
53 curl --connect-timeout 10 --retry 5 --retry-delay 0 --retry-max-time 240 \
54 -o artifacts.zip "$download_url"
56 ## Unzip and remove the artifact
62 HOME: ${{runner.workspace}}
66 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
67 printf '%s\n' /git-sdk-64-minimal/ >>.git/info/exclude
69 ci/make-test-artifacts.sh artifacts
71 - name: upload build artifacts
72 uses: actions/upload-artifact@v1
74 name: windows-artifacts
76 - name: upload git-sdk-64-minimal
77 uses: actions/upload-artifact@v1
79 name: git-sdk-64-minimal
80 path: git-sdk-64-minimal
82 runs-on: windows-latest
83 needs: [windows-build]
86 nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
88 - uses: actions/checkout@v1
89 - name: download build artifacts
90 uses: actions/download-artifact@v1
92 name: windows-artifacts
93 path: ${{github.workspace}}
94 - name: extract build artifacts
96 run: tar xf artifacts.tar.gz
97 - name: download git-sdk-64-minimal
98 uses: actions/download-artifact@v1
100 name: git-sdk-64-minimal
101 path: ${{github.workspace}}/git-sdk-64-minimal/
105 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
106 # Let Git ignore the SDK
107 printf '%s\n' /git-sdk-64-minimal/ >>.git/info/exclude
109 ci/run-test-slice.sh ${{matrix.nr}} 10
111 - name: ci/print-test-failures.sh
115 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
116 - name: Upload failed tests' directories
117 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
118 uses: actions/upload-artifact@v1
120 name: failed-tests-windows
121 path: ${{env.FAILED_TEST_ARTIFACTS}}
124 if: needs.ci-config.outputs.enabled == 'yes'
128 GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
129 runs-on: windows-latest
131 - uses: actions/checkout@v1
132 - name: download git-sdk-64-minimal
136 urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
137 id=$(curl "$urlbase?definitions=22&statusFilter=completed&resultFilter=succeeded&\$top=1" |
138 jq -r ".value[] | .id")
139 download_url="$(curl "$urlbase/$id/artifacts" |
140 jq -r '.value[] | select(.name == "git-sdk-64-minimal").resource.downloadUrl')"
141 curl --connect-timeout 10 --retry 5 --retry-delay 0 --retry-max-time 240 \
142 -o artifacts.zip "$download_url"
144 ## Unzip and remove the artifact
147 - name: download vcpkg artifacts
150 $urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
151 $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
152 $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
153 (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
154 Expand-Archive compat.zip -DestinationPath . -Force
155 Remove-Item compat.zip
156 - name: add msbuild to PATH
157 uses: microsoft/setup-msbuild@v1
158 - name: copy dlls to root
161 & compat\vcbuild\vcpkg_copy_dlls.bat release
163 - name: generate Visual Studio solution
166 cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
167 -DIconv_LIBRARY=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/lib/libiconv.lib -DIconv_INCLUDE_DIR=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/include \
168 -DMSGFMT_EXE=`pwd`/git-sdk-64-minimal/mingw64/bin/msgfmt.exe -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
170 run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
171 - name: bundle artifact tar
175 VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg
177 & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
178 mkdir -p artifacts &&
179 eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts 2>&1 | grep ^tar)\"
181 - name: upload build artifacts
182 uses: actions/upload-artifact@v1
187 runs-on: windows-latest
188 needs: [vs-build, windows-build]
191 nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
193 - uses: actions/checkout@v1
194 - name: download git-sdk-64-minimal
195 uses: actions/download-artifact@v1
197 name: git-sdk-64-minimal
198 path: ${{github.workspace}}/git-sdk-64-minimal/
199 - name: download build artifacts
200 uses: actions/download-artifact@v1
203 path: ${{github.workspace}}
204 - name: extract build artifacts
206 run: tar xf artifacts.tar.gz
212 GIT_TEST_SKIP_REBASE_P: 1
214 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
215 # Let Git ignore the SDK and the test-cache
216 printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
218 ci/run-test-slice.sh ${{matrix.nr}} 10
220 - name: ci/print-test-failures.sh
224 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
225 - name: Upload failed tests' directories
226 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
227 uses: actions/upload-artifact@v1
229 name: failed-tests-windows
230 path: ${{env.FAILED_TEST_ARTIFACTS}}
233 if: needs.ci-config.outputs.enabled == 'yes'
237 - jobname: linux-clang
249 - jobname: GETTEXT_POISON
253 CC: ${{matrix.vector.cc}}
254 jobname: ${{matrix.vector.jobname}}
255 runs-on: ${{matrix.vector.pool}}
257 - uses: actions/checkout@v1
258 - run: ci/install-dependencies.sh
259 - run: ci/run-build-and-tests.sh
260 - run: ci/print-test-failures.sh
262 - name: Upload failed tests' directories
263 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
264 uses: actions/upload-artifact@v1
266 name: failed-tests-${{matrix.vector.jobname}}
267 path: ${{env.FAILED_TEST_ARTIFACTS}}
270 if: needs.ci-config.outputs.enabled == 'yes'
274 - jobname: linux-musl
277 image: daald/ubuntu32:xenial
279 jobname: ${{matrix.vector.jobname}}
280 runs-on: ubuntu-latest
281 container: ${{matrix.vector.image}}
283 - uses: actions/checkout@v1
284 - run: ci/install-docker-dependencies.sh
285 - run: ci/run-build-and-tests.sh
286 - run: ci/print-test-failures.sh
288 - name: Upload failed tests' directories
289 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
290 uses: actions/upload-artifact@v1
292 name: failed-tests-${{matrix.vector.jobname}}
293 path: ${{env.FAILED_TEST_ARTIFACTS}}
296 if: needs.ci-config.outputs.enabled == 'yes'
298 jobname: StaticAnalysis
299 runs-on: ubuntu-latest
301 - uses: actions/checkout@v1
302 - run: ci/install-dependencies.sh
303 - run: ci/run-static-analysis.sh
306 if: needs.ci-config.outputs.enabled == 'yes'
308 jobname: Documentation
309 runs-on: ubuntu-latest
311 - uses: actions/checkout@v1
312 - run: ci/install-dependencies.sh
313 - run: ci/test-documentation.sh