File tree Expand file tree Collapse file tree 3 files changed +72
-0
lines changed Expand file tree Collapse file tree 3 files changed +72
-0
lines changed Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments