basic e2e test framework #3
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: Robot CPP Tests | |
| 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 cmake sdl2 | |
| - name: Configure | |
| run: cmake -B build | |
| - name: Build | |
| run: cmake --build build | |
| - name: Test | |
| run: | | |
| # macOS can run GUI apps in headless mode | |
| build/bin/RobotCPPSDLTest --gtest_filter=-*InteractiveMode --ci-mode true | |
| # Note: Windows tests can be unstable in CI | |
| 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" | |
| - name: Build | |
| run: cmake --build build --config Release | |
| - name: Test | |
| run: build/bin/Release/RobotCPPSDLTest.exe --gtest_filter=-*InteractiveMode --ci-mode true |