Skip to content

Commit

Permalink
Add CI for ROS2. (#17)
Browse files Browse the repository at this point in the history
* Initial ros2 pipeline.

* Don't run noetic CI on jazzy.

* Updated documentation build.

* Github only supports one pages deployment, so we only deploy on latest branch.

* Updated documentation build.

* Updated documentation setup step.

* Added missing sudo.

* Updated docs conf.

* Add asan to CI tests to find memory issues.

* Build hector_math_py before building documentation to enable automatic generation of graphics.

* Disable asan new-delete-type-mismatch since rcutils triggers it.

* $default-branch is only available in templates not in actual workflow instances.
Only deploy if not a PR.

* Changed upload pages artifact version to v3.

* Update sourcing of built packages.

* Make entire documentation deploy job conditional on "is not a pull request" not just the deploy step.

* Fixed check for GITHUB_REF_NAME in docs build.

* Install python3-git in docs workflow.
  • Loading branch information
StefanFabian authored Sep 3, 2024
1 parent 81aff2f commit df6009d
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 269 deletions.
154 changes: 0 additions & 154 deletions .github/build_docs_on_github.sh

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/ci.yml → .github/workflows/ci-ros1.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build & Test
on:
push:
branches: [ master ]
branches: [ noetic ]
pull_request:
branches: [ master ]
branches: [ noetic ]

jobs:
Linting:
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y python3-catkin-tools python3-empy
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: hector/src
- name: rosdep
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/ci-ros2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build & Test
on:
push:
branches: [ jazzy ]
pull_request:
branches: [ jazzy ]

jobs:
Linting:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
run: |
sudo apt-get update && sudo apt-get install -y clang-format cppcheck libxml2-utils
- name: Lint C++
run: |
clang-format -Werror -n -style=file $(find . -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.c' -o -name '*.cc')
- name: Check C++
run: |
cppcheck --force --quiet --error-exitcode=1 .
- name: Lint package.xml
run: |
xmllint --noout --schema http://download.ros.org/schema/package_format3.xsd $(find . -name 'package.xml')
build-and-test:
needs: Linting
runs-on: ubuntu-latest
# Disable asan new-delete-type-mismatch to workaround rcutils issue
# https://github.com/ros2/rclcpp/issues/2220
env:
ASAN_OPTIONS: new_delete_type_mismatch=0
strategy:
matrix:
ros_distro: [humble, jazzy]
container:
image: ros:${{matrix.ros_distro}}-ros-base
steps:
- uses: ros-tooling/[email protected]
with:
required-ros-distributions: ${{ matrix.ros_distro }}
- uses: ros-tooling/[email protected]
with:
target-ros2-distro: ${{ matrix.ros_distro }}
colcon-defaults: | # Use asan to find memory issues
{
"build": {
"mixin": ["asan-gcc"]
}
}
59 changes: 40 additions & 19 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,50 @@
name: Documentation Build
name: Documentation
on:
push:
branches: [ master ]
branches: [ jazzy ]
pull_request:
branches: [ jazzy ]

jobs:
documentation:
build:
runs-on: ubuntu-latest
container: debian:buster-slim
container:
image: ros:jazzy-ros-base
steps:
- name: Prerequisites
run: |
apt-get update
apt-get install -y git doxygen graphviz
shell: bash

- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
# ref: master # make sure to use documentation script from master branch

- name: Execute script to build our documentation and update pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup
run: |
cd .github
./build_docs_on_github.sh
shell: bash
sudo apt-get update && sudo apt-get install -y git doxygen graphviz python3-sphinx python3-breathe python3-sphinx-rtd-theme python3-git
- uses: ros-tooling/[email protected]
with:
required-ros-distributions: jazzy
- uses: ros-tooling/[email protected]
id: action_ros_ci_step
with:
package-name: hector_math hector_math_py
target-ros2-distro: jazzy
skip-tests: true
- name: Build documentation
run: |
. ${{ steps.action_ros_ci_step.outputs.ros-workspace-directory-name }}/install/setup.sh && cd docs && make html
- uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: docs/_build/html
deploy:
if: github.event_name != 'pull_request'
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Loading

0 comments on commit df6009d

Please sign in to comment.