Skip to content

Commit 2b8baca

Browse files
committed
update actions
1 parent 1e82631 commit 2b8baca

2 files changed

Lines changed: 18 additions & 8 deletions

File tree

.github/workflows/test.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
os: [windows-latest, ubuntu-latest]
11+
os: [windows-latest, ubuntu-latest, macos-latest]
1212
include:
1313
- os: windows-latest
1414
preset: 'x64-release'
15-
binary: '.\out\build\x64-release\src\tests\tests.exe'
15+
binary_ext: '.exe'
1616
- os: ubuntu-latest
1717
preset: 'linux-debug'
18-
binary: './out/build/linux-debug/src/tests/tests'
1918
install_opengl: true
19+
- os: macos-latest
20+
preset: 'macos-debug'
2021

2122
steps:
2223
- name: Checkout
@@ -25,13 +26,18 @@ jobs:
2526
- name: Install openGL
2627
if: ${{ matrix.install_opengl }}
2728
run: |
29+
sudo apt-get update
2830
sudo apt-get install libxmu-dev libxi-dev libgl-dev
2931
sudo apt install libxinerama-dev libxcursor-dev xorg-dev libglu1-mesa-dev pkg-config
3032
sudo apt install libxrandr-dev
3133
3234
- uses: ilammy/[email protected]
3335

3436
- uses: lukka/get-cmake@latest
37+
with:
38+
cmakeVersion: "~3.31.0" # use most recent 3.31.x version
39+
40+
3541
- name: Run vcpkg
3642
uses: lukka/[email protected]
3743
with:
@@ -43,11 +49,11 @@ jobs:
4349
configurePreset: ${{ matrix.preset }}
4450

4551
- name: Compile
46-
run: |
47-
cd './out/build/${{ matrix.preset }}'
48-
ninja
52+
working-directory: ./out/build/${{ matrix.preset }}
53+
run: ninja
4954

5055
- name: Run Tests
56+
working-directory: ./out/build/${{ matrix.preset }}/src/tests
5157
timeout-minutes: 5
52-
run: ${{ matrix.binary }}
58+
run: ./tests${{ matrix.binary_ext }}
5359

src/tests/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,8 @@ target_link_libraries(tests PUBLIC GTest::gmock_main GTest::gtest)
3535
include(GoogleTest)
3636
gtest_discover_tests(tests)
3737

38-
file(COPY ./../../test_data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
38+
add_custom_command(
39+
TARGET tests
40+
POST_BUILD
41+
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/test_data" "${CMAKE_CURRENT_BINARY_DIR}"
42+
)

0 commit comments

Comments
 (0)