Skip to content

Commit

Permalink
Support multiple versions of Fast DDS in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sanchez-Mateos <[email protected]>
  • Loading branch information
rsanchez15 committed May 13, 2024
1 parent 947abed commit 255c0c9
Show file tree
Hide file tree
Showing 7 changed files with 572 additions and 317 deletions.
9 changes: 8 additions & 1 deletion .github/actions/project_dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ inputs:
description: Specify cmake_build_type option to download specific artifact
required: true

custom_version_build:
description: >
Use the custom version build from eProsima-CI.
If set to false, the workflow will run the tests for Fast DDS v2 and v3.
required: true
default: 'custom'

dependencies_artifact_postfix:
description: Specify artifact postfix in case it wants to use a manual one
required: false
Expand Down Expand Up @@ -47,7 +54,7 @@ runs:
- name: Download dependencies artifact
uses: eProsima/eProsima-CI/multiplatform/download_dependency@v0
with:
artifact_name: built_ddspipe_${{ inputs.os }}_${{ inputs.cmake_build_type }}${{ inputs.dependencies_artifact_postfix }}
artifact_name: built_ddspipe_${{ inputs.custom_version_build }}_${{ inputs.os }}_${{ inputs.cmake_build_type }}${{ inputs.dependencies_artifact_postfix }}
workflow_source: build_ddspipe.yml
workflow_source_repository: eProsima/eProsima-CI
target_workspace: ${{ inputs.target_workspace }}
Expand Down
2 changes: 1 addition & 1 deletion .github/docker/ddsrouter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ WORKDIR /ddsrouter


ARG fastcdr_branch=master
ARG fastdds_branch=master
ARG fastdds_branch=2.x
ARG devutils_branch=main
ARG ddspipe_branch=main
ARG ddsrouter_branch=main
Expand Down
2 changes: 1 addition & 1 deletion .github/docker/vulcanexus/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG docker_image_base
FROM $docker_image_base

LABEL author=javierparis@eprosima.com
LABEL author=raul@eprosima.com

# Avoid interactuation with installation of some package that needs the locale.
ENV TZ=Europe/Madrid
Expand Down
136 changes: 136 additions & 0 deletions .github/workflows/docker-reusable-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: docker-reusable-workflow

on:
workflow_call:
inputs:

fastcdr_branch:
description: 'Branch or tag of Fast CDR repository (https://github.com/eProsima/Fast-CDR)'
required: true
default: 'master'
type: string

fastdds_branch:
description: 'Branch or tag of Fast DDS repository (https://github.com/eProsima/Fast-DDS)'
required: true
default: 'master'
type: string

ddspipe_branch:
description: 'Branch or tag of DDS Pipe repository (https://github.com/eProsima/DDS-Pipe)'
required: true
default: 'main'
type: string

ddsrouter_branch:
description: 'Branch or tag of DDS Router repository (https://github.com/eProsima/DDS-Router)'
required: true
default: 'main'
type: string

custom_version_build:
description: >
Version of Fast DDS build from eProsima-CI.
required: true
type: string

dependencies_artifact_postfix:
description: 'Postfix name to add to artifact name to download dependencies. This is use to download a specific artifact version from eProsima-CI.'
required: true
default: '_nightly'
type: string

env:
code_packages_names: 'ddsrouter_test'
docs_packages_names: ''

jobs:
docker-test:

runs-on: ubuntu-22.04

env:
DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE: "ddsrouter:ci"
DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE: "vulcanexus:ci"

steps:

- name: Sync repository
uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: ${{ github.workspace }}/src

# Build Vulcanexus Docker image
- name: Build custom Vulcanexus Docker image
run: |
cd ./src/.github/docker/vulcanexus
docker build \
--no-cache \
--build-arg docker_image_base=eprosima/vulcanexus:humble-core \
-t ${{ env.DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE }} \
-f Dockerfile .
# Build DDS Router Docker image
- name: Build DDS Router Docker image
run: |
cd ./src/.github/docker/ddsrouter
docker build \
--no-cache \
--build-arg fastcdr_branch=${{ inputs.fastcdr_branch }} \
--build-arg fastdds_branch=${{ inputs.fastdds_branch }} \
--build-arg ddspipe_branch=${{ inputs.ddspipe_branch }} \
--build-arg ddsrouter_branch=${{ inputs.ddsrouter_branch }} \
-t ${{ env.DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE }} \
-f Dockerfile .
# Check Docker images exist
- name: Check if Docker images exist
run: |
[ -n "$(docker images -q ${{ env.DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE }})" ] || echo "DDS Router Docker image does not exists"
[ -n "$(docker images -q ${{ env.DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE }})" ] || echo "Vulcanexus image does not exists"
- name: Download dependencies and install requirements
uses: ./src/.github/actions/project_dependencies
with:
os: ubuntu-22.04
cmake_build_type: "Release"
custom_version_build: ${{ inputs.custom_version_build }}
dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }}
secret_token: ${{ secrets.GITHUB_TOKEN }}

- name: Compile docker tests
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
with:
workspace: ${{ github.workspace }}
colcon_build_args: --packages-up-to ddsrouter_test
cmake_args: -DBUILD_COMPOSE_TESTS=ON -DCMAKE_BUILD_TYPE=Release
workspace_dependencies: ${{ github.workspace }}/install
colcon_meta_file: ${{ github.workspace }}/src/.github/workflows/configurations/${{ runner.os }}/colcon.meta

# Run ddsrouter_test compose tests
- name: Run flaky tests
continue-on-error: true
run: |
export DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE=${{ env.DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE }}
export DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE=${{ env.DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE }}
source ${{ github.workspace }}/install/setup.bash
colcon test \
--packages-select ddsrouter_test \
--event-handlers console_direct+ \
--return-code-on-test-failure \
--ctest-args \
--label-regex xfail \
--timeout 120
- name: Run tests
run: |
export DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE=${{ env.DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE }}
export DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE=${{ env.DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE }}
source ${{ github.workspace }}/install/setup.bash
colcon test \
--packages-select ddsrouter_test \
--event-handlers console_direct+ \
--return-code-on-test-failure \
--ctest-args \
--label-exclude xfail \
--timeout 120
53 changes: 53 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Nightly test workflow for DDS Router
name: nightly

on:
schedule:
- cron: '0 5 * * *'

jobs:

reusable_tests_v2:
name: reusable_tests_v2
uses: ./.github/workflows/reusable-workflow.yml
with:
custom_version_build: 'v2'
dependencies_artifact_postfix: '_nightly'
secrets: inherit

# Uncomment this block to run the tests for Fast DDS v3 when DDS Router is updated
# Also specify here (and above) the workflow version/branch to use (@v0, @main, etc.)
# reusable_tests_v3:
# name: reusable_tests_v3
# uses: ./.github/workflows/reusable-workflow.yml
# with:
# custom_version_build: 'v3'
# dependencies_artifact_postfix: '_nightly'
# secrets: inherit

reusable_docker_tests_v2:
name: reusable_docker_tests_v2
uses: ./.github/workflows/docker-reusable-workflow.yml
with:
fastcdr_branch: 'master'
fastdds_branch: '2.x'
ddspipe_branch: 'main'
ddsrouter_branch: 'main'
custom_version_build: 'v2'
dependencies_artifact_postfix: '_nightly'
secrets: inherit

# Uncomment this block to run the tests for Fast DDS v3 when DDS Router is updated
# Also specify here (and above) the workflow version/branch to use (@v0, @main, etc.)
# reusable_docker_tests_v3:
# name: reusable_docker_tests_v3
# uses: ./.github/workflows/docker-reusable-workflow.yml
# with:
# fastcdr_branch: 'master'
# fastdds_branch: '3.x'
# ddspipe_branch: 'main'
# ddsrouter_branch: 'main'
# custom_version_build: 'v3'
# dependencies_artifact_postfix: '_nightly'
# secrets: inherit

Loading

0 comments on commit 255c0c9

Please sign in to comment.