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

Add a GitHub action to upload API documentation to a webpage #137

Merged
merged 14 commits into from
May 18, 2024
Merged
55 changes: 55 additions & 0 deletions .github/workflows/update_documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Generate and Deploy Doxygen Documentation

on:
push:
branches:
- master

workflow_dispatch: # Allow manual triggering

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake doxygen graphviz libboost-all-dev libeigen3-dev

- name: Configure and Build Project
run: |
mkdir build
cd build
cmake ..
make doc

- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./build/doc/html
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v2

# Deployment job
deploy:
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
16 changes: 11 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ project("lib${LIB_NAME}")

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})

# Extract version from header
file(READ "nabo/nabo.h" NABO_HEADER_CONTENT)
string(REGEX MATCH "#define NABO_VERSION \"([0-9]+\.[0-9]+\.[0-9]+)\"" _ ${NABO_HEADER_CONTENT})
set(PROJECT_VERSION ${CMAKE_MATCH_1})
message(STATUS ${PROJECT_VERSION})
## Extract version from package.xml
file(READ "package.xml" PACKAGE_XML_CONTENT)
string(REGEX MATCH "<version>([^<]+)</version>" VERSION_MATCH ${PACKAGE_XML_CONTENT})
# Extract the matched version from the captured group
if(VERSION_MATCH)
# CMake variable ${CMAKE_MATCH_1} contains the matched version
set(PROJECT_VERSION ${CMAKE_MATCH_1})
message(STATUS "Found package version: ${PROJECT_VERSION}")
else()
message(SEND_ERROR "Package version not found in package.xml")
endif()

if (NOT CMAKE_BUILD_TYPE)
message("-- No build type specified; defaulting to CMAKE_BUILD_TYPE=Release.")
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ libnabo provides the following compilation options, available through [CMake]:

### Documentation

You can generate the documentation by typing:

make doc

You can access on https://norlab-ulaval.github.io/libnabo/. Alternatively, you can generate it locally by typing:
```bash
make doc
```
Prerequisites
-------------

Expand Down
8 changes: 4 additions & 4 deletions nabo/nabo.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@ libnabo differs from \ref ANN on the following points:
//! Namespace for Nabo
namespace Nabo
{
//! \defgroup public public interface
//! \defgroup public public interface
//@{

//! version of the Nabo library as string
#define NABO_VERSION "1.0.7"
#define NABO_VERSION "1.1.1"
//! version of the Nabo library as an int
#define NABO_VERSION_INT 10007
#define NABO_VERSION_INT 10101

// TODO (c++14) Convert invalidIndex, invalidValue to constexpr templated variables.
template <typename IndexType>
Expand Down