diff --git a/.github/workflows/ci.yml b/.github/workflows/ci-ros1.yml similarity index 93% rename from .github/workflows/ci.yml rename to .github/workflows/ci-ros1.yml index 2a9d7b5..2031b0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci-ros1.yml @@ -1,9 +1,9 @@ name: Build & Test on: push: - branches: [ master ] + branches: [ noetic, jazzy ] pull_request: - branches: [ master ] + branches: [ noetic, jazzy ] jobs: Linting: @@ -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 diff --git a/.github/workflows/ci-ros2.yml b/.github/workflows/ci-ros2.yml new file mode 100644 index 0000000..6f6fb70 --- /dev/null +++ b/.github/workflows/ci-ros2.yml @@ -0,0 +1,44 @@ +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 + 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 }} diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 91dde2d..ab9fa05 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,11 +1,11 @@ name: Documentation Build on: push: - branches: [ master ] + branches: [ noetic, jazzy ] jobs: documentation: - runs-on: ubuntu-latest + runs-on: debian-latest container: debian:buster-slim steps: - name: Prerequisites @@ -15,10 +15,9 @@ jobs: 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: