From b732d94c2da40e1e422f694cdd66d6efb2e55f67 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 27 Feb 2023 00:48:48 +0100 Subject: Added archlinux based pipelines config --- .gitlab-ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..fb3ec63 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,24 @@ +image: registry.gitlab.com/kurator1/kurator/archlinux-kurator + +build-linux: + stage: build + script: + - cmake -B build-linux/ . + - cmake --build build-linux/ + artifacts: + paths: + - build-linux/kurator/kurator + +build-windows: + stage: build + script: + - x86_64-w64-mingw32-cmake -B build-windows/ . + - cmake --build build-windows/ + artifacts: + paths: + - build-windows/kurator/kurator + +test-linux: + stage: test + script: + - cd build-linux/ && ctest -- cgit v1.1 From 5bcbde30cb6bece4e70e1711e953c4b051699f08 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 27 Feb 2023 00:59:09 +0100 Subject: Added windows tests since wine is needed anyway with current config --- .gitlab-ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb3ec63..0afe9ce 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,9 +16,14 @@ build-windows: - cmake --build build-windows/ artifacts: paths: - - build-windows/kurator/kurator + - build-windows/kurator/kurator.exe test-linux: stage: test script: - cd build-linux/ && ctest + +test-windows: + stage: test + script: + - cd build-windows/ && ctest -- cgit v1.1 From 6b25ce0013aec65eaca72968b4c43a84f9393ac7 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 27 Feb 2023 01:42:09 +0100 Subject: Added needs declarations for test jobs --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0afe9ce..fbbdcf5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,10 +20,12 @@ build-windows: test-linux: stage: test + needs: ["build-linux"] script: - cd build-linux/ && ctest test-windows: stage: test + needs: ["build-windows"] script: - cd build-windows/ && ctest -- cgit v1.1 From 279e2db7858f626a64421cf3975b734f0ae22a7e Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 27 Feb 2023 08:39:04 +0100 Subject: Increased test discovery timeout --- sim/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 +) -- cgit v1.1 From 847dc51888cd8869e93caa0d0507ccee8e8834cf Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 27 Feb 2023 08:39:55 +0100 Subject: Ensure wine prefix before tests to reduce tests execution time --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fbbdcf5..1ea33ed 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,5 +27,7 @@ test-linux: test-windows: stage: test needs: ["build-windows"] + before-script: + - x86_64-w64-mingw32-wine hostname script: - cd build-windows/ && ctest -- cgit v1.1 From 8f5aaf56ace8cbf1dd927561470653a2800f82af Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 27 Feb 2023 07:40:24 +0000 Subject: Fixed type before_script --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1ea33ed..f2c631a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,7 +27,7 @@ test-linux: test-windows: stage: test needs: ["build-windows"] - before-script: + before_script: - x86_64-w64-mingw32-wine hostname script: - cd build-windows/ && ctest -- cgit v1.1 From 60798d7c1fdf7cfca137f88a04477e4a6f69c6f8 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 27 Feb 2023 10:07:57 +0100 Subject: The entire build directory is an artifact --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f2c631a..52a1189 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ build-linux: - cmake --build build-linux/ artifacts: paths: - - build-linux/kurator/kurator + - build-linux/ build-windows: stage: build @@ -16,13 +16,13 @@ build-windows: - cmake --build build-windows/ artifacts: paths: - - build-windows/kurator/kurator.exe + - build-windows/ test-linux: stage: test needs: ["build-linux"] script: - - cd build-linux/ && ctest + - ctest --test-dir build-windows/ test-windows: stage: test @@ -30,4 +30,4 @@ test-windows: before_script: - x86_64-w64-mingw32-wine hostname script: - - cd build-windows/ && ctest + - ctest --test-dir build-windows/ -- cgit v1.1 From 1533e973c2f35d8fc12134057779a61ab1446d1c Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 27 Feb 2023 10:16:10 +0100 Subject: Added junit tests report --- .gitlab-ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52a1189..10c839e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,7 +22,10 @@ test-linux: stage: test needs: ["build-linux"] script: - - ctest --test-dir build-windows/ + - ctest --test-dir build-linux/ --output-junit junit.xml + artifacts: + reports: + junit: junit.xml test-windows: stage: test @@ -30,4 +33,7 @@ test-windows: before_script: - x86_64-w64-mingw32-wine hostname script: - - ctest --test-dir build-windows/ + - ctest --test-dir build-windows/ --output-junit junit.xml + artifacts: + reports: + junit: junit.xml -- cgit v1.1 From a471d2e3535482f3a49262db52dbbf85078f5bcf Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 27 Feb 2023 10:25:29 +0100 Subject: Ctest outputs to build dir no matter what --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 10c839e..8c9cdb6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,10 +22,10 @@ test-linux: stage: test needs: ["build-linux"] script: - - ctest --test-dir build-linux/ --output-junit junit.xml + - ctest --test-dir build-linux/ --output-junit linux.xml artifacts: reports: - junit: junit.xml + junit: build-linux/linux.xml test-windows: stage: test @@ -33,7 +33,7 @@ test-windows: before_script: - x86_64-w64-mingw32-wine hostname script: - - ctest --test-dir build-windows/ --output-junit junit.xml + - ctest --test-dir build-windows/ --output-junit windows.xml artifacts: reports: - junit: junit.xml + junit: build-windows/windows.xml -- cgit v1.1 From eb7b5585447d67099a1fc8382a0f05b07b609b49 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 27 Feb 2023 22:10:48 +0100 Subject: Added install targets for executable and resources --- CMakeLists.txt | 1 + cmake/modules/AddResources.cmake | 2 ++ kurator/CMakeLists.txt | 1 + 3 files changed, 4 insertions(+) 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) -- cgit v1.1 From b15688f34734754cbc53498f9dcd61bd1a0be89b Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 27 Feb 2023 22:22:51 +0100 Subject: Added packaging stage --- .gitlab-ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8c9cdb6..64830fd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,3 +37,24 @@ test-windows: artifacts: reports: junit: build-windows/windows.xml + +package-linux: + stage: package + needs: ["test-linux"] + script: + - cmake --install build-linux/ --prefix pkg + - cd pkg/ && tar cJf ../kurator-x86_64-linux.tar.xz * + artifacts: + paths: + - kurator-x86_64-linux.tar.xz + +package-windows: + stage: package + needs: ["test-windows"] + script: + - cmake --install build-windows/ --prefix pkg + - cp /usr/x86_64-w64-mingw32/bin/{libssp-0,libgcc_s_seh-1,libraylib,libstdc++-6,libwinpthread-1}.dll pkg/ + - cd pkg/ && tar cJf ../kurator-x86_64-windows.tar.xz * + artifacts: + paths: + - kurator-x86_64-windows.tar.xz -- cgit v1.1 From 40b66853beac564c02ffdf32e6f1f2e414a8dc4d Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 27 Feb 2023 21:23:44 +0000 Subject: Added package to top-level stages list --- .gitlab-ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 64830fd..9e02389 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,10 @@ image: registry.gitlab.com/kurator1/kurator/archlinux-kurator +stages: + - build + - test + - package + build-linux: stage: build script: -- cgit v1.1 From 59e5c6ab0b9e81d5c1e1c5f73a9a03df7daaba61 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 27 Feb 2023 21:31:26 +0000 Subject: Seems needs and artifacts are not recursive, try with explicit --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9e02389..c7f2d10 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,7 +45,7 @@ test-windows: package-linux: stage: package - needs: ["test-linux"] + needs: ["build-linux", "test-linux"] script: - cmake --install build-linux/ --prefix pkg - cd pkg/ && tar cJf ../kurator-x86_64-linux.tar.xz * @@ -55,7 +55,7 @@ package-linux: package-windows: stage: package - needs: ["test-windows"] + needs: ["build-windows", "test-windows"] script: - cmake --install build-windows/ --prefix pkg - cp /usr/x86_64-w64-mingw32/bin/{libssp-0,libgcc_s_seh-1,libraylib,libstdc++-6,libwinpthread-1}.dll pkg/ -- cgit v1.1 From fa116950ed55f55fac4fccffeb59412d75666125 Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 28 Feb 2023 20:02:43 +0000 Subject: Offloaded archiving the package to pipelines This feels a bit useless now yet it should be possible to use it later on for deploying way easier. --- .gitlab-ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c7f2d10..e503e69 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,19 +47,19 @@ package-linux: stage: package needs: ["build-linux", "test-linux"] script: - - cmake --install build-linux/ --prefix pkg - - cd pkg/ && tar cJf ../kurator-x86_64-linux.tar.xz * + - cmake --install build-linux/ --prefix kurator-x86_64-linux/ artifacts: + name: kurator-x86_64-linux paths: - - kurator-x86_64-linux.tar.xz + - kurator-x86_64-linux/ package-windows: stage: package needs: ["build-windows", "test-windows"] script: - - cmake --install build-windows/ --prefix pkg - - cp /usr/x86_64-w64-mingw32/bin/{libssp-0,libgcc_s_seh-1,libraylib,libstdc++-6,libwinpthread-1}.dll pkg/ - - cd pkg/ && tar cJf ../kurator-x86_64-windows.tar.xz * + - 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.tar.xz + - kurator-x86_64-windows/ -- cgit v1.1