Skip to content

Commit fcac559

Browse files
committed
ci(windows): transfer the entire worktree to the test jobs
Git's test suite is excruciatingly slow on Windows, mainly due to the fact that it executes a lot of shell script code, and that's simply not native to Windows. To help with that, we established the pattern where the artifacts are first built in one job, and then multiple test jobs run in parallel using the artifacts built in the first job. We take pains in transferring only the build outputs, and letting `actions/checkout` fill in the rest of the files. One major downside is that the test jobs might fail to check out the intended revision (e.g. because the branch has been updated while the build was running, as is frequently the case with the `seen` branch). Let's just transfer the entire worktree (excluding the `vcpkg` artifacts in the `vs-*` jobs because they are "heavy" and not needed for the test suite), so as to prepare better for above-mentioned scenario. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent c99af5f commit fcac559

File tree

3 files changed

+11
-36
lines changed

3 files changed

+11
-36
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@ jobs:
8888
env:
8989
HOME: ${{runner.workspace}}
9090
NO_PERL: 1
91-
run: ci/make-test-artifacts.sh artifacts
92-
- name: upload build artifacts
91+
run: ci/run-build-and-tests.sh --skip-tests
92+
- name: upload worktree with build artifacts
9393
uses: actions/upload-artifact@v2
9494
with:
9595
name: windows-artifacts
96-
path: artifacts
96+
path: .
9797
windows-test:
9898
runs-on: windows-latest
9999
needs: [windows-build]
@@ -102,15 +102,11 @@ jobs:
102102
matrix:
103103
nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
104104
steps:
105-
- uses: actions/checkout@v1
106-
- name: download build artifacts
105+
- name: download worktree with build artifacts
107106
uses: actions/download-artifact@v2
108107
with:
109108
name: windows-artifacts
110109
path: ${{github.workspace}}
111-
- name: extract build artifacts
112-
shell: bash
113-
run: tar xf artifacts.tar.gz
114110
- uses: git-for-windows/setup-git-for-windows-sdk@main
115111
- name: test
116112
shell: bash
@@ -156,19 +152,13 @@ jobs:
156152
-DMSGFMT_EXE=C:/git-sdk-64-minimal/mingw64/bin/msgfmt.exe -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
157153
- name: MSBuild
158154
run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
159-
- name: bundle artifact tar
160-
shell: bash
161-
env:
162-
MSVC: 1
163-
VCPKG_ROOT: ${{github.workspace}}\compat\vcbuild\vcpkg
164-
run: |
165-
mkdir -p artifacts &&
166-
eval "$(make -n artifacts-tar INCLUDE_DLLS_IN_ARTIFACTS=YesPlease ARTIFACTS_DIRECTORY=artifacts 2>&1 | grep ^tar)"
167-
- name: upload build artifacts
155+
- name: upload worktree with build artifacts
168156
uses: actions/upload-artifact@v2
169157
with:
170158
name: vs-artifacts
171-
path: artifacts
159+
path: |
160+
.
161+
!contrib/
172162
vs-test:
173163
runs-on: windows-latest
174164
needs: vs-build
@@ -177,16 +167,12 @@ jobs:
177167
matrix:
178168
nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
179169
steps:
180-
- uses: actions/checkout@v1
181170
- uses: git-for-windows/setup-git-for-windows-sdk@main
182171
- name: download build artifacts
183172
uses: actions/download-artifact@v2
184173
with:
185174
name: vs-artifacts
186175
path: ${{github.workspace}}
187-
- name: extract build artifacts
188-
shell: bash
189-
run: tar xf artifacts.tar.gz
190176
- name: test
191177
shell: bash
192178
env:

ci/make-test-artifacts.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

ci/run-build-and-tests.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ windows*) cmd //c mklink //j t\\.prove "$(cygpath -aw "$cache_dir/.prove")";;
1111
esac
1212

1313
make
14+
check_unignored_build_artifacts
15+
test --skip-tests != "$*" || exit 0
16+
1417
case "$jobname" in
1518
linux-gcc)
1619
make test
@@ -40,6 +43,4 @@ linux-gcc-4.8)
4043
;;
4144
esac
4245

43-
check_unignored_build_artifacts
44-
4546
save_good_tree

0 commit comments

Comments
 (0)