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 CI for ROS2. #17

Merged
merged 17 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/setup-ros@v0.7
with:
required-ros-distributions: ${{ matrix.ros_distro }}
- uses: ros-tooling/action-ros-ci@v0.3
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/setup-ros@v0.7
with:
required-ros-distributions: jazzy
- uses: ros-tooling/action-ros-ci@v0.3
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