Skip to content

Commit 5ffa7cb

Browse files
committed
ci: also run the Windows test suite with BusyBox' ash
The BusyBox flavor of MinGit ships without an MSYS2 shell and instead points `core.shell` at BusyBox' `ash.exe`. To keep that configuration working, and as a step toward the longer-term goal of running Git for Windows' test suite faster by using BusyBox instead of the MSYS2 Bash, let's exercise the entire Windows test suite a second time using `ash` as the POSIX shell. This adds a `use-busybox` dimension to the `win test` matrix. The build artifacts are shared between the two legs; only the shell used to run the tests differs, so the extra coverage is comparatively cheap. The minimal Git for Windows SDK used in CI does not include the BusyBox applets, so `ash.exe` is fetched from the full SDK. It is then wired in via `GIT_TEST_SHELL_PATH` and `SHELL` (so that `git.exe` and the test framework's BUSYBOX prerequisite pick it up) as well as `SHELL_PATH` and `TEST_SHELL_PATH` (so that the test scripts themselves are run by it). Assisted-by: Opus 4.8 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 20a30e7 commit 5ffa7cb

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

.github/workflows/main.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,9 @@ jobs:
135135
fail-fast: false
136136
matrix:
137137
nr: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
138+
use-busybox: [false, true]
138139
concurrency:
139-
group: windows-test-${{ matrix.nr }}-${{ github.ref }}
140+
group: windows-test-${{ matrix.nr }}-${{ matrix.use-busybox }}-${{ github.ref }}
140141
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
141142
steps:
142143
- name: download tracked files and build artifacts
@@ -148,6 +149,32 @@ jobs:
148149
shell: bash
149150
run: tar xf artifacts.tar.gz && tar xf tracked.tar.gz
150151
- uses: git-for-windows/setup-git-for-windows-sdk@v2
152+
- name: download BusyBox' ash.exe and use it as the POSIX shell
153+
if: matrix.use-busybox == true
154+
shell: bash
155+
env:
156+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157+
run: |
158+
# TEMPORARY: pull the freshly-built, heap-corruption-fixed ash.exe
159+
# straight from the busybox-w32 PR build (git-for-windows/busybox-w32#15)
160+
# instead of the stale copy shipped in git-sdk-64. Once that fix is
161+
# released into the SDK this step reverts to the pinned download.
162+
run_id="$(gh run list -R git-for-windows/busybox-w32 \
163+
--branch fix-quote-arg-msys2-heap-corruption \
164+
--workflow build.yml --status success --limit 1 \
165+
--json databaseId --jq '.[0].databaseId')" &&
166+
test -n "$run_id" &&
167+
gh run download -R git-for-windows/busybox-w32 "$run_id" \
168+
-n busybox -D bb &&
169+
test -f bb/busybox.exe &&
170+
cp bb/busybox.exe /mingw64/bin/ash.exe &&
171+
ash="$(cygpath -am /mingw64/bin/ash.exe)" &&
172+
echo "GIT_TEST_SHELL_PATH=$ash" >>$GITHUB_ENV &&
173+
echo "SHELL=$ash" >>$GITHUB_ENV &&
174+
echo "SHELL_PATH=$ash" >>$GITHUB_ENV &&
175+
echo "TEST_SHELL_PATH=$ash" >>$GITHUB_ENV &&
176+
echo "SHELL_PATH=$ash" >>GIT-BUILD-OPTIONS &&
177+
echo "TEST_SHELL_PATH=$ash" >>GIT-BUILD-OPTIONS
151178
- name: test
152179
shell: bash
153180
run: . /etc/profile && ci/run-test-slice.sh $((${{matrix.nr}} + 1)) 10
@@ -159,7 +186,7 @@ jobs:
159186
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
160187
uses: actions/upload-artifact@v7
161188
with:
162-
name: failed-tests-windows-${{ matrix.nr }}
189+
name: failed-tests-windows-${{ matrix.nr }}-${{ matrix.use-busybox }}
163190
path: ${{env.FAILED_TEST_ARTIFACTS}}
164191
vs-build:
165192
name: win+VS build

0 commit comments

Comments
 (0)