Improve Pipeline & Misc Improvements (#12)

* split pipeline

* add dedicated doc build step

* parallel builds

* fix permissions

* rm push trigger

* mv gcc ubuntu

* add windows build

* always build the docs

* doc alignment

* checkout recursive

* depend on builds for documentation

* set standard via cmake

* update libCZI to main

* pretty_function win32

* version history update

* disable windows release build

missing dependencies for doc generation

trigger ci on push to main

adapt doc-gen job require only doxygen
This commit is contained in:
m-aXimilian
2025-10-07 17:11:43 +02:00
committed by Maximilian Kueffner
parent fec5c08aaa
commit b1923a490c
9 changed files with 170 additions and 64 deletions
+33
View File
@@ -0,0 +1,33 @@
name: build-ubuntu
on:
workflow_dispatch:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
configuration: [Debug, Release]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: setup
run: |
sudo apt update
sudo apt -y install libopencv-dev libglfw3 libglfw3-dev libxkbcommon-dev libxinerama-dev libxcursor-dev libxi-dev doxygen graphviz
- name: Configure Ubuntu
run: cmake -B ${{github.workspace}}/build/gcc-${{ matrix.configuration }} -S . -DCMAKE_BUILD_TYPE=${{ matrix.configuration }}
- name: Build Ubuntu
run: cmake --build ${{github.workspace}}/build/gcc-${{ matrix.configuration }} --config ${{ matrix.configuration }} -- -j 10
- name: Test Ubuntu
run: |
cd ${{github.workspace}}/build/gcc-${{ matrix.configuration }}
ctest -C ${{ matrix.configuration }}
+43
View File
@@ -0,0 +1,43 @@
name: build-windows
on:
workflow_dispatch:
workflow_call:
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
configuration: [Debug]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Cacke vcpkg
uses: actions/cache@v3
with:
path: 'C:/vcpkg/installed'
key: vcpkg-x64-windows-${{ matrix.configuration }}
restore-keys: |
vcpkg-x64-windows-${{ matrix.configuration }}
- name: Install OpenCV vcpkg
run: |
vcpkg install opencv[core]:x64-windows-static
- name: Set PATH for vcpkg
run: echo "PATH=C:/vcpkg/installed/x64-windows/bin:${{ env.PATH }}" >> $GITHUB_ENV
- name: Configure Windows
run: cmake -B ${{github.workspace}}/build/msvc-${{ matrix.configuration }} -S . -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static
- name: Build Windows
run: cmake --build ${{github.workspace}}/build/msvc-${{ matrix.configuration }} --config ${{ matrix.configuration }} -j 10
- name: Test Windows
run: |
cd ${{github.workspace}}/build/msvc-${{ matrix.configuration }}
ctest -C ${{ matrix.configuration }}
+25
View File
@@ -0,0 +1,25 @@
name: CI Workflow
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build-ubuntu:
uses: ./.github/workflows/build-ubuntu.yml
build-windows:
uses: ./.github/workflows/build-windows.yml
generate-docs:
permissions:
id-token: write
pages: write
uses: ./.github/workflows/generate-docs.yml
if: github.ref == 'refs/heads/main'
needs:
- build-ubuntu
- build-windows
@@ -1,40 +1,33 @@
name: C/C++ CI name: generate-docs
on: on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch: workflow_dispatch:
workflow_call:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: setup - name: setup
run: | run: |
sudo apt update sudo apt update
sudo apt -y install libopencv-dev libglfw3 libglfw3-dev libxkbcommon-dev libxinerama-dev libxcursor-dev libxi-dev doxygen graphviz sudo apt -y install doxygen graphviz
- name: configure
run: cmake --preset gcc-debug
- name: build
run: cmake --build build --preset gcc-debug
- name: test
run: |
cd ${{github.workspace}}/build/gcc-debug
ctest -C Debug
- name: Upload static files as artifact - name: Generate Documentation
run: |
cmake -S . -B build -DPIXELARIUM_BUILD_DOCS_ONLY=ON
cmake --build build
- name: Upload Documentation Files as Artifacts
id: deployment id: deployment
uses: actions/upload-pages-artifact@v3 uses: actions/upload-pages-artifact@v3
with: with:
path: ${{github.workspace}}/build/gcc-debug/doc/html path: ${{github.workspace}}/build/doc/html
# Deployment job
deploy: deploy:
environment: environment:
name: github-pages name: github-pages
+43 -32
View File
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.23) cmake_minimum_required(VERSION 3.23)
project(pixelarium VERSION 0.0.5) project(pixelarium VERSION 0.0.6)
set(CMAKE_VERBOSE_MAKEFILE ON) set(CMAKE_VERBOSE_MAKEFILE ON)
set(CXX_STANDARD 23) set(CMAKE_CXX_STANDARD 23)
set(CXX_STANDARD_REQUIRED true) set(CMAKE_CXX_STANDARD_REQUIRED true)
# setting global module directories # setting global module directories
set(glfw3_module_DIR ${PROJECT_SOURCE_DIR}/modules/glfw) set(glfw3_module_DIR ${PROJECT_SOURCE_DIR}/modules/glfw)
@@ -13,28 +13,61 @@ set(imgui_DIR ${PROJECT_SOURCE_DIR}/modules/imgui)
set(pfd_DIR ${PROJECT_SOURCE_DIR}/modules/portable-file-dialogs) set(pfd_DIR ${PROJECT_SOURCE_DIR}/modules/portable-file-dialogs)
set(spdlog_DIR ${PROJECT_SOURCE_DIR}/modules/spdlog) set(spdlog_DIR ${PROJECT_SOURCE_DIR}/modules/spdlog)
find_package(OpenGL REQUIRED)
message(STATUS "GLFW:\t" ${glfw3_module_DIR}) message(STATUS "GLFW:\t" ${glfw3_module_DIR})
message(STATUS "PFD:\t\t" ${pfd_DIR}) message(STATUS "PFD:\t\t" ${pfd_DIR})
message(STATUS "SPDLOG:\t" ${spdlog_DIR}) message(STATUS "SPDLOG:\t" ${spdlog_DIR})
#==================== #====================
# Options # Options
option(PIXELARIUM_BUILD_UNITTESTS "Generate Unittests" ON) option(PIXELARIUM_BUILD_UNITTESTS "Generate Unittests" ON)
option(PIXELARIUM_BUILD_DOCS "Generate Documentation" ON) option(PIXELARIUM_BUILD_DOCS "Generate Documentation" ON)
option(PIXELARIUM_BUILD_DOCS_ONLY "Build only Documentation (no compilatoin)" OFF)
#==================== #====================
if(PIXELARIUM_BUILD_DOCS OR PIXELARIUM_BUILD_DOCS_ONLY)
include(${PROJECT_SOURCE_DIR}/cmake/awesomeDoxygen.cmake)
set(MAINPAGE_FILE "doc/index.md")
find_package(Doxygen)
if (DOXYGEN_FOUND)
set(DOXYGEN_IN ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_BINARY_DIR}/Doxyfile)
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message(STATUS "Building Docs")
add_custom_target(doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Generating Docs")
else (DOXYGEN_FOUND)
message(FATAL_ERROR "Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)
if(PIXELARIUM_BUILD_DOCS_ONLY)
message(STATUS "Documentation Generated successful")
list(APPEND CMAKE_MESSAGE_INDENT " ")
message(STATUS "PIXELARIUM_BUILD_DOCS_ONLY was set to ON. Thus, no compilation will follow.")
message(STATUS "If compilation shall occur, set '-DPIXELARIUM_BUILD_DOCS_ONLY=OFF'.")
list(POP_BACK CMAKE_MESSAGE_INDENT)
return()
endif()
endif()
find_package(OpenGL REQUIRED)
if(WIN32) if(WIN32)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "/std:c++23 /Zi /EHsc") set(CMAKE_CXX_FLAGS "/Zi /EHsc")
else() else()
set(CMAKE_CXX_FLAGS "-Wall -Wextra -g --std=c++23") set(CMAKE_CXX_FLAGS "-Wall -Wextra -g")
endif() endif()
endif() endif()
if(UNIX) if(UNIX)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -g --std=c++23") set(CMAKE_CXX_FLAGS "-Wall -Wextra -g")
endif() endif()
string(TOUPPER "${CMAKE_PROJECT_NAME}" PIXELARIUM_TITLE) string(TOUPPER "${CMAKE_PROJECT_NAME}" PIXELARIUM_TITLE)
@@ -78,25 +111,3 @@ if(PIXELARIUM_BUILD_UNITTESTS)
enable_testing() enable_testing()
add_subdirectory(tests) add_subdirectory(tests)
endif() endif()
if(PIXELARIUM_BUILD_DOCS)
include(${PROJECT_SOURCE_DIR}/cmake/awesomeDoxygen.cmake)
set(MAINPAGE_FILE "doc/index.md")
find_package(Doxygen)
if (DOXYGEN_FOUND)
set(DOXYGEN_IN ${PROJECT_SOURCE_DIR}/doc/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_BINARY_DIR}/Doxyfile)
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message(STATUS "Building Docs")
add_custom_target(doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Generating Docs")
else (DOXYGEN_FOUND)
message(FATAL_ERROR "Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)
endif()
+3 -3
View File
@@ -16,7 +16,8 @@
"FETCHCONTENT_FULLY_DISCONNECTED": "OFF", "FETCHCONTENT_FULLY_DISCONNECTED": "OFF",
"CMAKE_VERBOSE_MAKEFILE": "ON", "CMAKE_VERBOSE_MAKEFILE": "ON",
"PIXELARIUM_BUILD_UNITTESTS": "ON", "PIXELARIUM_BUILD_UNITTESTS": "ON",
"PIXELARIUM_BUILD_DOCS": "OFF" "PIXELARIUM_BUILD_DOCS": "OFF",
"PIXELARIUM_BUILD_DOCS_ONLY": "OFF"
} }
}, },
{ {
@@ -52,8 +53,7 @@
"cacheVariables": { "cacheVariables": {
"CMAKE_C_COMPILER": "gcc", "CMAKE_C_COMPILER": "gcc",
"CMAKE_CXX_COMPILER": "g++", "CMAKE_CXX_COMPILER": "g++",
"CMAKE_BUILD_TYPE": "Debug", "CMAKE_BUILD_TYPE": "Debug"
"PIXELARIUM_BUILD_DOCS": "ON"
} }
} }
], ],
+2 -1
View File
@@ -3,7 +3,7 @@ include(FetchContent)
FetchContent_Declare( FetchContent_Declare(
libCZI libCZI
GIT_REPOSITORY https://github.com/ZEISS/libczi.git GIT_REPOSITORY https://github.com/ZEISS/libczi.git
GIT_TAG 593ee17587214358c535bd036473b1b62945e637 GIT_TAG main
) )
if(NOT libCZI_POPULATED) if(NOT libCZI_POPULATED)
@@ -13,6 +13,7 @@ if(NOT libCZI_POPULATED)
set(LIBCZI_BUILD_CZICMD OFF CACHE BOOL "" FORCE) set(LIBCZI_BUILD_CZICMD OFF CACHE BOOL "" FORCE)
set(LIBCZI_BUILD_DYNLIB OFF CACHE BOOL "" FORCE) set(LIBCZI_BUILD_DYNLIB OFF CACHE BOOL "" FORCE)
set(LIBCZI_BUILD_UNITTESTS OFF CACHE BOOL "" FORCE) set(LIBCZI_BUILD_UNITTESTS OFF CACHE BOOL "" FORCE)
set(LIBCZI_BUILD_PREFER_EXTERNALPACKAGE_RAPIDJSON OFF CACHE BOOL "" FORCE)
set(LIBCZI_DO_NOT_SET_MSVC_RUNTIME_LIBRARY ON CACHE BOOL "" FORCE) set(LIBCZI_DO_NOT_SET_MSVC_RUNTIME_LIBRARY ON CACHE BOOL "" FORCE)
endif() endif()
+9 -8
View File
@@ -1,11 +1,12 @@
# Version History # Version History
| Version | Description | | Version | Description |
|:-------:|:------------------------------------------------------------------------| |:-------:|:------------------------------------------------------------------------------------------------------------|
| 0.0.5 | Compile for C++23 and code style adaptions | | 0.0.6 | Added documentation-only option `PIXELARIUM_BUILD_DOCS_ONLY`, libCZI upgrade to main branch CI improvements |
| 0.0.4 | Fix MSVC build, some cosmetics, explicit initial window size for images | | 0.0.5 | Compile for C++23 and code style adaptions |
| 0.0.3 | Fetch subblocks based on the dimension selection sliders | | 0.0.4 | Fix MSVC build, some cosmetics, explicit initial window size for images |
| 0.0.2 | Add Dimension selector sliders to CZI image view | | 0.0.3 | Fetch subblocks based on the dimension selection sliders |
| 0.0.1 | Initiate CZI image view | | 0.0.2 | Add Dimension selector sliders to CZI image view |
| 0.0.0 | Initial version | | 0.0.1 | Initiate CZI image view |
| 0.0.0 | Initial version |
+1 -2
View File
@@ -1,11 +1,10 @@
#pragma once #pragma once
#include <string> #include <string>
#ifdef WIN32 #ifdef _WIN32
#define __PRETTY_FUNCTION__ __FUNCTION__ #define __PRETTY_FUNCTION__ __FUNCTION__
#endif #endif
namespace pixelarium::utils::log namespace pixelarium::utils::log
{ {
enum class LogLevel enum class LogLevel