Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doxygen: Build documentation and host on GitHub Pages #128

Merged
merged 2 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CMake

on:
push:
branches: [ "main" ]

permissions:
contents: read
pages: write
id-token: write

jobs:
documenation:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- name: Install Doxygen
run: sudo apt-get install -y doxygen graphviz

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12

- name: Generate Documentation
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config Debug --target docs

- name: Upload GitHub Pages artifact
uses: actions/[email protected]
with:
path: ${{github.workspace}}/build/docs

- name: Deploy artifact
uses: actions/deploy-pages@v4
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,24 @@ endif()
include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
include(CPack)

# Add documentation option
option(BUILD_DOC "Build documentation" ON)

# Check if Doxygen is installed
find_package(Doxygen OPTIONAL_COMPONENTS dot dia)
if (DOXYGEN_FOUND)
set(DOXYGEN_HTML_OUTPUT docs)
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE README.md)

message("Doxygen build started")

doxygen_add_docs(
docs
include
README.md
COMMENT "Generate docs"
)
else (DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ This library currently supports:

* Engine Library, as used on "Prime"-series DJ equipment.

Documentation can be viewed on [GitHub Pages](https://xsco.github.io/libdjinterop/)

State of Support
================

Expand Down
Loading