Skip to content

Commit 6cff6d6

Browse files
committed
ci: verify that the Git and Scalar executables work in Nano Server
It was reported in git-for-windows/git#4052 that Git for Windows v2.38.0 introduced a regression where `git.exe` could no longer be run in Nano Server containers. The issue was fixed in git-for-windows/git#4074 Let's add a workflow that verifies that Git for Windows does not regress on this in the future. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 1d92f5c commit 6cff6d6

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.github/workflows/nano-server.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Windows Nano Server tests
2+
3+
on: [workflow_dispatch, push]
4+
5+
jobs:
6+
test-nano-server:
7+
if: github.event.repository.fork == false || github.event_name == 'workflow_dispatch'
8+
runs-on: windows-2022
9+
env:
10+
REF: ${{github.ref}}
11+
WINDBG_DIR: "C:/Program Files (x86)/Windows Kits/10/Debuggers/x64"
12+
IMAGE: mcr.microsoft.com/powershell:nanoserver-ltsc2022
13+
14+
steps:
15+
- name: partial clone
16+
shell: bash
17+
run: |
18+
# cannot use `git clone` directly, to allow for PR's refs to be fetched
19+
git clone --no-checkout --single-branch -b ${REF#refs/heads/} --filter=blob:none --depth=1 \
20+
https://github.com/${{github.repository}} . &&
21+
git sparse-checkout set .github/workflows mingw64/bin &&
22+
git checkout HEAD
23+
- name: pull nanoserver image
24+
shell: bash
25+
run: docker pull $IMAGE
26+
- name: run nano-server test
27+
shell: bash
28+
run: |
29+
docker pull $IMAGE
30+
docker run \
31+
--user "ContainerAdministrator" \
32+
-v "$WINDBG_DIR:C:/dbg" \
33+
-v "$(cygpath -aw mingw64/bin):C:/test" \
34+
-v "$(cygpath -aw .github/workflows/nano-server):C:/script" \
35+
$IMAGE pwsh.exe C:/script/run-tests.ps1
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Each exectuable to test is run with the `version` subcommand; It is
2+
# expected to return with exit code 0.
3+
4+
$executables_to_test = @(
5+
'C:\test\git.exe',
6+
'C:\test\scalar.exe'
7+
)
8+
9+
foreach ($executable in $executables_to_test)
10+
{
11+
Write-Output "Now testing $($executable)"
12+
&$executable 'version'
13+
if ($LASTEXITCODE -ne 0) {
14+
# If the command failed, run the debugger to find out what function or
15+
# DLL could not be found and then exit the script with failure. The
16+
# missing DLL or EXE will be referenced near the end of the output
17+
18+
# Set flag to ask the debugger to
19+
# - show loader stub dianostics,
20+
# - enable system critical breaks,
21+
# - stop on exception, and
22+
# - stop on unhandled user-mode exception
23+
#
24+
# For further details, see
25+
# https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/gflags-flag-table
26+
C:\dbg\gflags -i $executable +SLS +SCB +SOE +SUE
27+
28+
C:\dbg\cdb.exe -c "g" -c "q" $executable 'version'
29+
30+
exit 1
31+
}
32+
}
33+
34+
exit 0

0 commit comments

Comments
 (0)