Skip to content

Commit ef6bd16

Browse files
committed
Merge branch 'js/ci-swap-azure-pipelines-with-github-actions' into pu
Update the CI configuration to use GitHub Actions, retiring the one based on Azure Pipelines. * js/ci-swap-azure-pipelines-with-github-actions: ci: retire the Azure Pipelines definition README: add a build badge for the GitHub Actions runs ci: configure GitHub Actions for CI/PR ci/lib: allow running in GitHub Actions ci/lib: if CI type is unknown, show the environment variables ci: make MAKEFLAGS available inside the Docker container in the Linux32 job
2 parents bc9c219 + d0a3c37 commit ef6bd16

File tree

5 files changed

+296
-560
lines changed

5 files changed

+296
-560
lines changed

.github/workflows/main.yml

Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
1+
name: CI/PR
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
windows-build:
7+
runs-on: windows-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
- name: Download git-sdk-64-minimal
11+
shell: bash
12+
run: a=git-sdk-64-minimal && mkdir -p $a && curl -# https://wingit.blob.core.windows.net/ci-artifacts/$a.tar.xz | tar -C $a -xJf -
13+
- name: Build
14+
shell: powershell
15+
env:
16+
HOME: ${{runner.workspace}}
17+
MSYSTEM: MINGW64
18+
DEVELOPER: 1
19+
NO_PERL: 1
20+
run: |
21+
& .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
22+
printf '%s\n' /git-sdk-64-minimal/ >>.git/info/exclude
23+
24+
ci/make-test-artifacts.sh artifacts
25+
"@
26+
if (!$?) { exit(1) }
27+
- name: Upload build artifacts
28+
uses: actions/upload-artifact@v1
29+
with:
30+
name: windows-artifacts
31+
path: artifacts
32+
windows-test:
33+
runs-on: windows-latest
34+
needs: [windows-build]
35+
strategy:
36+
matrix:
37+
nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
38+
steps:
39+
- uses: actions/checkout@v1
40+
- name: Download git-sdk-64-minimal
41+
shell: bash
42+
run: a=git-sdk-64-minimal && mkdir -p $a && curl -# https://wingit.blob.core.windows.net/ci-artifacts/$a.tar.xz | tar -C $a -xJf -
43+
- name: Download build artifacts
44+
uses: actions/download-artifact@v1
45+
with:
46+
name: windows-artifacts
47+
path: ${{github.workspace}}
48+
- name: Test
49+
shell: powershell
50+
run: |
51+
& .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
52+
test -f artifacts.tar.gz || {
53+
echo No test artifacts found\; skipping >&2
54+
exit 0
55+
}
56+
tar xf artifacts.tar.gz || exit 1
57+
58+
# Let Git ignore the SDK
59+
printf '%s\n' /git-sdk-64-minimal/ >>.git/info/exclude
60+
61+
ci/run-test-slice.sh ${{matrix.nr}} 10 || {
62+
ci/print-test-failures.sh
63+
exit 1
64+
}
65+
"@
66+
if (!$?) { exit(1) }
67+
vs-build:
68+
runs-on: windows-latest
69+
steps:
70+
- uses: actions/checkout@v1
71+
- name: Download git-sdk-64-minimal
72+
shell: bash
73+
run: a=git-sdk-64-minimal && mkdir -p $a && curl -# https://wingit.blob.core.windows.net/ci-artifacts/$a.tar.xz | tar -C $a -xJf -
74+
- name: Generate Visual Studio Solution
75+
shell: powershell
76+
env:
77+
MSYSTEM: MINGW64
78+
DEVELOPER: 1
79+
NO_PERL: 1
80+
GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
81+
run: |
82+
& .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
83+
make NDEBUG=1 DEVELOPER=1 vcxproj
84+
"@
85+
if (!$?) { exit(1) }
86+
- name: Download vcpkg artifacts
87+
shell: powershell
88+
run: |
89+
$urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
90+
$id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
91+
$downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
92+
(New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
93+
Expand-Archive compat.zip -DestinationPath . -Force
94+
Remove-Item compat.zip
95+
- name: Add msbuild to PATH
96+
uses: microsoft/[email protected]
97+
- name: MSBuild
98+
run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
99+
- name: Bundle artifact tar
100+
shell: powershell
101+
env:
102+
MSYSTEM: MINGW64
103+
DEVELOPER: 1
104+
NO_PERL: 1
105+
MSVC: 1
106+
VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg
107+
run: |
108+
& compat\vcbuild\vcpkg_copy_dlls.bat release
109+
if (!$?) { exit(1) }
110+
& git-sdk-64-minimal\usr\bin\bash.exe -lc @"
111+
mkdir -p artifacts &&
112+
eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts 2>&1 | grep ^tar)\"
113+
"@
114+
if (!$?) { exit(1) }
115+
- name: Upload build artifacts
116+
uses: actions/upload-artifact@v1
117+
with:
118+
name: vs-artifacts
119+
path: artifacts
120+
vs-test:
121+
runs-on: windows-latest
122+
needs: [vs-build]
123+
strategy:
124+
matrix:
125+
nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
126+
steps:
127+
- uses: actions/checkout@v1
128+
- name: Download git-64-portable
129+
shell: bash
130+
run: a=git-64-portable && mkdir -p $a && curl -# https://wingit.blob.core.windows.net/ci-artifacts/$a.tar.xz | tar -C $a -xJf -
131+
- name: Download build artifacts
132+
uses: actions/download-artifact@v1
133+
with:
134+
name: vs-artifacts
135+
path: ${{github.workspace}}
136+
- name: Test (parallel)
137+
shell: powershell
138+
env:
139+
MSYSTEM: MINGW64
140+
NO_SVN_TESTS: 1
141+
GIT_TEST_SKIP_REBASE_P: 1
142+
run: |
143+
& git-64-portable\git-cmd.exe --command=usr\bin\bash.exe -lc @"
144+
test -f artifacts.tar.gz || {
145+
echo No test artifacts found\; skipping >&2
146+
exit 0
147+
}
148+
tar xf artifacts.tar.gz || exit 1
149+
150+
# Let Git ignore the SDK and the test-cache
151+
printf '%s\n' /git-64-portable/ /test-cache/ >>.git/info/exclude
152+
153+
cd t &&
154+
PATH=\"`$PWD/helper:`$PATH\" &&
155+
test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \
156+
`$(test-tool.exe path-utils slice-tests \
157+
${{matrix.nr}} 10 t[0-9]*.sh)
158+
"@
159+
if (!$?) { exit(1) }
160+
linux-clang:
161+
runs-on: ubuntu-latest
162+
steps:
163+
- uses: actions/checkout@v1
164+
- name: install dependencies
165+
env:
166+
CC: clang
167+
run: |
168+
sudo apt-get update &&
169+
sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2-bin &&
170+
ci/install-dependencies.sh
171+
- name: ci/run-build-and-test.sh
172+
env:
173+
CC: clang
174+
run: |
175+
ci/run-build-and-tests.sh || {
176+
ci/print-test-failures.sh
177+
exit 1
178+
}
179+
linux-gcc:
180+
runs-on: ubuntu-latest
181+
steps:
182+
- uses: actions/checkout@v1
183+
- name: install dependencies
184+
run: |
185+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test &&
186+
sudo apt-get update &&
187+
sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2 language-pack-is git-svn gcc-8 &&
188+
ci/install-dependencies.sh
189+
- name: ci/run-build-and-tests.sh
190+
run: |
191+
ci/run-build-and-tests.sh || {
192+
ci/print-test-failures.sh
193+
exit 1
194+
}
195+
osx-clang:
196+
runs-on: macos-latest
197+
steps:
198+
- uses: actions/checkout@v1
199+
- name: install dependencies
200+
env:
201+
CC: clang
202+
run: ci/install-dependencies.sh
203+
- name: ci/run-build-and-tests.sh
204+
env:
205+
CC: clang
206+
run: |
207+
ci/run-build-and-tests.sh || {
208+
ci/print-test-failures.sh
209+
exit 1
210+
}
211+
osx-gcc:
212+
runs-on: macos-latest
213+
steps:
214+
- uses: actions/checkout@v1
215+
- name: install dependencies
216+
run: ci/install-dependencies.sh
217+
- name: ci/run-build-and-tests.sh
218+
run: |
219+
ci/run-build-and-tests.sh || {
220+
ci/print-test-failures.sh
221+
exit 1
222+
}
223+
GETTEXT_POISON:
224+
runs-on: ubuntu-latest
225+
steps:
226+
- uses: actions/checkout@v1
227+
- name: install dependencies
228+
run: |
229+
sudo apt-get update &&
230+
sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev
231+
- name: ci/run-build-and-tests.sh
232+
env:
233+
jobname: GETTEXT_POISON
234+
run: |
235+
ci/run-build-and-tests.sh || {
236+
ci/print-test-failures.sh
237+
exit 1
238+
}
239+
linux32:
240+
runs-on: ubuntu-latest
241+
steps:
242+
- uses: actions/checkout@v1
243+
- name: ci/run-linux32-docker.sh
244+
run: |
245+
res=0
246+
sudo GITHUB_ACTIONS="$GITHUB_ACTIONS" RUNNER_OS="$RUNNER_OS" GITHUB_REF="$GITHUB_REF" GITHUB_SHA="$GITHUB_SHA" GITHUB_REPOSITORY="$GITHUB_REPOSITORY" GITHUB_RUN_ID="$GITHUB_RUN_ID" CC=$CC MAKEFLAGS="$MAKEFLAGS" bash -lxc ci/run-linux32-docker.sh || res=1
247+
static-analysis:
248+
runs-on: ubuntu-latest
249+
steps:
250+
- uses: actions/checkout@v1
251+
- name: install dependencies
252+
run: |
253+
sudo apt-get update &&
254+
sudo apt-get install -y coccinelle libcurl4-openssl-dev libssl-dev libexpat-dev gettext
255+
- name: ci/run-static-analysis.sh
256+
env:
257+
jobname: StaticAnalysis
258+
run: ci/run-static-analysis.sh
259+
documentation:
260+
runs-on: ubuntu-latest
261+
steps:
262+
- uses: actions/checkout@v1
263+
- name: install dependencies
264+
run: |
265+
sudo apt-get update &&
266+
sudo apt-get install -y asciidoc xmlto asciidoctor docbook-xsl-ns
267+
- name: ci/test-documentation.sh
268+
env:
269+
ALREADY_HAVE_ASCIIDOCTOR: yes.
270+
jobname: Documentation
271+
run: ci/test-documentation.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://dev.azure.com/git/git/_apis/build/status/git.git)](https://dev.azure.com/git/git/_build/latest?definitionId=11)
1+
[![Build status](https://github.com/git/git/workflows/CI/PR/badge.svg)](https://github.com/git/git/actions?query=branch%3Amaster+event%3Apush)
22

33
Git - fast, scalable, distributed revision control system
44
=========================================================

0 commit comments

Comments
 (0)