⬆ [ImGuiNotify] #874
This file contains 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: Build and run tests | |
on: | |
push: | |
branches: [main] | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
branches: [main] | |
env: | |
cmake_configure_args: -D WARNINGS_AS_ERRORS_FOR_COOL=ON | |
cmakelists_folder: tests | |
cmake_target: Tests-Cool | |
jobs: | |
build-and-run-tests: | |
name: ${{matrix.config.name}} ${{matrix.build_type}} | |
runs-on: ${{matrix.config.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: Windows MSVC, | |
os: windows-latest, | |
cmake_configure_args: -D CMAKE_C_COMPILER=cl CMAKE_CXX_COMPILER=cl, | |
} | |
- { | |
name: Windows Clang, | |
os: windows-latest, | |
cmake_configure_args: -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang, | |
} | |
- { | |
name: Linux Clang, | |
os: ubuntu-latest, | |
cmake_configure_args: -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++, | |
} | |
- { | |
name: Linux GCC, | |
os: ubuntu-latest, | |
cmake_configure_args: -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++, | |
} | |
- { | |
name: MacOS Clang, | |
os: macos-latest, | |
cmake_configure_args: -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++, | |
} | |
build_type: | |
- Debug | |
- Release | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: mjp41/workaround8649@c8550b715ccdc17f89c8d5c28d7a48eeff9c94a8 # Temporary workaround for Linux Clang not working atm. See https://github.com/actions/runner-images/issues/8659 | |
with: | |
os: ${{ matrix.config.os }} | |
- name: Set up MSVC # NOTE: required to find cl.exe and clang.exe when using the Ninja generator. And we need to use Ninja in order for ccache to be able to cache stuff on Windows. | |
if: runner.os == 'Windows' && matrix.config.name != 'Windows GCC' | |
uses: ilammy/[email protected] | |
- name: Install Linux dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev mesa-common-dev build-essential libgtk-3-dev | |
sudo apt-get install -y libpulse-dev libasound2-dev | |
sudo apt-get install -y libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libpostproc-dev libswresample-dev libswscale-dev | |
sudo apt-get install -y libdbus-1-dev | |
- name: Install MacOS dependencies | |
if: runner.os == 'MacOS' | |
run: brew install ffmpeg | |
- name: ccache | |
uses: hendrikmuhs/ccache-action@main | |
with: | |
key: ${{matrix.config.name}}-${{matrix.build_type}} | |
- name: Build | |
uses: lukka/run-cmake@v3 | |
with: | |
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced | |
cmakeListsTxtPath: ${{github.workspace}}/${{env.cmakelists_folder}}/CMakeLists.txt | |
cmakeAppendedArgs: ${{env.cmake_configure_args}} -G Ninja -D CMAKE_BUILD_TYPE=${{matrix.build_type}} ${{matrix.config.cmake_configure_args}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache | |
buildWithCMakeArgs: --config ${{matrix.build_type}} --target ${{env.cmake_target}} | |
cmakeBuildType: ${{matrix.build_type}} | |
buildDirectory: ${{github.workspace}}/build | |
- name: Run | |
run: ${{github.workspace}}/tests/bin/${{matrix.build_type}}/${{env.cmake_target}} |