Skip to content

Commit ba2d873

Browse files
authored
Enable generation of API Docs for gz-tools and sdformat (gazebosim#501)
* Enable generation of API Docs for gz-tools and sdformat These were failing before, but it might have been because Latex related packages were not installed. * Do not upload unless on master * Handle sdformat directory * Fix upload_artifact step --------- Signed-off-by: Addisu Z. Taddese <[email protected]>
1 parent 3e075cd commit ba2d873

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.github/workflows/nightly-upload.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,14 @@ jobs:
3838
required-gazebo-distributions: ${{ matrix.gazebo_distribution }}
3939
use-gazebo-nightly: ${{ matrix.gazebo_distribution == 'ionic'}}
4040
- name: 'Add Doxygen'
41-
run: sudo apt-get install -y doxygen graphviz
41+
run: sudo apt-get install -y doxygen graphviz texlive-latex-extra
4242
- name: 'Add missing dependencies'
4343
run: sudo apt-get install -y libopengl-dev
4444
- name: 'Build Docs'
4545
run: |
4646
mkdir -p ws/src
4747
cd ws/src
4848
vcs import --input https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/collection-${{ matrix.gazebo_distribution}}.yaml
49-
rm -rf sdformat
50-
rm -rf gz-tools
5149
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install $(sort -u $(find . -iname 'packages-'${{ matrix.ubuntu_distribution}}'.apt' -o -iname 'packages.apt' | grep -v '/\.git/') | tr '\n' ' ')
5250
cd ..
5351
colcon build --merge-install --event-handlers console_cohesion+ --cmake-args -DBUILD_DOCS=ON -DBUILD_TESTING=OFF --cmake-target doc
@@ -56,6 +54,8 @@ jobs:
5654
with:
5755
name: api-docs-${{ matrix.gazebo_distribution }}
5856
path: ws/build/**/doxygen/html
57+
if-no-files-found: 'error'
58+
include-hidden-files: 'true'
5959

6060
upload:
6161
name: Upload docs to production
@@ -82,7 +82,12 @@ jobs:
8282
with:
8383
name: api-docs
8484
path: .api-out/*
85+
if-no-files-found: 'error'
86+
include-hidden-files: 'true'
8587
- name: Commit
88+
# The workflow upto this point is good for generating a preview,
89+
# but only commit to deploy if we are on the master branch (not a pull request).
90+
if: github.ref == 'refs/heads/master'
8691
uses: peaceiris/actions-gh-pages@v4
8792
with:
8893
github_token: ${{ secrets.GITHUB_TOKEN }}

tools/restructure_doxygen_artifacts.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
output_dir = pathlib.Path(sys.argv[2])
3636
output_dir.mkdir(exist_ok=True)
3737

38-
re_expr = R"(ignition|gz)-([a-z_]*)(\d*)"
38+
re_expr = R"(?:ignition|gz)-([a-z_]*)(\d*)"
39+
sdf_re_expr = R"(sdformat)(\d*)"
3940

4041

4142
def copy_library(lib_html, lib_name, lib_version):
@@ -47,8 +48,11 @@ def copy_library(lib_html, lib_name, lib_version):
4748

4849
for lib in input_dir.iterdir():
4950
m = re.match(re_expr, lib.name)
51+
if not m:
52+
m = re.match(sdf_re_expr, lib.name)
53+
5054
if m:
51-
_, lib_name, lib_version = m.groups()
55+
lib_name, lib_version = m.groups()
5256
lib_html = lib/"doxygen"/"html"
5357
copy_library(lib_html, lib_name, lib_version)
5458
# Handle gazebo->sim rename by making a copy into the sim directory

0 commit comments

Comments
 (0)