3 on: [push, pull_request]
11 runs-on: ubuntu-latest
13 enabled: ${{ steps.check-ref.outputs.enabled }}${{ steps.skip-if-redundant.outputs.enabled }}
15 - name: try to clone ci-config branch
17 git -c protocol.version=2 clone \
24 https://github.com/${{ github.repository }} \
27 git checkout HEAD -- ci/config || : ignore
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"
38 - name: skip if the commit or tree was already tested
40 uses: actions/github-script@v3
41 if: steps.check-ref.outputs.enabled == 'yes'
43 github-token: ${{secrets.GITHUB_TOKEN}}
46 // Figure out workflow ID, commit and tree
47 const { data: run } = await github.actions.getWorkflowRun({
48 owner: context.repo.owner,
49 repo: context.repo.repo,
50 run_id: context.runId,
52 const workflow_id = run.workflow_id;
53 const head_sha = run.head_sha;
54 const tree_id = run.head_commit.tree_id;
56 // See whether there is a successful run for that commit or tree
57 const { data: runs } = await github.actions.listWorkflowRuns({
58 owner: context.repo.owner,
59 repo: context.repo.repo,
64 for (const run of runs.workflow_runs) {
65 if (head_sha === run.head_sha) {
66 core.warning(`Successful run for the commit ${head_sha}: ${run.html_url}`);
67 core.setOutput('enabled', ' but skip');
70 if (run.head_commit && tree_id === run.head_commit.tree_id) {
71 core.warning(`Successful run for the tree ${tree_id}: ${run.html_url}`);
72 core.setOutput('enabled', ' but skip');
83 if: needs.ci-config.outputs.enabled == 'yes'
84 runs-on: windows-latest
86 - uses: actions/checkout@v3
87 - uses: git-for-windows/setup-git-for-windows-sdk@v1
91 HOME: ${{runner.workspace}}
93 run: . /etc/profile && ci/make-test-artifacts.sh artifacts
94 - name: zip up tracked files
95 run: git archive -o artifacts/tracked.tar.gz HEAD
96 - name: upload tracked files and build artifacts
97 uses: actions/upload-artifact@v2
99 name: windows-artifacts
103 runs-on: windows-latest
104 needs: [windows-build]
108 nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
110 - name: download tracked files and build artifacts
111 uses: actions/download-artifact@v2
113 name: windows-artifacts
114 path: ${{github.workspace}}
115 - name: extract tracked files and build artifacts
117 run: tar xf artifacts.tar.gz && tar xf tracked.tar.gz
118 - uses: git-for-windows/setup-git-for-windows-sdk@v1
121 run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10
122 - name: print test failures
123 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
125 run: ci/print-test-failures.sh
126 - name: Upload failed tests' directories
127 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
128 uses: actions/upload-artifact@v2
130 name: failed-tests-windows
131 path: ${{env.FAILED_TEST_ARTIFACTS}}
135 if: needs.ci-config.outputs.enabled == 'yes'
138 GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
139 runs-on: windows-latest
141 - uses: actions/checkout@v3
142 - uses: git-for-windows/setup-git-for-windows-sdk@v1
143 - name: initialize vcpkg
144 uses: actions/checkout@v3
146 repository: 'microsoft/vcpkg'
147 path: 'compat/vcbuild/vcpkg'
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
159 - name: copy dlls to root
161 run: compat\vcbuild\vcpkg_copy_dlls.bat release
162 - name: generate Visual Studio solution
165 cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
166 -DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
168 run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
169 - name: bundle artifact tar
173 VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg
175 mkdir -p artifacts &&
176 eval "$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts NO_GETTEXT=YesPlease 2>&1 | grep ^tar)"
177 - name: zip up tracked files
178 run: git archive -o artifacts/tracked.tar.gz HEAD
179 - name: upload tracked files and build artifacts
180 uses: actions/upload-artifact@v2
186 runs-on: windows-latest
191 nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
193 - uses: git-for-windows/setup-git-for-windows-sdk@v1
194 - name: download tracked files and build artifacts
195 uses: actions/download-artifact@v2
198 path: ${{github.workspace}}
199 - name: extract tracked files and build artifacts
201 run: tar xf artifacts.tar.gz && tar xf tracked.tar.gz
206 run: . /etc/profile && ci/run-test-slice.sh ${{matrix.nr}} 10
207 - name: print test failures
208 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
210 run: ci/print-test-failures.sh
211 - name: Upload failed tests' directories
212 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
213 uses: actions/upload-artifact@v2
215 name: failed-tests-windows
216 path: ${{env.FAILED_TEST_ARTIFACTS}}
218 name: ${{matrix.vector.jobname}} (${{matrix.vector.pool}})
220 if: needs.ci-config.outputs.enabled == 'yes'
225 - jobname: linux-clang
228 - jobname: linux-sha256
236 - jobname: linux-TEST-vars
248 - jobname: linux-gcc-default
251 - jobname: linux-leaks
255 CC: ${{matrix.vector.cc}}
256 CC_PACKAGE: ${{matrix.vector.cc_package}}
257 jobname: ${{matrix.vector.jobname}}
258 runs_on_pool: ${{matrix.vector.pool}}
259 runs-on: ${{matrix.vector.pool}}
261 - uses: actions/checkout@v3
262 - run: ci/install-dependencies.sh
263 - run: ci/run-build-and-tests.sh
264 - name: print test failures
265 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
267 run: ci/print-test-failures.sh
268 - name: Upload failed tests' directories
269 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
270 uses: actions/upload-artifact@v2
272 name: failed-tests-${{matrix.vector.jobname}}
273 path: ${{env.FAILED_TEST_ARTIFACTS}}
275 name: ${{matrix.vector.jobname}} (${{matrix.vector.image}})
277 if: needs.ci-config.outputs.enabled == 'yes'
282 - jobname: linux-musl
286 image: daald/ubuntu32:xenial
290 jobname: ${{matrix.vector.jobname}}
291 runs-on: ubuntu-latest
292 container: ${{matrix.vector.image}}
294 - uses: actions/checkout@v3
295 if: matrix.vector.jobname != 'linux32'
296 - uses: actions/checkout@v1
297 if: matrix.vector.jobname == 'linux32'
298 - run: ci/install-docker-dependencies.sh
299 - run: ci/run-build-and-tests.sh
300 - name: print test failures
301 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
303 run: ci/print-test-failures.sh
304 - name: Upload failed tests' directories
305 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
306 uses: actions/upload-artifact@v1
308 name: failed-tests-${{matrix.vector.jobname}}
309 path: ${{env.FAILED_TEST_ARTIFACTS}}
312 if: needs.ci-config.outputs.enabled == 'yes'
314 jobname: StaticAnalysis
315 runs-on: ubuntu-22.04
317 - uses: actions/checkout@v3
318 - run: ci/install-dependencies.sh
319 - run: ci/run-static-analysis.sh
320 - run: ci/check-directional-formatting.bash
323 if: needs.ci-config.outputs.enabled == 'yes'
326 runs-on: ubuntu-20.04
328 - name: Download a current `sparse` package
329 # Ubuntu's `sparse` version is too old for us
330 uses: git-for-windows/get-azure-pipelines-artifact@v0
334 artifact: sparse-20.04
335 - name: Install the current `sparse` package
336 run: sudo dpkg -i sparse-20.04/sparse_*.deb
337 - uses: actions/checkout@v3
338 - name: Install other dependencies
339 run: ci/install-dependencies.sh
344 if: needs.ci-config.outputs.enabled == 'yes'
346 jobname: Documentation
347 runs-on: ubuntu-latest
349 - uses: actions/checkout@v3
350 - run: ci/install-dependencies.sh
351 - run: ci/test-documentation.sh