summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml65
-rw-r--r--CMakeLists.txt1
-rw-r--r--cmake/modules/AddResources.cmake2
-rw-r--r--kurator/CMakeLists.txt1
-rw-r--r--sim/CMakeLists.txt5
5 files changed, 73 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..e503e69
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,65 @@
+image: registry.gitlab.com/kurator1/kurator/archlinux-kurator
+
+stages:
+ - build
+ - test
+ - package
+
+build-linux:
+ stage: build
+ script:
+ - cmake -B build-linux/ .
+ - cmake --build build-linux/
+ artifacts:
+ paths:
+ - build-linux/
+
+build-windows:
+ stage: build
+ script:
+ - x86_64-w64-mingw32-cmake -B build-windows/ .
+ - cmake --build build-windows/
+ artifacts:
+ paths:
+ - build-windows/
+
+test-linux:
+ stage: test
+ needs: ["build-linux"]
+ script:
+ - ctest --test-dir build-linux/ --output-junit linux.xml
+ artifacts:
+ reports:
+ junit: build-linux/linux.xml
+
+test-windows:
+ stage: test
+ needs: ["build-windows"]
+ before_script:
+ - x86_64-w64-mingw32-wine hostname
+ script:
+ - ctest --test-dir build-windows/ --output-junit windows.xml
+ artifacts:
+ reports:
+ junit: build-windows/windows.xml
+
+package-linux:
+ stage: package
+ needs: ["build-linux", "test-linux"]
+ script:
+ - cmake --install build-linux/ --prefix kurator-x86_64-linux/
+ artifacts:
+ name: kurator-x86_64-linux
+ paths:
+ - kurator-x86_64-linux/
+
+package-windows:
+ stage: package
+ needs: ["build-windows", "test-windows"]
+ script:
+ - cmake --install build-windows/ --prefix kurator-x86_64-windows/
+ - cp /usr/x86_64-w64-mingw32/bin/{libssp-0,libgcc_s_seh-1,libraylib,libstdc++-6,libwinpthread-1}.dll kurator-x86_64-windows/
+ artifacts:
+ name: kurator-x86_64-windows
+ paths:
+ - kurator-x86_64-windows/
diff --git a/CMakeLists.txt b/CMakeLists.txt
index da56f8d..bebfbbf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS No)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -D_USE_MATH_DEFINES")
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
+set(CMAKE_INSTALL_BINDIR .)
enable_testing()
find_package(EnTT 3 REQUIRED)
find_package(GTest 1 REQUIRED)
diff --git a/cmake/modules/AddResources.cmake b/cmake/modules/AddResources.cmake
index b59258e..227e710 100644
--- a/cmake/modules/AddResources.cmake
+++ b/cmake/modules/AddResources.cmake
@@ -19,6 +19,8 @@ function(add_resources RESOURCES_TARGET)
"${RESOURCES_PREFIX}/${RESOURCES_SOURCE}"
COMMENT "Moving ${RESOURCES_SOURCE}"
)
+ cmake_path(GET RESOURCES_SOURCE PARENT_PATH PARENT)
+ install(FILES ${RESOURCES_SOURCE} DESTINATION ${PARENT})
endforeach()
list(TRANSFORM RESOURCES_FILES PREPEND "${RESOURCES_PREFIX}/")
add_custom_target(
diff --git a/kurator/CMakeLists.txt b/kurator/CMakeLists.txt
index b97a8b5..1465ba3 100644
--- a/kurator/CMakeLists.txt
+++ b/kurator/CMakeLists.txt
@@ -36,3 +36,4 @@ target_sources(
${PROJECT_NAME}
PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/version.cpp"
)
+install(TARGETS ${PROJECT_NAME} RUNTIME)
diff --git a/sim/CMakeLists.txt b/sim/CMakeLists.txt
index a0a4d00..9713d96 100644
--- a/sim/CMakeLists.txt
+++ b/sim/CMakeLists.txt
@@ -33,4 +33,7 @@ target_link_libraries(
PRIVATE GTest::gtest_main
PRIVATE universe
)
-gtest_discover_tests(${PROJECT_NAME}_test)
+gtest_discover_tests(
+ ${PROJECT_NAME}_test
+ DISCOVERY_TIMEOUT 60
+)