-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (83 loc) · 3.47 KB
/
test-windows.yml
File metadata and controls
103 lines (83 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Windows Tests (mouse)
on:
push:
branches: [ master ]
paths:
- 'src/**'
- 'tests/**'
- '.github/**'
- 'CMakeLists.txt'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'tests/**'
- '.github/**'
- 'CMakeLists.txt'
jobs:
test-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install vcpkg and SDL2
run: |
# Clone vcpkg
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
# Bootstrap vcpkg
.\bootstrap-vcpkg.bat
# Install SDL2
.\vcpkg install sdl2:x64-windows
# Integrate with Visual Studio
.\vcpkg integrate install
cd ..
- name: Configure with vcpkg
run: |
cmake -B build -DCMAKE_TOOLCHAIN_FILE="$PWD/vcpkg/scripts/buildsystems/vcpkg.cmake" -DBUILD_ROBOT_TESTS=ON
- name: Build
run: cmake --build build --config Release
- name: Test
run: |
# Check and display directory structure
Write-Host "Checking directory structure..."
# Check vcpkg directories
Write-Host "Vcpkg directories:"
Get-ChildItem -Path "vcpkg\installed\x64-windows\bin" -ErrorAction SilentlyContinue
# Check build output directories
Write-Host "Build output directories:"
Get-ChildItem -Path "build\bin" -ErrorAction SilentlyContinue
Get-ChildItem -Path "build\bin\Release" -ErrorAction SilentlyContinue
# Find SDL2.dll
Write-Host "Finding SDL2.dll..."
Get-ChildItem -Path "vcpkg" -Recurse -Filter "SDL2.dll" -ErrorAction SilentlyContinue |
ForEach-Object { Write-Host $_.FullName }
# Create Release directory if it doesn't exist
if (-not (Test-Path "build\bin\Release")) {
Write-Host "Creating missing directory: build\bin\Release"
New-Item -Path "build\bin\Release" -ItemType Directory -Force
}
# Try to find the executable
Write-Host "Finding test executable..."
Get-ChildItem -Path "build" -Recurse -Filter "*.exe" -ErrorAction SilentlyContinue |
ForEach-Object { Write-Host $_.FullName }
# Try to run the executable wherever it is
$executable = Get-ChildItem -Path "build" -Recurse -Filter "RobotCPPSDLTest.exe" -ErrorAction SilentlyContinue |
Select-Object -First 1
if ($executable) {
Write-Host "Found executable at: $($executable.FullName)"
# Try to find and copy SDL2.dll
$sdl2Dll = Get-ChildItem -Path "vcpkg" -Recurse -Filter "SDL2.dll" -ErrorAction SilentlyContinue |
Select-Object -First 1
if ($sdl2Dll) {
Write-Host "Found SDL2.dll at: $($sdl2Dll.FullName)"
Copy-Item -Path $sdl2Dll.FullName -Destination $executable.DirectoryName -Force
}
# Run the executable
Write-Host "Running: $($executable.FullName) --gtest_filter=-*InteractiveMode --ci-mode true"
& $executable.FullName --gtest_filter=-*InteractiveMode --ci-mode true
} else {
Write-Host "Executable not found!"
exit 1
}