MushMachine/.github/workflows/cmake.yml

164 lines
4.4 KiB
YAML
Raw Normal View History

name: CMake
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
2023-03-04 19:14:26 +01:00
EM_VERSION: 3.1.32
2022-10-30 15:59:13 +01:00
EM_CACHE_FOLDER: 'emsdk-cache'
jobs:
linux:
timeout-minutes: 15
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
2022-10-27 17:18:27 +02:00
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies
2022-11-07 01:28:54 +01:00
run: sudo apt update && sudo apt -y install libsdl2-dev xserver-xorg-video-dummy
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4
2022-11-07 01:28:54 +01:00
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
#run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure
2022-11-07 01:28:54 +01:00
# TODO: look into xinit
env:
DISPLAY: :0
run: |
sudo Xorg :0 -config ${{github.workspace}}/.github/workflows/x/dummy-1920x1080.conf -noautoBindGPU &
sleep 20s
ctest --output-on-failure --timeout 20
sudo pkill -15 Xorg
2022-02-19 00:59:07 +01:00
linux_gles:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
2022-10-27 17:18:27 +02:00
- uses: actions/checkout@v3
2022-02-19 00:59:07 +01:00
with:
submodules: recursive
- name: Install Dependencies
run: sudo apt update && sudo apt -y install libsdl2-dev
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMM_OPENGL_3_GLES=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4
2022-08-11 15:48:51 +02:00
linux_tracy:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
2022-10-27 17:18:27 +02:00
- uses: actions/checkout@v3
2022-08-11 15:48:51 +02:00
with:
submodules: recursive
- name: Install Dependencies
run: sudo apt update && sudo apt -y install libsdl2-dev
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTRACY_ENABLE=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4
2022-10-30 15:59:13 +01:00
emscripten:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v11
with:
# Make sure to set a version number!
version: ${{env.EM_VERSION}}
# This is the name of the cache folder.
# The cache folder will be placed in the build directory,
# so make sure it doesn't conflict with anything!
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
- name: Verify
run: emcc --check
- name: Configure CMake
run: emcmake cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMM_OPENGL_3_GLES=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4
2022-02-10 23:44:14 +01:00
macos:
timeout-minutes: 10
runs-on: macos-latest
steps:
2022-10-27 17:18:27 +02:00
- uses: actions/checkout@v3
2022-02-10 23:44:14 +01:00
with:
submodules: recursive
- name: Install Dependencies
run: brew install sdl2
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4
2022-10-31 22:57:11 +01:00
windows:
2022-11-01 19:01:09 +01:00
timeout-minutes: 15 # TODO: caching
2022-10-31 22:57:11 +01:00
runs-on: windows-latest
2022-10-31 22:57:11 +01:00
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
2022-10-31 22:57:11 +01:00
# TODO: cache
- name: Install Dependencies
run: vcpkg install sdl2[core,vulkan]:x64-windows
2022-10-31 22:57:11 +01:00
# setup vs env
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
2022-10-31 22:57:11 +01:00
- name: Configure CMake
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
2022-10-31 22:57:11 +01:00
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4