3 on: [push, pull_request]
10 runs-on: ubuntu-latest
12 enabled: ${{ steps.check-ref.outputs.enabled }}${{ steps.skip-if-redundant.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"
37 - name: skip if the commit or tree was already tested
39 uses: actions/github-script@v3
40 if: steps.check-ref.outputs.enabled == 'yes'
42 github-token: ${{secrets.GITHUB_TOKEN}}
44 // Figure out workflow ID, commit and tree
45 const { data: run } = await github.actions.getWorkflowRun({
46 owner: context.repo.owner,
47 repo: context.repo.repo,
48 run_id: context.runId,
50 const workflow_id = run.workflow_id;
51 const head_sha = run.head_sha;
52 const tree_id = run.head_commit.tree_id;
54 // See whether there is a successful run for that commit or tree
55 const { data: runs } = await github.actions.listWorkflowRuns({
56 owner: context.repo.owner,
57 repo: context.repo.repo,
62 for (const run of runs.workflow_runs) {
63 if (head_sha === run.head_sha) {
64 core.warning(`Successful run for the commit ${head_sha}: ${run.html_url}`);
65 core.setOutput('enabled', ' but skip');
68 if (tree_id === run.head_commit.tree_id) {
69 core.warning(`Successful run for the tree ${tree_id}: ${run.html_url}`);
70 core.setOutput('enabled', ' but skip');
77 if: needs.ci-config.outputs.enabled == 'yes'
78 runs-on: windows-latest
80 - uses: actions/checkout@v1
81 - name: download git-sdk-64-minimal
85 urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
86 id=$(curl "$urlbase?definitions=22&statusFilter=completed&resultFilter=succeeded&\$top=1" |
87 jq -r ".value[] | .id")
88 download_url="$(curl "$urlbase/$id/artifacts" |
89 jq -r '.value[] | select(.name == "git-sdk-64-minimal").resource.downloadUrl')"
90 curl --connect-timeout 10 --retry 5 --retry-delay 0 --retry-max-time 240 \
91 -o artifacts.zip "$download_url"
93 ## Unzip and remove the artifact
99 HOME: ${{runner.workspace}}
103 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
104 printf '%s\n' /git-sdk-64-minimal/ >>.git/info/exclude
106 ci/make-test-artifacts.sh artifacts
108 - name: upload build artifacts
109 uses: actions/upload-artifact@v1
111 name: windows-artifacts
113 - name: upload git-sdk-64-minimal
114 uses: actions/upload-artifact@v1
116 name: git-sdk-64-minimal
117 path: git-sdk-64-minimal
119 runs-on: windows-latest
120 needs: [windows-build]
123 nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
125 - uses: actions/checkout@v1
126 - name: download build artifacts
127 uses: actions/download-artifact@v1
129 name: windows-artifacts
130 path: ${{github.workspace}}
131 - name: extract build artifacts
133 run: tar xf artifacts.tar.gz
134 - name: download git-sdk-64-minimal
135 uses: actions/download-artifact@v1
137 name: git-sdk-64-minimal
138 path: ${{github.workspace}}/git-sdk-64-minimal/
142 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
143 # Let Git ignore the SDK
144 printf '%s\n' /git-sdk-64-minimal/ >>.git/info/exclude
146 ci/run-test-slice.sh ${{matrix.nr}} 10
148 - name: ci/print-test-failures.sh
152 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
153 - name: Upload failed tests' directories
154 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
155 uses: actions/upload-artifact@v1
157 name: failed-tests-windows
158 path: ${{env.FAILED_TEST_ARTIFACTS}}
161 if: needs.ci-config.outputs.enabled == 'yes'
165 GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
166 runs-on: windows-latest
168 - uses: actions/checkout@v1
169 - name: download git-sdk-64-minimal
173 urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
174 id=$(curl "$urlbase?definitions=22&statusFilter=completed&resultFilter=succeeded&\$top=1" |
175 jq -r ".value[] | .id")
176 download_url="$(curl "$urlbase/$id/artifacts" |
177 jq -r '.value[] | select(.name == "git-sdk-64-minimal").resource.downloadUrl')"
178 curl --connect-timeout 10 --retry 5 --retry-delay 0 --retry-max-time 240 \
179 -o artifacts.zip "$download_url"
181 ## Unzip and remove the artifact
184 - name: download vcpkg artifacts
187 $urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
188 $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
189 $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
190 (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
191 Expand-Archive compat.zip -DestinationPath . -Force
192 Remove-Item compat.zip
193 - name: add msbuild to PATH
194 uses: microsoft/setup-msbuild@v1
195 - name: copy dlls to root
198 & compat\vcbuild\vcpkg_copy_dlls.bat release
200 - name: generate Visual Studio solution
203 cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
204 -DIconv_LIBRARY=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/lib/libiconv.lib -DIconv_INCLUDE_DIR=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/include \
205 -DMSGFMT_EXE=`pwd`/git-sdk-64-minimal/mingw64/bin/msgfmt.exe -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
207 run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
208 - name: bundle artifact tar
212 VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg
214 & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
215 mkdir -p artifacts &&
216 eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts 2>&1 | grep ^tar)\"
218 - name: upload build artifacts
219 uses: actions/upload-artifact@v1
224 runs-on: windows-latest
225 needs: [vs-build, windows-build]
228 nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
230 - uses: actions/checkout@v1
231 - name: download git-sdk-64-minimal
232 uses: actions/download-artifact@v1
234 name: git-sdk-64-minimal
235 path: ${{github.workspace}}/git-sdk-64-minimal/
236 - name: download build artifacts
237 uses: actions/download-artifact@v1
240 path: ${{github.workspace}}
241 - name: extract build artifacts
243 run: tar xf artifacts.tar.gz
249 GIT_TEST_SKIP_REBASE_P: 1
251 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
252 # Let Git ignore the SDK and the test-cache
253 printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
255 ci/run-test-slice.sh ${{matrix.nr}} 10
257 - name: ci/print-test-failures.sh
261 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc 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-windows
267 path: ${{env.FAILED_TEST_ARTIFACTS}}
270 if: needs.ci-config.outputs.enabled == 'yes'
274 - jobname: linux-clang
286 - jobname: GETTEXT_POISON
290 CC: ${{matrix.vector.cc}}
291 jobname: ${{matrix.vector.jobname}}
292 runs-on: ${{matrix.vector.pool}}
294 - uses: actions/checkout@v1
295 - run: ci/install-dependencies.sh
296 - run: ci/run-build-and-tests.sh
297 - run: ci/print-test-failures.sh
299 - name: Upload failed tests' directories
300 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
301 uses: actions/upload-artifact@v1
303 name: failed-tests-${{matrix.vector.jobname}}
304 path: ${{env.FAILED_TEST_ARTIFACTS}}
307 if: needs.ci-config.outputs.enabled == 'yes'
311 - jobname: linux-musl
314 image: daald/ubuntu32:xenial
316 jobname: ${{matrix.vector.jobname}}
317 runs-on: ubuntu-latest
318 container: ${{matrix.vector.image}}
320 - uses: actions/checkout@v1
321 - run: ci/install-docker-dependencies.sh
322 - run: ci/run-build-and-tests.sh
323 - run: ci/print-test-failures.sh
325 - name: Upload failed tests' directories
326 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
327 uses: actions/upload-artifact@v1
329 name: failed-tests-${{matrix.vector.jobname}}
330 path: ${{env.FAILED_TEST_ARTIFACTS}}
333 if: needs.ci-config.outputs.enabled == 'yes'
335 jobname: StaticAnalysis
336 runs-on: ubuntu-latest
338 - uses: actions/checkout@v1
339 - run: ci/install-dependencies.sh
340 - run: ci/run-static-analysis.sh
343 if: needs.ci-config.outputs.enabled == 'yes'
345 jobname: Documentation
346 runs-on: ubuntu-latest
348 - uses: actions/checkout@v1
349 - run: ci/install-dependencies.sh
350 - run: ci/test-documentation.sh