name: Build and Test
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    container:
      image: rostooling/setup-ros-docker:ubuntu-jammy-ros-humble-desktop-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4.2.2

      - name: Build hik_camera_ros2_driver
        uses: ros-tooling/action-ros-ci@v0.3
        with:
          package-name: hik_camera_ros2_driver
          target-ros2-distro: humble
          skip-tests: true

      - name: Test hik_camera_ros2_driver
        run: |
          /usr/bin/bash .github/workflows/colcon_test.sh hik_camera_ros2_driver
