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

generate code docs with Doxygen #80

Merged
merged 5 commits into from
Apr 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
49 changes: 49 additions & 0 deletions .github/workflows/c-gen-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: C publish Doxygen

on:
workflow_dispatch:

jobs:
build_docs_and_publish:
name: kuliya - latest
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get Conan
uses: turtlebrowser/get-conan@v1.2

- name: Create default profile
run: conan profile detect --force

- name: Install dependencies
run: |
cd c
conan install . --output-folder=build --build=missing

- name: Set up build environment
run: |
cd c/build
sh conanbuild.sh
cmake .. -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release

- name: Build and run build script
run: |
cd c/build
make build
cd ..
./build/build

- name: Build docs with Doxygen
uses: mattnotmitt/doxygen-action@v1.9.5
with:
working-directory: 'c/'
doxyfile-path: 'Doxyfile'

- name: Publish to GitHub Pages
if: success()
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./c/docs/html
2 changes: 2 additions & 0 deletions c/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
build/
CMakeUserPresets.json
docs/
data.h
13 changes: 11 additions & 2 deletions c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ include_directories(helpers)
# Add the helpers subdirectory
add_subdirectory(helpers)

# Create the build executable
add_executable(build build.c)

# Add a custom target that depends on the 'build' target
add_custom_target(run_build
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/build
DEPENDS build
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Running build executable"
)

# Create the shared library "kuliya"
add_library(kuliya SHARED kuliya.h)

Expand All @@ -20,8 +31,6 @@ add_executable(test test/test.c)
add_executable(example example/main.c)
add_executable(example2 example/main.cpp)

# Create the build executable
add_executable(build build.c)

# Link the test and example executables with the "kuliya" library
target_link_libraries(test kuliya)
Expand Down
Loading