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}}
45 // Figure out workflow ID, commit and tree
46 const { data: run } = await github.actions.getWorkflowRun({
47 owner: context.repo.owner,
48 repo: context.repo.repo,
49 run_id: context.runId,
51 const workflow_id = run.workflow_id;
52 const head_sha = run.head_sha;
53 const tree_id = run.head_commit.tree_id;
55 // See whether there is a successful run for that commit or tree
56 const { data: runs } = await github.actions.listWorkflowRuns({
57 owner: context.repo.owner,
58 repo: context.repo.repo,
63 for (const run of runs.workflow_runs) {
64 if (head_sha === run.head_sha) {
65 core.warning(`Successful run for the commit ${head_sha}: ${run.html_url}`);
66 core.setOutput('enabled', ' but skip');
69 if (run.head_commit && tree_id === run.head_commit.tree_id) {
70 core.warning(`Successful run for the tree ${tree_id}: ${run.html_url}`);
71 core.setOutput('enabled', ' but skip');
81 if: needs.ci-config.outputs.enabled == 'yes'
82 runs-on: windows-latest
84 - uses: actions/checkout@v1
85 - name: download git-sdk-64-minimal
89 urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
90 id=$(curl "$urlbase?definitions=22&statusFilter=completed&resultFilter=succeeded&\$top=1" |
91 jq -r ".value[] | .id")
92 download_url="$(curl "$urlbase/$id/artifacts" |
93 jq -r '.value[] | select(.name == "git-sdk-64-minimal").resource.downloadUrl')"
94 curl --connect-timeout 10 --retry 5 --retry-delay 0 --retry-max-time 240 \
95 -o artifacts.zip "$download_url"
97 ## Unzip and remove the artifact
103 HOME: ${{runner.workspace}}
107 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
108 printf '%s\n' /git-sdk-64-minimal/ >>.git/info/exclude
110 ci/make-test-artifacts.sh artifacts
112 - name: upload build artifacts
113 uses: actions/upload-artifact@v1
115 name: windows-artifacts
117 - name: upload git-sdk-64-minimal
118 uses: actions/upload-artifact@v1
120 name: git-sdk-64-minimal
121 path: git-sdk-64-minimal
123 runs-on: windows-latest
124 needs: [windows-build]
127 nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
129 - uses: actions/checkout@v1
130 - name: download build artifacts
131 uses: actions/download-artifact@v1
133 name: windows-artifacts
134 path: ${{github.workspace}}
135 - name: extract build artifacts
137 run: tar xf artifacts.tar.gz
138 - name: download git-sdk-64-minimal
139 uses: actions/download-artifact@v1
141 name: git-sdk-64-minimal
142 path: ${{github.workspace}}/git-sdk-64-minimal/
146 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
147 # Let Git ignore the SDK
148 printf '%s\n' /git-sdk-64-minimal/ >>.git/info/exclude
150 ci/run-test-slice.sh ${{matrix.nr}} 10
152 - name: ci/print-test-failures.sh
156 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
157 - name: Upload failed tests' directories
158 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
159 uses: actions/upload-artifact@v1
161 name: failed-tests-windows
162 path: ${{env.FAILED_TEST_ARTIFACTS}}
165 if: needs.ci-config.outputs.enabled == 'yes'
169 GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
170 runs-on: windows-latest
172 - uses: actions/checkout@v1
173 - name: download git-sdk-64-minimal
177 urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
178 id=$(curl "$urlbase?definitions=22&statusFilter=completed&resultFilter=succeeded&\$top=1" |
179 jq -r ".value[] | .id")
180 download_url="$(curl "$urlbase/$id/artifacts" |
181 jq -r '.value[] | select(.name == "git-sdk-64-minimal").resource.downloadUrl')"
182 curl --connect-timeout 10 --retry 5 --retry-delay 0 --retry-max-time 240 \
183 -o artifacts.zip "$download_url"
185 ## Unzip and remove the artifact
188 - name: download vcpkg artifacts
191 $urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
192 $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
193 $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
194 (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
195 Expand-Archive compat.zip -DestinationPath . -Force
196 Remove-Item compat.zip
197 - name: add msbuild to PATH
198 uses: microsoft/setup-msbuild@v1
199 - name: copy dlls to root
202 & compat\vcbuild\vcpkg_copy_dlls.bat release
204 - name: generate Visual Studio solution
207 cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
208 -DIconv_LIBRARY=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/lib/libiconv.lib -DIconv_INCLUDE_DIR=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/include \
209 -DMSGFMT_EXE=`pwd`/git-sdk-64-minimal/mingw64/bin/msgfmt.exe -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
211 run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
212 - name: bundle artifact tar
216 VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg
218 & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
219 mkdir -p artifacts &&
220 eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts 2>&1 | grep ^tar)\"
222 - name: upload build artifacts
223 uses: actions/upload-artifact@v1
228 runs-on: windows-latest
229 needs: [vs-build, windows-build]
232 nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
234 - uses: actions/checkout@v1
235 - name: download git-sdk-64-minimal
236 uses: actions/download-artifact@v1
238 name: git-sdk-64-minimal
239 path: ${{github.workspace}}/git-sdk-64-minimal/
240 - name: download build artifacts
241 uses: actions/download-artifact@v1
244 path: ${{github.workspace}}
245 - name: extract build artifacts
247 run: tar xf artifacts.tar.gz
253 GIT_TEST_SKIP_REBASE_P: 1
255 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
256 # Let Git ignore the SDK and the test-cache
257 printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
259 ci/run-test-slice.sh ${{matrix.nr}} 10
261 - name: ci/print-test-failures.sh
265 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
266 - name: Upload failed tests' directories
267 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
268 uses: actions/upload-artifact@v1
270 name: failed-tests-windows
271 path: ${{env.FAILED_TEST_ARTIFACTS}}
274 if: needs.ci-config.outputs.enabled == 'yes'
278 - jobname: linux-clang
290 - jobname: GETTEXT_POISON
294 CC: ${{matrix.vector.cc}}
295 jobname: ${{matrix.vector.jobname}}
296 runs-on: ${{matrix.vector.pool}}
298 - uses: actions/checkout@v1
299 - run: ci/install-dependencies.sh
300 - run: ci/run-build-and-tests.sh
301 - run: ci/print-test-failures.sh
303 - name: Upload failed tests' directories
304 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
305 uses: actions/upload-artifact@v1
307 name: failed-tests-${{matrix.vector.jobname}}
308 path: ${{env.FAILED_TEST_ARTIFACTS}}
311 if: needs.ci-config.outputs.enabled == 'yes'
315 - jobname: linux-musl
318 image: daald/ubuntu32:xenial
320 jobname: ${{matrix.vector.jobname}}
321 runs-on: ubuntu-latest
322 container: ${{matrix.vector.image}}
324 - uses: actions/checkout@v1
325 - run: ci/install-docker-dependencies.sh
326 - run: ci/run-build-and-tests.sh
327 - run: ci/print-test-failures.sh
329 - name: Upload failed tests' directories
330 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
331 uses: actions/upload-artifact@v1
333 name: failed-tests-${{matrix.vector.jobname}}
334 path: ${{env.FAILED_TEST_ARTIFACTS}}
337 if: needs.ci-config.outputs.enabled == 'yes'
339 jobname: StaticAnalysis
340 runs-on: ubuntu-latest
342 - uses: actions/checkout@v1
343 - run: ci/install-dependencies.sh
344 - run: ci/run-static-analysis.sh
347 if: needs.ci-config.outputs.enabled == 'yes'
349 jobname: Documentation
350 runs-on: ubuntu-latest
352 - uses: actions/checkout@v1
353 - run: ci/install-dependencies.sh
354 - run: ci/test-documentation.sh