Skip to content

Commit 8ec10cf

Browse files
authored
Support multiple versions of Fast DDS in CI (#449)
* Support multiple versions of Fast DDS in CI Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com> * Fix inputs in workflow dispatch Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com> * Add dev-utils branch Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com> * Update fastcdr default version Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com> * Remove redundant github workspace in paths Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com> * Remove redundant github workspace in paths in docker workflow Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com> --------- Signed-off-by: Raul Sanchez-Mateos <raul@eprosima.com>
1 parent 947abed commit 8ec10cf

7 files changed

Lines changed: 490 additions & 364 deletions

File tree

.github/actions/project_dependencies/action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ inputs:
1111
description: Specify cmake_build_type option to download specific artifact
1212
required: true
1313

14+
custom_version_build:
15+
description: >
16+
Use the custom version build from eProsima-CI.
17+
If set to false, the workflow will run the tests for Fast DDS v2 and v3.
18+
required: true
19+
default: 'custom'
20+
1421
dependencies_artifact_postfix:
1522
description: Specify artifact postfix in case it wants to use a manual one
1623
required: false
@@ -47,7 +54,7 @@ runs:
4754
- name: Download dependencies artifact
4855
uses: eProsima/eProsima-CI/multiplatform/download_dependency@v0
4956
with:
50-
artifact_name: built_ddspipe_${{ inputs.os }}_${{ inputs.cmake_build_type }}${{ inputs.dependencies_artifact_postfix }}
57+
artifact_name: built_ddspipe_${{ inputs.custom_version_build }}_${{ inputs.os }}_${{ inputs.cmake_build_type }}${{ inputs.dependencies_artifact_postfix }}
5158
workflow_source: build_ddspipe.yml
5259
workflow_source_repository: eProsima/eProsima-CI
5360
target_workspace: ${{ inputs.target_workspace }}

.github/docker/ddsrouter/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ RUN pip3 install \
4242
WORKDIR /ddsrouter
4343

4444

45-
ARG fastcdr_branch=master
46-
ARG fastdds_branch=master
45+
ARG fastcdr_branch=2.x
46+
ARG fastdds_branch=2.x
4747
ARG devutils_branch=main
4848
ARG ddspipe_branch=main
4949
ARG ddsrouter_branch=main

.github/docker/vulcanexus/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG docker_image_base
22
FROM $docker_image_base
33

4-
LABEL author=javierparis@eprosima.com
4+
LABEL author=raul@eprosima.com
55

66
# Avoid interactuation with installation of some package that needs the locale.
77
ENV TZ=Europe/Madrid

.github/workflows/docker_test.yml renamed to .github/workflows/docker-reusable-workflow.yml

Lines changed: 34 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,61 @@
1-
name: ddsrouter-docker-tests
1+
name: docker-reusable-workflow
22

33
on:
4-
workflow_dispatch:
4+
workflow_call:
55
inputs:
6+
67
fastcdr_branch:
78
description: 'Branch or tag of Fast CDR repository (https://github.com/eProsima/Fast-CDR)'
89
required: true
910
default: 'master'
11+
type: string
12+
1013
fastdds_branch:
1114
description: 'Branch or tag of Fast DDS repository (https://github.com/eProsima/Fast-DDS)'
1215
required: true
1316
default: 'master'
14-
devutils_branch:
15-
description: 'Branch or tag of dev-utils repository (https://github.com/eProsima/dev-utils)'
17+
type: string
18+
19+
dev_utils_branch:
20+
description: 'Branch or tag of eProsima/dev-utils repository (https://github.com/eProsima/dev-utils)'
1621
required: true
1722
default: 'main'
23+
type: string
24+
1825
ddspipe_branch:
1926
description: 'Branch or tag of DDS Pipe repository (https://github.com/eProsima/DDS-Pipe)'
2027
required: true
2128
default: 'main'
29+
type: string
30+
2231
ddsrouter_branch:
2332
description: 'Branch or tag of DDS Router repository (https://github.com/eProsima/DDS-Router)'
2433
required: true
2534
default: 'main'
35+
type: string
36+
37+
custom_version_build:
38+
description: >
39+
Version of Fast DDS build from eProsima-CI.
40+
required: true
41+
type: string
42+
2643
dependencies_artifact_postfix:
2744
description: 'Postfix name to add to artifact name to download dependencies. This is use to download a specific artifact version from eProsima-CI.'
2845
required: true
2946
default: '_nightly'
30-
pull_request:
31-
push:
32-
branches:
33-
- main
34-
schedule:
35-
- cron: '0 0 * * *'
47+
type: string
3648

3749
env:
3850
code_packages_names: 'ddsrouter_test'
3951
docs_packages_names: ''
40-
default_dependencies_artifact_postfix: '_nightly'
4152

4253
jobs:
4354
docker-test:
4455

4556
runs-on: ubuntu-22.04
4657

4758
env:
48-
DEFAULT_FASTCDR_BRANCH: 'master'
49-
DEFAULT_FASTDDS_BRANCH: 'master'
50-
DEFAULT_DEVUTILS_BRANCH: 'main'
51-
DEFAULT_DDSPIPE_BRANCH: 'main'
52-
DEFAULT_DDSROUTER_BRANCH: 'main'
5359
DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE: "ddsrouter:ci"
5460
DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE: "vulcanexus:ci"
5561

@@ -58,25 +64,7 @@ jobs:
5864
- name: Sync repository
5965
uses: eProsima/eProsima-CI/external/checkout@v0
6066
with:
61-
path: ${{ github.workspace }}/src
62-
63-
# Echo Env Var to debug workflow
64-
- name: Echo env variables
65-
run: |
66-
echo "--- Input Variables ---"
67-
echo "github.event.inputs.fastcdr_branch: ${{ github.event.inputs.fastcdr_branch }}"
68-
echo "github.event.inputs.fastdds_branch: ${{ github.event.inputs.fastdds_branch }}"
69-
echo "github.event.inputs.devutils_branch: ${{ github.event.inputs.devutils_branch }}"
70-
echo "github.event.inputs.ddspipe_branch: ${{ github.event.inputs.ddspipe_branch }}"
71-
echo "github.event.inputs.ddsrouter_branch: ${{ github.event.inputs.ddsrouter_branch }}"
72-
echo "--- Github Environment Variables ---"
73-
echo "github.head_ref: ${{ github.head_ref }}"
74-
echo "--- Environment Variables ---"
75-
echo "DEFAULT_FASTCDR_BRANCH: ${{ env.DEFAULT_FASTCDR_BRANCH }}"
76-
echo "DEFAULT_FASTDDS_BRANCH: ${{ env.DEFAULT_FASTDDS_BRANCH }}"
77-
echo "DEFAULT_DEVUTILS_BRANCH: ${{ env.DEFAULT_DEVUTILS_BRANCH }}"
78-
echo "DEFAULT_DDSPIPE_BRANCH: ${{ env.DEFAULT_DDSPIPE_BRANCH }}"
79-
echo "DEFAULT_DDSROUTER_BRANCH: ${{ env.DEFAULT_DDSROUTER_BRANCH }}"
67+
path: src
8068

8169
# Build Vulcanexus Docker image
8270
- name: Build custom Vulcanexus Docker image
@@ -94,14 +82,13 @@ jobs:
9482
cd ./src/.github/docker/ddsrouter
9583
docker build \
9684
--no-cache \
97-
--build-arg fastcdr_branch=${{ github.event.inputs.fastcdr_branch || env.DEFAULT_FASTCDR_BRANCH }} \
98-
--build-arg fastdds_branch=${{ github.event.inputs.fastdds_branch || env.DEFAULT_FASTDDS_BRANCH }} \
99-
--build-arg devutils_branch=${{ github.event.inputs.devutils_branch || env.DEFAULT_DEVUTILS_BRANCH }} \
100-
--build-arg ddspipe_branch=${{ github.event.inputs.ddspipe_branch || env.DEFAULT_DDSPIPE_BRANCH }} \
101-
--build-arg ddsrouter_branch=${{ github.event.inputs.ddsrouter_branch || github.head_ref || env.DEFAULT_DDSROUTER_BRANCH }} \
85+
--build-arg fastcdr_branch=${{ inputs.fastcdr_branch }} \
86+
--build-arg fastdds_branch=${{ inputs.fastdds_branch }} \
87+
--build-arg dev_utils_branch=${{ inputs.dev_utils_branch }} \
88+
--build-arg ddspipe_branch=${{ inputs.ddspipe_branch }} \
89+
--build-arg ddsrouter_branch=${{ inputs.ddsrouter_branch }} \
10290
-t ${{ env.DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE }} \
10391
-f Dockerfile .
104-
echo "DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE: ${{ env.DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE }}"
10592
10693
# Check Docker images exist
10794
- name: Check if Docker images exist
@@ -114,7 +101,8 @@ jobs:
114101
with:
115102
os: ubuntu-22.04
116103
cmake_build_type: "Release"
117-
dependencies_artifact_postfix: ${{ github.event.inputs.dependencies_artifact_postfix || env.default_dependencies_artifact_postfix }}
104+
custom_version_build: ${{ inputs.custom_version_build }}
105+
dependencies_artifact_postfix: ${{ inputs.dependencies_artifact_postfix }}
118106
secret_token: ${{ secrets.GITHUB_TOKEN }}
119107

120108
- name: Compile docker tests
@@ -123,16 +111,16 @@ jobs:
123111
workspace: ${{ github.workspace }}
124112
colcon_build_args: --packages-up-to ddsrouter_test
125113
cmake_args: -DBUILD_COMPOSE_TESTS=ON -DCMAKE_BUILD_TYPE=Release
126-
workspace_dependencies: ${{ github.workspace }}/install
127-
colcon_meta_file: ${{ github.workspace }}/src/.github/workflows/configurations/${{ runner.os }}/colcon.meta
114+
workspace_dependencies: install
115+
colcon_meta_file: src/.github/workflows/configurations/${{ runner.os }}/colcon.meta
128116

129117
# Run ddsrouter_test compose tests
130118
- name: Run flaky tests
131119
continue-on-error: true
132120
run: |
133121
export DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE=${{ env.DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE }}
134122
export DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE=${{ env.DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE }}
135-
source ${{ github.workspace }}/install/setup.bash
123+
source install/setup.bash
136124
colcon test \
137125
--packages-select ddsrouter_test \
138126
--event-handlers console_direct+ \
@@ -145,7 +133,7 @@ jobs:
145133
run: |
146134
export DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE=${{ env.DDSROUTER_COMPOSE_TEST_DOCKER_IMAGE }}
147135
export DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE=${{ env.DDSROUTER_COMPOSE_TEST_ROS2_DOCKER_IMAGE }}
148-
source ${{ github.workspace }}/install/setup.bash
136+
source install/setup.bash
149137
colcon test \
150138
--packages-select ddsrouter_test \
151139
--event-handlers console_direct+ \

.github/workflows/nightly.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Nightly test workflow for DDS Router
2+
name: nightly
3+
4+
on:
5+
schedule:
6+
- cron: '0 5 * * *'
7+
8+
jobs:
9+
10+
reusable_tests_v2:
11+
name: reusable_tests_v2
12+
uses: ./.github/workflows/reusable-workflow.yml
13+
with:
14+
custom_version_build: 'v2'
15+
dependencies_artifact_postfix: '_nightly'
16+
secrets: inherit
17+
18+
# Uncomment this block to run the tests for Fast DDS v3 when DDS Router is updated
19+
# Also specify here (and above) the workflow version/branch to use (@v0, @main, etc.)
20+
# reusable_tests_v3:
21+
# name: reusable_tests_v3
22+
# uses: ./.github/workflows/reusable-workflow.yml
23+
# with:
24+
# custom_version_build: 'v3'
25+
# dependencies_artifact_postfix: '_nightly'
26+
# secrets: inherit
27+
28+
reusable_docker_tests_v2:
29+
name: reusable_docker_tests_v2
30+
uses: ./.github/workflows/docker-reusable-workflow.yml
31+
with:
32+
fastcdr_branch: '2.x'
33+
fastdds_branch: '2.x'
34+
ddspipe_branch: 'main'
35+
ddsrouter_branch: 'main'
36+
custom_version_build: 'v2'
37+
dependencies_artifact_postfix: '_nightly'
38+
secrets: inherit
39+
40+
# Uncomment this block to run the tests for Fast DDS v3 when DDS Router is updated
41+
# Also specify here (and above) the workflow version/branch to use (@v0, @main, etc.)
42+
# reusable_docker_tests_v3:
43+
# name: reusable_docker_tests_v3
44+
# uses: ./.github/workflows/docker-reusable-workflow.yml
45+
# with:
46+
# fastcdr_branch: '2.x'
47+
# fastdds_branch: '3.x'
48+
# ddspipe_branch: 'main'
49+
# ddsrouter_branch: 'main'
50+
# custom_version_build: 'v3'
51+
# dependencies_artifact_postfix: '_nightly'
52+
# secrets: inherit
53+

0 commit comments

Comments
 (0)