-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (65 loc) · 2.26 KB
/
ci-windows.yml
File metadata and controls
74 lines (65 loc) · 2.26 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
name: Windows
on:
push:
branches: [ main, refactor/dod_ecs ]
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
branches: [ main, refactor/dod_ecs ]
jobs:
build-and-test:
name: ${{ matrix.name }}
runs-on: windows-latest
if: github.event.pull_request.draft == false || github.event_name == 'push'
strategy:
fail-fast: false
matrix:
include:
# Windows with MSVC
- name: "Windows MSVC"
compiler: msvc
cmake-generator: 'Visual Studio 17 2022'
cmake-options: '-DGAMECOE_USE_TESTCOE=ON'
# Windows with MinGW (GCC)
- name: "Windows MinGW"
compiler: gcc
cmake-generator: 'MinGW Makefiles'
cmake-options: '-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DGAMECOE_USE_TESTCOE=ON'
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Install Windows build tools
if: matrix.compiler != 'msvc'
run: |
if [ "${{ matrix.compiler }}" == "clang" ]; then
choco install ninja
elif [ "${{ matrix.compiler }}" == "gcc" ]; then
choco install mingw
fi
shell: bash
- name: Configure CMake
run: |
cmake -B build -G "${{ matrix.cmake-generator }}" ${{ matrix.cmake-options }}
- name: Build
run: |
cmake --build build --config Release
- name: Run tests
working-directory: build
run: |
if [ "${{ matrix.compiler }}" == "gcc" ]; then
# For MinGW - copy DLLs directly (no PATH manipulation)
GCC_DIR=$(dirname $(which gcc))
echo "GCC directory: $GCC_DIR"
echo "Copying DLLs from $GCC_DIR"
cp "$GCC_DIR"/libgcc*.dll tests/ 2>/dev/null || echo "No libgcc DLLs found"
cp "$GCC_DIR"/libstdc*.dll tests/ 2>/dev/null || echo "No libstdc DLLs found"
cp "$GCC_DIR"/libwinpthread*.dll tests/ 2>/dev/null || echo "No libwinpthread DLLs found"
echo "Running gamecoe tests"
cd tests
./gamecoe_tests.exe
else # MSVC
echo "Running gamecoe tests"
./tests/Release/gamecoe_tests.exe
fi
shell: bash