Skip to content

Commit

Permalink
Add Doxygen Github Action to generate docs
Browse files Browse the repository at this point in the history
Signed-off-by: Shamitha Shashidhara <[email protected]>
  • Loading branch information
shamitha-shashidhara authored and marcmo committed Nov 25, 2024
1 parent 12055db commit eda45ca
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 4 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/doxygen-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build and Deploy Doxygen Documentation

on: [workflow_call, pull_request]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
working-directory: ./doc
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install python dependencies
run: |
python -m pip install --upgrade pip
- name: Install doxygen
run: |
sudo apt-get update
sudo apt-get install doxygen
pip install coverxygen
- name: Run doxygen
run: doxygen Doxyfile

- name: Print Doxygen Warning Log
run: cat DoxygenWarningLog.txt

- name: Run coverxygen
run: python3 -m coverxygen --format summary --xml-dir doxygenOut/xml/ --src-dir .. --output doc-coverage.info

- name: Print doc coverage
run: cat doc-coverage.info

- name: Zip doxygen documentation
run: |
mv doxygenOut/html doxygen_docs
zip -r doxygen_docs.zip doxygen_docs
- name: Upload doxygen_docs
uses: actions/upload-artifact@v4
with:
name: doxygen_docs
path: ./doc/doxygen_docs.zip
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ jobs:
build-sphinx-docs:
uses: ./.github/workflows/sphinx-doc-build.yml

build-doxygen-docs:
uses: ./.github/workflows/doxygen-build.yml

publish-docs:
runs-on: ubuntu-latest
needs: build-sphinx-docs
needs: [build-sphinx-docs, build-doxygen-docs]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -31,6 +34,18 @@ jobs:
unzip sphinx_docs.zip
rm sphinx_docs.zip
- name: Download doxygen documentation
uses: actions/download-artifact@v4
with:
name: doxygen_docs
path: ./doc/github_pages

- name: Unzip doxygen documentation
working-directory: ./doc/github_pages
run: |
unzip doxygen_docs.zip
rm doxygen_docs.zip
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -2094,7 +2094,7 @@ MAN_LINKS = NO
# captures the structure of the code including all documentation.
# The default value is: NO.

GENERATE_XML = NO
GENERATE_XML = YES

# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
Expand All @@ -2118,7 +2118,7 @@ XML_PROGRAMLISTING = YES
# The default value is: NO.
# This tag requires that the tag GENERATE_XML is set to YES.

XML_NS_MEMB_FILE_SCOPE = NO
XML_NS_MEMB_FILE_SCOPE = YES

#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
Expand Down
22 changes: 22 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,25 @@ doxygen Doxyfile
```

The entry point html file is found at `doc/doxygenOut/html/index.html`

XML output is also generated in `doc/doxygenOut/xml/` from which coverage information can be extracted using [`coverxygen`](https://github.com/psycofdj/coverxygen). For example...

```bash
$ python3 -m coverxygen --format summary --xml-dir doxygenOut/xml/ --src-dir .. --output -
Classes : 50.2% (231/460)
Defines : 2.4% (4/169)
Enum Values: 35.9% (185/515)
Enums : 41.7% (45/108)
Files : 7.5% (47/630)
Friends : 9.8% (5/51)
Functions : 41.9% (1826/4354)
Namespaces : 4.3% (5/116)
Pages : 100.0% (3/3)
Structs : 20.8% (55/264)
Typedefs : 29.0% (226/780)
Unions : 100.0% (1/1)
Variables : 7.7% (110/1435)
-----------------------------------
Total : 30.9% (2743/8886)

```
1 change: 0 additions & 1 deletion doc/github_pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ <h3><a href="doxygenOut/html/index.html">Doxygen-generated API docs</a></h3>
<h3>Coverage reports</h3>
<ul>
<li><a href="code_coverage_url">Code coverage report</a></li>
<li><a href="api_doc_coverage_url">API doc coverage report</a></li>
</ul>

<h1>Other Publications</h1>
Expand Down

0 comments on commit eda45ca

Please sign in to comment.