Skip to content

clangformat

clangformat #1275

Workflow file for this run

name: DepthAI ROS CI/CD
on:
workflow_dispatch:
push:
branches:
- main
- develop
- develop-old
- humble
- galactic
- foxy
- iron
- jazzy
- kilted
tags:
- 'v*'
pull_request:
branches:
- main
- develop
- develop-old
- humble
- galactic
- foxy
- iron
- jazzy
- kilted
jobs:
lint:
name: ament_${{ matrix.linter }} (${{ matrix.ros_distro }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- ros_distro: humble
runner: ubuntu-22.04
linter: clang_format
- ros_distro: humble
runner: ubuntu-22.04
linter: xmllint
- ros_distro: humble
runner: ubuntu-22.04
linter: pep257
- ros_distro: humble
runner: ubuntu-22.04
linter: lint_cmake
- ros_distro: jazzy
runner: ubuntu-24.04
linter: clang_format
- ros_distro: jazzy
runner: ubuntu-24.04
linter: xmllint
- ros_distro: jazzy
runner: ubuntu-24.04
linter: pep257
- ros_distro: jazzy
runner: ubuntu-24.04
linter: lint_cmake
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up ROS
uses: ros-tooling/setup-ros@0.7.15
with:
required-ros-distributions: ${{ matrix.ros_distro }}
- name: Run clang_format
if: matrix.linter == 'clang_format'
uses: ros-tooling/action-ros2-lint@0.1.3
with:
distribution: ${{ matrix.ros_distro }}
linter: clang_format
arguments: --config ./.clang-format
package-name: |
depthai_bridge_v3
depthai_examples_v3
depthai_ros_msgs_v3
depthai_ros_driver_v3
depthai_ros_v3
- name: Run ${{ matrix.linter }}
if: matrix.linter != 'clang_format'
uses: ros-tooling/action-ros2-lint@0.1.3
with:
distribution: ${{ matrix.ros_distro }}
linter: ${{ matrix.linter }}
package-name: |
depthai_bridge_v3
depthai_examples_v3
depthai_ros_msgs_v3
depthai_ros_v3
docker-build:
name: Docker build ${{ matrix.ros_distro }} ${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- ros_distro: humble
runner: ubuntu-24.04
arch: amd64
tag_suffix: '-humble'
latest_tag: humble-latest
build_args: |
ROS_DISTRO=humble
USE_RVIZ=1
BUILD_SEQUENTIAL=1
push_build_args: |
ROS_DISTRO=humble
USE_RVIZ=1
- ros_distro: humble
runner: ubuntu-24.04-arm
arch: arm64
tag_suffix: '-humble-arm64'
latest_tag: humble-arm64-latest
build_args: |
ROS_DISTRO=humble
USE_RVIZ=1
BUILD_SEQUENTIAL=1
push_build_args: |
ROS_DISTRO=humble
USE_RVIZ=1
- ros_distro: jazzy
runner: ubuntu-24.04
arch: amd64
tag_suffix: '-jazzy'
latest_tag: jazzy-latest
build_args: |
ROS_DISTRO=jazzy
USE_RVIZ=1
BUILD_SEQUENTIAL=1
push_build_args: |
ROS_DISTRO=jazzy
USE_RVIZ=1
- ros_distro: jazzy
runner: ubuntu-24.04-arm
arch: arm64
tag_suffix: '-jazzy-arm64'
latest_tag: jazzy-arm64-latest
build_args: |
ROS_DISTRO=jazzy
USE_RVIZ=1
BUILD_SEQUENTIAL=1
push_build_args: |
ROS_DISTRO=jazzy
USE_RVIZ=1
env:
PUSH: ${{ (github.event_name != 'pull_request') && (github.repository == 'luxonis/depthai-ros') && startsWith(github.ref, 'refs/tags/v') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: env.PUSH == 'true'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}
- name: Get Version
if: env.PUSH == 'true'
id: vars
run: echo "short_ref=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT"
- name: Build
if: env.PUSH == 'false'
uses: docker/build-push-action@v6
with:
build-args: ${{ matrix.build_args }}
no-cache: true
- name: Build and Push
if: env.PUSH == 'true'
uses: docker/build-push-action@v6
with:
build-args: ${{ matrix.push_build_args }}
push: true
no-cache: true
tags: |
luxonis/depthai-ros:${{ steps.vars.outputs.short_ref }}${{ matrix.tag_suffix }}
luxonis/depthai-ros:${{ matrix.latest_tag }}