WIP: tests #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
run: | | |
brew install sdl2 | |
- name: Configure | |
run: | | |
mkdir build | |
cd build | |
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_HEADLESS_TESTS=ON | |
- name: Build | |
run: | | |
cd build | |
cmake --build . --config Release | |
- name: Run SDL tests in CI mode | |
run: | | |
cd build/bin | |
# macOS needs special handling for mouse automation in headless mode | |
# We'll use the CI mode flag we're adding to the test application | |
./RobotCPPSDLTest --ci-mode --run-tests | |
test-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
# Direct vcpkg installation without using the action | |
- name: Clone vcpkg | |
run: | | |
git clone https://github.com/Microsoft/vcpkg.git | |
cd vcpkg | |
git checkout 5568f110b509a9fd90711978a7cb76bae75bb092 | |
.\bootstrap-vcpkg.bat | |
shell: cmd | |
- name: Install SDL2 | |
run: | | |
.\vcpkg\vcpkg.exe install sdl2:x64-windows | |
shell: cmd | |
- name: Configure | |
shell: powershell | |
run: | | |
mkdir build | |
cd build | |
cmake .. -DCMAKE_TOOLCHAIN_FILE="$pwd\..\vcpkg\scripts\buildsystems\vcpkg.cmake" -DCMAKE_BUILD_TYPE=Release -DBUILD_HEADLESS_TESTS=ON | |
- name: Build | |
shell: powershell | |
run: | | |
cd build | |
cmake --build . --config Release | |
- name: Run SDL tests in CI mode | |
shell: powershell | |
run: | | |
cd build\bin\Release | |
.\RobotCPPSDLTest.exe --ci-mode --run-tests |