Skip to content

Commit d32797f

Browse files
committed
WIP
TODO: restrict to `main`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 4afcf0e commit d32797f

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

.github/workflows/nano-server.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Windows Nano Server tests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- mimalloc-and-nano-server
8+
9+
env:
10+
DEVELOPER: 1
11+
12+
jobs:
13+
test-nano-server:
14+
runs-on: windows-2022
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: git-for-windows/setup-git-for-windows-sdk@v1
19+
- name: build Git
20+
shell: bash
21+
run: make -j15
22+
23+
# we copy this local so it can get included in the docker file
24+
- name: copy windbg local
25+
run: |
26+
xcopy "C:/Program Files (x86)/Windows Kits/10/Debuggers/x64" ./dbg64 /s /e /h
27+
28+
- name: run nanoserver test
29+
run: docker build .github/workflows/nanoserver-test
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM mcr.microsoft.com/powershell:nanoserver-1809
2+
USER ContainerAdministrator
3+
4+
# Folder previously copied from C:/Program Files (x86)/Windows Kits/10/Debuggers/x64
5+
COPY ["dbg64", "C:/dbg"]
6+
## multiple alternatives to the copy in a zip and use tar to unzip, or curl and unzip, etc.
7+
COPY ["git.exe","*.dll", "scalar.exe", "C:/test/"]
8+
COPY run-test.ps1 C:/
9+
10+
WORKDIR C:/
11+
RUN pwsh.exe run-tests.ps1
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# For each ecectuable to test pick some no-operation set of flags/subcommands
2+
# or something that should quickly result in an error with known exit code
3+
# that is not a negative 32 bit number, and set the expected return code appropriately.
4+
5+
# Only test exes that could be expected to run in a UI less environment.
6+
7+
# ( Excutable path, arguments, expected return code )
8+
# also note space is required before close paren (a powershell quirk when defining nested arrrays like this)
9+
$executables_to_test = @(
10+
('C:\test\git.exe', '', 1 ),
11+
('C:\test\scalar.exe', 'version', 0 )
12+
)
13+
14+
foreach ($executable in $executables_to_test)
15+
{
16+
Write-Output "Now testing $($executable[0])"
17+
&$executable[0] $executable[1]
18+
if ($LASTEXITCODE -ne $executable[2]) {
19+
# if we failed, run the debugger to find out what function or DLL could not be found
20+
# and then exit the script with failure The missing DLL or EXE will be referenced near
21+
# the end of the output
22+
23+
# Set a flag to havbe debugger show loader stub dianostics.
24+
C:\dbg\gflags -i $executable[0] +SLS
25+
26+
C:\dbg\cdb.exe -c "g" -c "q" $executable[0] $executable[1]
27+
28+
exit 1
29+
}
30+
}
31+
32+
exit 0

0 commit comments

Comments
 (0)