Files
recastnavigation/.github/workflows/Tests.yaml
Graham Pentheny 3d0f0a3d9e Github Workflows based CI system to replace Appveyor and Travis (#580)
The goal here is to replace the current (slightly broken) Travis + Appveyor setup with something that covers more cases and is a bit better supported and easier to maintain. This hopefully helps us catch cross-platform issues quicker. For example, the linux and clang compilation issues that have existed for a while could have been caught if we were building those targets in CI.

This adds a build script that builds the following configurations for every repo commit and PR:

    macOS, premake, Debug
    macOS, premake, Release
    linux, premake, gcc, Debug
    linux, premake, gcc, Release
    linux, premake, clang, Debug
    linux, premake, clang, Release
    linux, cmake, Debug
    linux, cmake, Release
    windows, premake, vs2019, Debug
    windows, premake, vs2019, Release
    windows, premake, vs2022, Debug
    windows, premake, vs2022, Release
    windows, cmake, vs2019, Debug
    windows, cmake, vs2019, Release
    windows, cmake, vs2022, Debug
    windows, cmake, vs2022, Release

It also builds and runs the catch tests executable in the following configurations. A failed test will fail the build.

    macOS, premake, Debug
    linux, premake, clang, Debug
    windows, premake, vs2022, Debug

It doesn't currently build cmake on macOS because there is a one blocker there (#577). We could also add additional builds like cmake with both clang and gcc on linux, but for now this is much better coverage than we have currently.
2022-11-12 13:27:46 -05:00

107 lines
3.1 KiB
YAML

name: Tests
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
jobs:
macos-tests:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Download & install SDL
run: |
curl -L -o SDL2.dmg https://github.com/libsdl-org/SDL/releases/download/release-2.24.2/SDL2-2.24.2.dmg
hdiutil attach SDL2.dmg
cp -r /Volumes/SDL2/SDL2.framework RecastDemo/Bin
hdiutil detach /Volumes/SDL2
rm SDL2.dmg
- name: Download & install premake
working-directory: RecastDemo
run: |
curl -L -o premake.tar.gz https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-macosx.tar.gz
tar -xzf premake.tar.gz
rm premake.tar.gz
- name: Run premake
working-directory: RecastDemo
run: ./premake5 xcode4
- name: Build Unit Tests With Xcode
working-directory: RecastDemo/Build/xcode4/
run: xcodebuild -scheme Tests -configuration Debug -project Tests.xcodeproj build
- name: Run unit tests
working-directory: RecastDemo/Bin
run: ./Tests
linux-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install opengl and SDL
run: sudo apt-get install -y libgl1-mesa-dev libsdl2-dev
- name: Download & Install premake
working-directory: RecastDemo
run: |
curl -L -o premake.tar.gz https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-linux.tar.gz
tar -xzf premake.tar.gz
rm premake.tar.gz
- name: Run premake
working-directory: RecastDemo
run: ./premake5 --cc=clang gmake2
- name: Build
working-directory: RecastDemo/Build/gmake2
run: make config=debug verbose=true
- name: Run Tests
working-directory: RecastDemo/Bin
run: ./Tests
windows-tests:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: Download and Install SDL
working-directory: RecastDemo/Contrib
shell: pwsh
run: |
(new-object System.Net.WebClient).DownloadFile("https://github.com/libsdl-org/SDL/releases/download/release-2.24.2/SDL2-devel-2.24.2-VC.zip","${{github.workspace}}/RecastDemo/Contrib/SDL.zip")
tar -xf SDL.zip
ren SDL2-2.24.2 SDL
del SDL.zip
- name: Download and Install Premake
working-directory: RecastDemo
shell: pwsh
run: |
(new-object System.Net.WebClient).DownloadFile("https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-windows.zip","${{github.workspace}}/RecastDemo/premake.zip")
tar -xf premake.zip
del premake.zip
- name: Run Premake
working-directory: RecastDemo
run: ./premake5.exe vs2022
- name: Build
working-directory: RecastDemo/Build/vs2022
run: msbuild Tests.vcxproj -property:Configuration=Debug
- name: Run Tests
working-directory: RecastDemo/Bin/
run: ./Tests.exe