-
Notifications
You must be signed in to change notification settings - Fork 126
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
Fix/redo API docs generation #453
Closed
Closed
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
a995952
Build docs
azeey f483b68
Add setup-ros
azeey 6dcd151
Add doxygen
azeey f181804
Fix doxygen install
azeey 394d358
Add on pull_request to speed up iteration
azeey 2f37e46
Workaround packaging issue
azeey 43e1af5
Try again
azeey 5ff36eb
Remove reinstall
azeey 14b8723
Add missing package instead
azeey c612f58
Remove sdformat
azeey c5a0964
Install all deps
azeey 9d1f060
Upload artifacts
azeey 4ba68fb
Add deply
azeey 8b61c0f
Set noninteractive, just upload all of build
azeey e15dff2
Merge and filter
azeey 9ede452
Fix?
azeey bc31e79
Upload merged
azeey 2b1b912
Add libopengl-dev
azeey 34021e2
Fix workflow
azeey bcb7191
Fix dependency
azeey a6f81a5
Disable some workflows on forks
azeey f1660d6
Add aws upload
azeey 6759afc
Comment out AWS stuff for testing
azeey 44fe5a7
Fix download-path
azeey dabfb57
Fix typo
azeey 648b24e
Add dependency
azeey 6b341de
Uncomment AWS setup
azeey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,91 @@ | ||
name: Upload docs to production | ||
name: Deploy API Docs | ||
|
||
on: | ||
pull_request: | ||
schedule: | ||
# UTC timezone | ||
- cron: '0 6 * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: 'Build API Docs (${{ matrix.gazebo_distribution }})' | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ubuntu:${{ matrix.ubuntu_distribution }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- ubuntu_distribution: focal | ||
gazebo_distribution: citadel | ||
|
||
- ubuntu_distribution: focal | ||
gazebo_distribution: fortress | ||
|
||
- ubuntu_distribution: focal | ||
gazebo_distribution: garden | ||
|
||
- ubuntu_distribution: jammy | ||
gazebo_distribution: harmonic | ||
steps: | ||
- uses: ros-tooling/[email protected] | ||
- name: 'Set up Gazebo' | ||
uses: gazebo-tooling/setup-gazebo@1f55cec330de851fa373f1ade8ac6b7ddfe6f013 | ||
with: | ||
required-gazebo-distributions: ${{ matrix.gazebo_distribution }} | ||
- name: 'Add Doxygen' | ||
run: sudo apt-get install -y doxygen graphviz | ||
- name: 'Add missing dependencies' | ||
run: sudo apt-get install -y libopengl-dev | ||
- name: 'Build Docs' | ||
run: | | ||
mkdir -p ws/src | ||
cd ws/src | ||
vcs import --input https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/collection-${{ matrix.gazebo_distribution}}.yaml | ||
rm -rf sdformat | ||
rm -rf gz-tools | ||
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' ' ') | ||
cd .. | ||
colcon build --merge-install --event-handlers console_cohesion+ --cmake-args -DBUILD_DOCS=ON -DBUILD_TESTING=OFF --cmake-target doc | ||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: api-docs-${{ matrix.gazebo_distribution }} | ||
path: ws/build/**/doxygen/html | ||
|
||
upload: | ||
name: Upload docs to production | ||
runs-on: ubuntu-20.04 | ||
needs: build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
- name: Configure AWS Credentials | ||
id: creds | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-region: us-east-1 | ||
role-to-assume: arn:aws:iam::200670743174:role/github-oidc-deployment-gz-web-app | ||
# Need to run ./build_docs.sh | ||
output-credentials: true | ||
- uses: actions/download-artifact@v4 | ||
id: download | ||
with: | ||
path: .api-docs | ||
pattern: api-docs-* | ||
merge-multiple: true | ||
- name: 'Restructure API Docs' | ||
run: python3 tools/restructure_doxygen_artifacts.py ${{steps.download.outputs.download-path}} .api-out | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: api-docs | ||
path: .api-out/* | ||
- name: Run nightly upload | ||
run: | | ||
cd tools && ./build_docs.sh all | ||
run: aws s3 sync --dry-run .api-out/ s3://gazebosim.org/api/ | ||
shell: bash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 to using aws cli in github actions |
||
env: | ||
GZ_VERSION_PASSWORD: ${{ secrets.GZ_VERSION_PASSWORD }} | ||
AWS_ACCESS_KEY_ID: ${{ steps.creds.outputs.aws-access-key-id }} | ||
AWS_SECRET_ACCESS_KEY: ${{ steps.creds.outputs.aws-secret-access-key }} | ||
AWS_SESSION_TOKEN: ${{ steps.creds.outputs.aws-session-token }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Usage | ||
# /restructure_doxygen_artifacts.py <path_to_artifacts> <output_directory> | ||
# | ||
# Given a directory containing merged doxygen build artifacts, this script reorganizes them so they | ||
# can be deployed to the website | ||
# This assumes the following directory structure: | ||
# ignition-utils1 | ||
# doxygen | ||
# html | ||
# gz-utils2 | ||
# doxygen | ||
# html | ||
# ignition-math6 | ||
# doxygen | ||
# html | ||
# gz-math7 | ||
# doxygen | ||
# html | ||
# ... | ||
# | ||
# The result should look like | ||
# utils | ||
# 1 (content of ignition-utils1/doxygen/html) | ||
# 2 (content of gz-utils2/doxygen/html) | ||
# math | ||
# 6 (content of ignition-math6/doxygen/html) | ||
# 7 (content of gz-math7/doxygen/html) | ||
|
||
import re | ||
import sys | ||
import pathlib | ||
import shutil | ||
|
||
input_dir = pathlib.Path(sys.argv[1]) | ||
output_dir = pathlib.Path(sys.argv[2]) | ||
output_dir.mkdir(exist_ok=True) | ||
|
||
re_expr = R"(ignition|gz)-([a-z_]*)(\d*)" | ||
|
||
|
||
def copy_library(lib_html, lib_name, lib_version): | ||
output_lib_dir = output_dir / lib_name / lib_version | ||
output_lib_dir.mkdir(exist_ok=True, parents=True) | ||
print(f"{lib_html} -> {output_lib_dir}") | ||
shutil.copytree(lib_html, output_lib_dir, dirs_exist_ok=True) | ||
|
||
|
||
for lib in input_dir.iterdir(): | ||
m = re.match(re_expr, lib.name) | ||
if m: | ||
_, lib_name, lib_version = m.groups() | ||
lib_html = lib/"doxygen"/"html" | ||
copy_library(lib_html, lib_name, lib_version) | ||
# Handle gazebo->sim rename by making a copy into the sim directory | ||
if lib_name == "gazebo": | ||
copy_library(lib_html, "sim", lib_version) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to remove this before merge.