From 883964ede95fb3099d3a2403e0338bed1c10ded1 Mon Sep 17 00:00:00 2001 From: Zijian Lyu Date: Sat, 30 Dec 2023 21:59:41 +0800 Subject: [PATCH] Add actions workflow (#2) --- .github/workflows/build&test.yml | 31 ++++++++++++++++++++++++++++ src/GameX/application/CMakeLists.txt | 2 +- src/GameX/physics/world.cpp | 2 +- src/GameX/renderer/CMakeLists.txt | 2 +- 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build&test.yml diff --git a/.github/workflows/build&test.yml b/.github/workflows/build&test.yml new file mode 100644 index 0000000..0bb790c --- /dev/null +++ b/.github/workflows/build&test.yml @@ -0,0 +1,31 @@ +# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml +name: CMake Build and Test + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +jobs: + build: + runs-on: [self-hosted, Linux, Vulkan] + + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Configure CMake Clang Debug + run: cmake -G "Ninja" -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang-14 -DCMAKE_CXX_COMPILER=clang++-14 + + - name: Build Clang Debug + run: cmake --build ${{github.workspace}}/build -j + + - name: Run Tests + run: ${{github.workspace}}/build/test/GameXTest diff --git a/src/GameX/application/CMakeLists.txt b/src/GameX/application/CMakeLists.txt index f85baae..6238a37 100644 --- a/src/GameX/application/CMakeLists.txt +++ b/src/GameX/application/CMakeLists.txt @@ -5,7 +5,7 @@ file(GLOB_RECURSE SOURCES *.cpp *.h) add_library(${LIB_NAME} ${SOURCES}) target_include_directories(${LIB_NAME} PUBLIC ${COMMON_INCLUDE_DIRS}) -target_link_libraries(${LIB_NAME} PUBLIC grassland) +target_link_libraries(${LIB_NAME} PUBLIC grassland GameXRenderer) list(APPEND GAMEX_LIBS ${LIB_NAME}) set(GAMEX_LIBS ${GAMEX_LIBS} PARENT_SCOPE) diff --git a/src/GameX/physics/world.cpp b/src/GameX/physics/world.cpp index dd7209f..6a68a67 100644 --- a/src/GameX/physics/world.cpp +++ b/src/GameX/physics/world.cpp @@ -4,7 +4,7 @@ #include #include -#include "Gamex/physics/collision.h" +#include "GameX/physics/collision.h" namespace GameX::Physics { World::World() { diff --git a/src/GameX/renderer/CMakeLists.txt b/src/GameX/renderer/CMakeLists.txt index 7de64e8..1d011e6 100644 --- a/src/GameX/renderer/CMakeLists.txt +++ b/src/GameX/renderer/CMakeLists.txt @@ -5,7 +5,7 @@ file(GLOB_RECURSE SOURCES *.cpp *.h) add_library(${LIB_NAME} ${SOURCES}) target_include_directories(${LIB_NAME} PUBLIC ${COMMON_INCLUDE_DIRS}) -target_link_libraries(${LIB_NAME} PUBLIC grassland GameXShaders) +target_link_libraries(${LIB_NAME} PUBLIC grassland GameXShaders GameXUtils) list(APPEND GAMEX_LIBS ${LIB_NAME}) set(GAMEX_LIBS ${GAMEX_LIBS} PARENT_SCOPE)