Skip to content

Commit d858449

Browse files
committed
Add Doxygen docs generation + CI workflow
1 parent c70202d commit d858449

File tree

5 files changed

+2900
-0
lines changed

5 files changed

+2900
-0
lines changed

.github/workflows/docs.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- 'Doxyfile'
8+
- 'include/**/*.hpp'
9+
- 'src/**/*.cpp'
10+
11+
jobs:
12+
generate-and-deploy:
13+
name: Build and Deploy Doxygen Docs
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up CMake + Doxygen dependencies
21+
run: |
22+
sudo apt update
23+
sudo apt install -y doxygen graphviz ninja-build
24+
25+
- name: Configure project with CMake Preset
26+
run: cmake --preset gcc-RelWithDebInfo
27+
28+
- name: Generate Doxygen documentation
29+
run: cmake --build --preset gcc-RelWithDebInfo --target doc_doxygen
30+
31+
- name: Deploy to GitHub Pages
32+
uses: peaceiris/actions-gh-pages@v3
33+
with:
34+
github_token: ${{ secrets.GITHUB_TOKEN }}
35+
publish_dir: build/gcc-RelWithDebInfo/docs/html
36+
publish_branch: gh-pages
37+
force_orphan: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@ conanbuildinfo.*
4848
# === CTest / testing output ===
4949
Testing/
5050
test_output/
51+
52+
# === Docs ===
53+
docs/

CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,22 @@ install(FILES
9191
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
9292
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
9393
)
94+
95+
# === Documentation ===
96+
find_package(Doxygen QUIET)
97+
98+
if(DOXYGEN_FOUND)
99+
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile)
100+
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.generated)
101+
102+
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
103+
104+
add_custom_target(doc_doxygen
105+
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
106+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
107+
COMMENT "Generating API documentation with Doxygen"
108+
VERBATIM
109+
)
110+
else()
111+
message(STATUS "Doxygen not found. 'doc_doxygen' target will not be available.")
112+
endif()

0 commit comments

Comments
 (0)