From 2ba2af67c14f1fc6b810c0650f29849c95514493 Mon Sep 17 00:00:00 2001 From: CihatAltiparmak Date: Mon, 26 Aug 2024 04:58:33 +0300 Subject: [PATCH] Modify CI to track ros testing repo (#256) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Modified CI in a way that rmw_zenoh can also be tested with ROS testing repos * Fixed indentation error in workflow yaml * Build rolling from source, Iron and Jazzy from binaries and cron job too Signed-off-by: Alejandro Hernández Cordero * Fixed syntaz Signed-off-by: Alejandro Hernández Cordero * Use Ubuntu jammy with Iron Signed-off-by: Alejandro Hernández Cordero * Applied the suggestions in ( https://github.com/ros2/rmw_zenoh/pull/256#discussion_r1727744706 ) Signed-off-by: CihatAltiparmak * Fixed vcs-url * Added matrix, changed setup-ros and reverted deleted fail-fast-param Signed-off-by: CihatAltiparmak * Removed DOCKER_IMAGE argument Signed-off-by: CihatAltiparmak * Added lcov package Signed-off-by: CihatAltiparmak --------- Signed-off-by: Alejandro Hernández Cordero Signed-off-by: CihatAltiparmak Co-authored-by: Alejandro Hernández Cordero --- .github/workflows/build.yaml | 48 +++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b9029938..8829ee50 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,27 +4,45 @@ on: push: branches: [ rolling ] workflow_dispatch: + schedule: + # Run every morning to detect flakiness and broken dependencies + - cron: '03 5 * * *' defaults: run: shell: bash jobs: - test: - runs-on: [self-hosted, ubuntu-24.04] + build_and_test: + name: build_and_test_${{ matrix.BUILD_TYPE }}_${{ matrix.ROS_DISTRO }} strategy: fail-fast: false matrix: - distro: ['iron', 'jazzy', 'rolling'] + include: + # Rolling (source) + - ROS_DISTRO: rolling + BUILD_TYPE: source + # Jazzy (binary) + - ROS_DISTRO: jazzy + BUILD_TYPE: binary + # Iron (binary) + - ROS_DISTRO: iron + BUILD_TYPE: binary + env: + ROS2_REPOS_FILE_URL: 'https://raw.githubusercontent.com/ros2/ros2/${{ matrix.ROS_DISTRO }}/ros2.repos' + runs-on: ubuntu-latest container: - image: ros:${{ matrix.distro }}-ros-base - timeout-minutes: 30 + image: ${{ matrix.BUILD_TYPE == 'binary' && format('ros:{0}-ros-base', matrix.ROS_DISTRO) || 'ubuntu:noble' }} steps: - - name: Deps - run: | - apt update && apt install -y curl - - uses: actions/checkout@v4 - - name: rosdep - run: | - rosdep update - rosdep install --from-paths . -yir - - name: build - run: /ros_entrypoint.sh colcon build + - uses: ros-tooling/setup-ros@v0.7 + if: ${{ matrix.BUILD_TYPE == 'source' }} + - name: Install Coverage Tools + if: ${{ matrix.BUILD_TYPE == 'binary' }} + run: sudo apt update && sudo apt install -y python3-colcon-coveragepy-result python3-colcon-lcov-result lcov + - name: Build and run tests + id: action-ros-ci + uses: ros-tooling/action-ros-ci@v0.3 + with: + package-name: | + rmw_zenoh_cpp + zenoh_c_vendor + target-ros2-distro: ${{ matrix.ROS_DISTRO }} + vcs-repo-file-url: ${{ matrix.BUILD_TYPE == 'source' && env.ROS2_REPOS_FILE_URL || '' }}