]> git.ipfire.org Git - thirdparty/git.git/blob - .github/workflows/main.yml
ci: avoid pounding on the poor ci-artifacts container
[thirdparty/git.git] / .github / workflows / main.yml
1 name: CI/PR
2
3 on: [push, pull_request]
4
5 env:
6 DEVELOPER: 1
7
8 jobs:
9 windows-build:
10 runs-on: windows-latest
11 steps:
12 - uses: actions/checkout@v1
13 - name: download git-sdk-64-minimal
14 shell: bash
15 run: |
16 ## Get artifact
17 urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
18 id=$(curl "$urlbase?definitions=22&statusFilter=completed&resultFilter=succeeded&\$top=1" |
19 jq -r ".value[] | .id")
20 download_url="$(curl "$urlbase/$id/artifacts" |
21 jq -r '.value[] | select(.name == "git-sdk-64-minimal").resource.downloadUrl')"
22 curl --connect-timeout 10 --retry 5 --retry-delay 0 --retry-max-time 240 \
23 -o artifacts.zip "$download_url"
24
25 ## Unzip and remove the artifact
26 unzip artifacts.zip
27 rm artifacts.zip
28 - name: build
29 shell: powershell
30 env:
31 HOME: ${{runner.workspace}}
32 MSYSTEM: MINGW64
33 NO_PERL: 1
34 run: |
35 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
36 printf '%s\n' /git-sdk-64-minimal/ >>.git/info/exclude
37
38 ci/make-test-artifacts.sh artifacts
39 "@
40 - name: upload build artifacts
41 uses: actions/upload-artifact@v1
42 with:
43 name: windows-artifacts
44 path: artifacts
45 - name: upload git-sdk-64-minimal
46 uses: actions/upload-artifact@v1
47 with:
48 name: git-sdk-64-minimal
49 path: git-sdk-64-minimal
50 windows-test:
51 runs-on: windows-latest
52 needs: [windows-build]
53 strategy:
54 matrix:
55 nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
56 steps:
57 - uses: actions/checkout@v1
58 - name: download build artifacts
59 uses: actions/download-artifact@v1
60 with:
61 name: windows-artifacts
62 path: ${{github.workspace}}
63 - name: extract build artifacts
64 shell: bash
65 run: tar xf artifacts.tar.gz
66 - name: download git-sdk-64-minimal
67 uses: actions/download-artifact@v1
68 with:
69 name: git-sdk-64-minimal
70 path: ${{github.workspace}}/git-sdk-64-minimal/
71 - name: test
72 shell: powershell
73 run: |
74 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
75 # Let Git ignore the SDK
76 printf '%s\n' /git-sdk-64-minimal/ >>.git/info/exclude
77
78 ci/run-test-slice.sh ${{matrix.nr}} 10
79 "@
80 - name: ci/print-test-failures.sh
81 if: failure()
82 shell: powershell
83 run: |
84 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc ci/print-test-failures.sh
85 - name: Upload failed tests' directories
86 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
87 uses: actions/upload-artifact@v1
88 with:
89 name: failed-tests-windows
90 path: ${{env.FAILED_TEST_ARTIFACTS}}
91 vs-build:
92 env:
93 MSYSTEM: MINGW64
94 NO_PERL: 1
95 GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
96 runs-on: windows-latest
97 steps:
98 - uses: actions/checkout@v1
99 - name: download git-sdk-64-minimal
100 shell: bash
101 run: |
102 ## Get artifact
103 urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
104 id=$(curl "$urlbase?definitions=22&statusFilter=completed&resultFilter=succeeded&\$top=1" |
105 jq -r ".value[] | .id")
106 download_url="$(curl "$urlbase/$id/artifacts" |
107 jq -r '.value[] | select(.name == "git-sdk-64-minimal").resource.downloadUrl')"
108 curl --connect-timeout 10 --retry 5 --retry-delay 0 --retry-max-time 240 \
109 -o artifacts.zip "$download_url"
110
111 ## Unzip and remove the artifact
112 unzip artifacts.zip
113 rm artifacts.zip
114 - name: generate Visual Studio solution
115 shell: powershell
116 run: |
117 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
118 make NDEBUG=1 DEVELOPER=1 vcxproj
119 "@
120 if (!$?) { exit(1) }
121 - name: download vcpkg artifacts
122 shell: powershell
123 run: |
124 $urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
125 $id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
126 $downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
127 (New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
128 Expand-Archive compat.zip -DestinationPath . -Force
129 Remove-Item compat.zip
130 - name: add msbuild to PATH
131 uses: microsoft/setup-msbuild@v1.0.0
132 - name: MSBuild
133 run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
134 - name: bundle artifact tar
135 shell: powershell
136 env:
137 MSVC: 1
138 VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg
139 run: |
140 & compat\vcbuild\vcpkg_copy_dlls.bat release
141 if (!$?) { exit(1) }
142 & git-sdk-64-minimal\usr\bin\bash.exe -lc @"
143 mkdir -p artifacts &&
144 eval \"`$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts 2>&1 | grep ^tar)\"
145 "@
146 - name: upload build artifacts
147 uses: actions/upload-artifact@v1
148 with:
149 name: vs-artifacts
150 path: artifacts
151 vs-test:
152 runs-on: windows-latest
153 needs: [vs-build, windows-build]
154 strategy:
155 matrix:
156 nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
157 steps:
158 - uses: actions/checkout@v1
159 - name: download git-sdk-64-minimal
160 uses: actions/download-artifact@v1
161 with:
162 name: git-sdk-64-minimal
163 path: ${{github.workspace}}/git-sdk-64-minimal/
164 - name: download build artifacts
165 uses: actions/download-artifact@v1
166 with:
167 name: vs-artifacts
168 path: ${{github.workspace}}
169 - name: extract build artifacts
170 shell: bash
171 run: tar xf artifacts.tar.gz
172 - name: test (parallel)
173 shell: powershell
174 env:
175 MSYSTEM: MINGW64
176 NO_SVN_TESTS: 1
177 GIT_TEST_SKIP_REBASE_P: 1
178 run: |
179 & .\git-sdk-64-minimal\usr\bin\bash.exe -lc @"
180 # Let Git ignore the SDK and the test-cache
181 printf '%s\n' /git-sdk-64-minimal/ /test-cache/ >>.git/info/exclude
182
183 cd t &&
184 PATH=\"`$PWD/helper:`$PATH\" &&
185 test-tool.exe run-command testsuite --jobs=10 -V -x --write-junit-xml \
186 `$(test-tool.exe path-utils slice-tests \
187 ${{matrix.nr}} 10 t[0-9]*.sh)
188 "@
189 regular:
190 strategy:
191 matrix:
192 vector:
193 - jobname: linux-clang
194 cc: clang
195 pool: ubuntu-latest
196 - jobname: linux-gcc
197 cc: gcc
198 pool: ubuntu-latest
199 - jobname: osx-clang
200 cc: clang
201 pool: macos-latest
202 - jobname: osx-gcc
203 cc: gcc
204 pool: macos-latest
205 - jobname: GETTEXT_POISON
206 cc: gcc
207 pool: ubuntu-latest
208 env:
209 CC: ${{matrix.vector.cc}}
210 jobname: ${{matrix.vector.jobname}}
211 runs-on: ${{matrix.vector.pool}}
212 steps:
213 - uses: actions/checkout@v1
214 - run: ci/install-dependencies.sh
215 - run: ci/run-build-and-tests.sh
216 - run: ci/print-test-failures.sh
217 if: failure()
218 - name: Upload failed tests' directories
219 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
220 uses: actions/upload-artifact@v1
221 with:
222 name: failed-tests-${{matrix.vector.jobname}}
223 path: ${{env.FAILED_TEST_ARTIFACTS}}
224 dockerized:
225 strategy:
226 matrix:
227 vector:
228 - jobname: linux-musl
229 image: alpine
230 - jobname: Linux32
231 image: daald/ubuntu32:xenial
232 env:
233 jobname: ${{matrix.vector.jobname}}
234 runs-on: ubuntu-latest
235 container: ${{matrix.vector.image}}
236 steps:
237 - uses: actions/checkout@v1
238 - run: ci/install-docker-dependencies.sh
239 - run: ci/run-build-and-tests.sh
240 - run: ci/print-test-failures.sh
241 if: failure()
242 - name: Upload failed tests' directories
243 if: failure() && env.FAILED_TEST_ARTIFACTS != ''
244 uses: actions/upload-artifact@v1
245 with:
246 name: failed-tests-${{matrix.vector.jobname}}
247 path: ${{env.FAILED_TEST_ARTIFACTS}}
248 static-analysis:
249 env:
250 jobname: StaticAnalysis
251 runs-on: ubuntu-latest
252 steps:
253 - uses: actions/checkout@v1
254 - run: ci/install-dependencies.sh
255 - run: ci/run-static-analysis.sh
256 documentation:
257 env:
258 jobname: Documentation
259 runs-on: ubuntu-latest
260 steps:
261 - uses: actions/checkout@v1
262 - run: ci/install-dependencies.sh
263 - run: ci/test-documentation.sh