Skip to content

Commit c45ee14

Browse files
committed
Refs #21228: Refactor Ubuntu CI
Signed-off-by: JesusPoderoso <jesuspoderoso@eprosima.com>
1 parent fb1dba6 commit c45ee14

7 files changed

Lines changed: 394 additions & 26 deletions

File tree

.github/actions/fetch-fastdds_python-repos/action.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ names:
33
cmake-args:
44
- "-DSECURITY=ON"
55
- "-DLOG_CONSUMER_DEFAULT=STDOUT"
6-
fastdds_python:
7-
cmake-args:
8-
- "-DBUILD_TESTING=ON"

.github/workflows/config/test.meta

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
names:
2+
fastdds_python:
3+
cmake-args:
4+
- "-DBUILD_TESTING=ON"
5+
- "-DBUILD_DOCUMENTATION=ON"
6+
ctest-args: [
7+
"--repeat", "until-pass:3",
8+
"--timeout", "300",
9+
"--label-exclude", "xfail"
10+
]
11+
googletest-distribution:
12+
cmake-args:
13+
- "-Dgtest_force_shared_crt=ON"
14+
- "-DBUILD_SHARED_LIBS=ON"
15+
- "-DBUILD_GMOCK=ON"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repositories:
2+
googletest-distribution:
3+
type: git
4+
url: https://github.com/google/googletest.git
5+
version: release-1.11.0
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Fast DDS Python Ubuntu CI (nightly)
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 1 * * *'
7+
8+
jobs:
9+
# python main - fastdds master
10+
nightly-ubuntu-ci-main:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os-version:
15+
- 'ubuntu-22.04'
16+
fastdds-python-branch:
17+
- 'main'
18+
fastdds-branch:
19+
- 'master'
20+
uses: eProsima/Fast-DDS-Python/.github/workflows/reusable-ubuntu-ci.yml@main
21+
with:
22+
os-version: ${{ matrix.os-version }}
23+
label: 'nightly-${{ matrix.os-version }}-ci-${{ matrix.fastdds-python-branch }}'
24+
fastdds-python-branch: ${{ matrix.fastdds-python-branch }}
25+
fastdds-branch: ${{ matrix.fastdds-branch }}
26+
run-build: true
27+
run-tests: true
28+
29+
# python 1.4.x - fastdds 2.14.x/2.13.x
30+
nightly-ubuntu-ci-1_4_x:
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
os-version:
35+
- 'ubuntu-22.04'
36+
fastdds-python-branch:
37+
- '1.4.x'
38+
fastdds-branch:
39+
- '2.14.x'
40+
- '2.13.x'
41+
uses: eProsima/Fast-DDS-Python/.github/workflows/reusable-ubuntu-ci.yml@1.4.x
42+
with:
43+
os-version: ${{ matrix.os-version }}
44+
label: 'nightly-${{ matrix.os-version }}-ci-${{ matrix.fastdds-python-branch }}'
45+
fastdds-python-branch: ${{ matrix.fastdds-python-branch }}
46+
fastdds-branch: ${{ matrix.fastdds-branch }}
47+
run-build: true
48+
run-tests: true
49+
50+
# python 1.2.x - fastdds 2.10.x
51+
nightly-ubuntu-ci-1_2_x:
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
os-version:
56+
- 'ubuntu-22.04'
57+
fastdds-python-branch:
58+
- '1.2.x'
59+
fastdds-branch:
60+
- '2.10.x'
61+
uses: eProsima/Fast-DDS-Python/.github/workflows/reusable-ubuntu-ci.yml@1.2.x
62+
with:
63+
os-version: ${{ matrix.os-version }}
64+
label: 'nightly-${{ matrix.os-version }}-ci-${{ matrix.fastdds-python-branch }}'
65+
fastdds-python-branch: ${{ matrix.fastdds-python-branch }}
66+
fastdds-branch: ${{ matrix.fastdds-branch }}
67+
run-build: true
68+
run-tests: true
69+
70+
# python 1.0.x - fastdds 2.6.x
71+
nightly-ubuntu-ci-1_0_x:
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
os-version:
76+
- 'ubuntu-20.04'
77+
fastdds-python-branch:
78+
- '1.0.x'
79+
fastdds-branch:
80+
- '2.6.x'
81+
uses: eProsima/Fast-DDS-Python/.github/workflows/reusable-ubuntu-ci.yml@1.0.x
82+
with:
83+
os-version: ${{ matrix.os-version }}
84+
label: 'nightly-${{ matrix.os-version }}-ci-${{ matrix.fastdds-python-branch }}'
85+
fastdds-python-branch: ${{ matrix.fastdds-python-branch }}
86+
fastdds-branch: ${{ matrix.fastdds-branch }}
87+
run-build: true
88+
run-tests: false
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
name: Fast DDS Python Ubuntu CI reusable workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os-version:
7+
description: 'The OS image for the workflow'
8+
required: false
9+
default: 'ubuntu-22.04'
10+
type: string
11+
label:
12+
description: 'ID associated to the workflow'
13+
required: true
14+
type: string
15+
colcon-args:
16+
description: 'Extra arguments for colcon cli'
17+
required: false
18+
type: string
19+
cmake-args:
20+
description: 'Extra arguments for cmake cli'
21+
required: false
22+
type: string
23+
ctest-args:
24+
description: 'Extra arguments for ctest cli'
25+
required: false
26+
type: string
27+
fastdds-python-branch:
28+
description: 'Branch or tag of Fast DDS Python repository'
29+
required: true
30+
type: string
31+
fastdds-branch:
32+
description: 'Branch or tag of Fast DDS repository'
33+
required: true
34+
type: string
35+
run-build:
36+
description: 'Build Fast DDS Python (CI skipped otherwise)'
37+
required: false
38+
type: boolean
39+
default: true
40+
run-tests:
41+
description: 'Run test suite of Fast DDS python'
42+
required: false
43+
type: boolean
44+
default: true
45+
46+
env:
47+
colcon-build-default-cmake-args: '-DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic -Wunused-value -Woverloaded-virtual"'
48+
defaults:
49+
run:
50+
shell: bash
51+
52+
jobs:
53+
fastdds_python_build:
54+
runs-on: ${{ inputs.os-version }}
55+
if: ${{ inputs.run-build == true }}
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
cmake-build-type:
60+
- 'RelWithDebInfo'
61+
steps:
62+
- name: Add ci-pending label if PR
63+
if: ${{ github.event_name == 'pull_request' }}
64+
uses: eProsima/eProsima-CI/external/add_labels@v0
65+
with:
66+
labels: ci-pending
67+
number: ${{ github.event.number }}
68+
repo: eProsima/Fast-DDS-Python
69+
70+
- name: Sync eProsima/Fast-DDS-Python repository
71+
uses: eProsima/eProsima-CI/external/checkout@v0
72+
with:
73+
path: src/fastdds_python
74+
ref: ${{ inputs.fastdds-python-branch }}
75+
76+
- name: Install Fix Python version
77+
uses: eProsima/eProsima-CI/external/setup-python@v0
78+
with:
79+
python-version: '3.11'
80+
81+
- name: Get minimum supported version of CMake
82+
uses: eProsima/eProsima-CI/external/get-cmake@v0
83+
with:
84+
cmakeVersion: '3.22.6'
85+
86+
- name: Install apt dependencies
87+
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
88+
with:
89+
packages: libasio-dev libtinyxml2-dev libssl-dev swig
90+
update: false
91+
upgrade: false
92+
93+
- name: Install colcon
94+
uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0
95+
96+
- name: Install Python dependencies
97+
uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0
98+
with:
99+
packages: vcstool xmlschema
100+
upgrade: false
101+
102+
- name: Get Fast DDS branch
103+
id: get_fastdds_branch
104+
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
105+
with:
106+
remote_repository: eProsima/Fast-DDS
107+
fallback_branch: ${{ inputs.fastdds-branch }}
108+
109+
- name: Download Fast DDS repo
110+
uses: eProsima/eProsima-CI/external/checkout@v0
111+
with:
112+
repository: eProsima/Fast-DDS
113+
path: src/fastdds
114+
ref: ${{ steps.get_fastdds_branch.outputs.deduced_branch }}
115+
116+
- name: Fetch Fast DDS Python dependencies
117+
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
118+
with:
119+
vcs_repos_file: ${{ github.workspace }}/src/fastdds_python/fastdds_python.repos
120+
destination_workspace: src
121+
skip_existing: 'true'
122+
123+
124+
- name: Colcon build
125+
continue-on-error: false
126+
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
127+
with:
128+
colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta
129+
colcon_build_args: ${{ inputs.colcon-args }}
130+
cmake_args: ${{ inputs.cmake-args }}
131+
cmake_args_default: ${{ env.colcon-build-default-cmake-args }}
132+
cmake_build_type: ${{ matrix.cmake-build-type }}
133+
workspace: ${{ github.workspace }}
134+
135+
- name: Upload build artifacts
136+
uses: eProsima/eProsima-CI/external/upload-artifact@v0
137+
with:
138+
name: fastdds_python_build_${{ inputs.label }}
139+
path: ${{ github.workspace }}
140+
141+
fastdds_python_test:
142+
needs: fastdds_python_build
143+
runs-on: ${{ inputs.os-version }}
144+
if: ${{ inputs.run-tests == true }}
145+
strategy:
146+
fail-fast: false
147+
matrix:
148+
cmake-build-type:
149+
- 'RelWithDebInfo'
150+
steps:
151+
- name: Download python build artifacts
152+
uses: eProsima/eProsima-CI/external/download-artifact@v0
153+
with:
154+
name: fastdds_python_build_${{ inputs.label }}
155+
path: ${{ github.workspace }}
156+
157+
- name: Install Fix Python version
158+
uses: eProsima/eProsima-CI/external/setup-python@v0
159+
with:
160+
python-version: '3.11'
161+
162+
- name: Get minimum supported version of CMake
163+
uses: eProsima/eProsima-CI/external/get-cmake@v0
164+
with:
165+
cmakeVersion: '3.22.6'
166+
167+
- name: Install apt packages
168+
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
169+
with:
170+
packages: libasio-dev libtinyxml2-dev libssl-dev swig
171+
172+
- name: Install colcon
173+
uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0
174+
175+
- name: Install Python dependencies
176+
uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0
177+
with:
178+
packages: vcstool xmlschema
179+
180+
- name: Fetch Fast DDS Python CI dependencies
181+
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
182+
with:
183+
vcs_repos_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/test.repos
184+
destination_workspace: src
185+
skip_existing: 'true'
186+
187+
- name: Colcon build
188+
continue-on-error: false
189+
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
190+
with:
191+
colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/test.meta
192+
colcon_build_args: ${{ inputs.colcon-args }}
193+
cmake_args: ${{ inputs.cmake-args }}
194+
cmake_args_default: ''
195+
cmake_build_type: ${{ matrix.cmake-build-type }}
196+
workspace: ${{ github.workspace }}
197+
198+
- name: Colcon test
199+
id: python_test
200+
uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0
201+
with:
202+
colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/test.meta
203+
colcon_test_args: ${{ inputs.colcon-args }}
204+
colcon_test_args_default: --event-handlers=console_direct+
205+
ctest_args: ${{ inputs.ctest-args }}
206+
packages_names: fastdds_python
207+
workspace: ${{ github.workspace }}
208+
workspace_dependencies: ''
209+
test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }}
210+
211+
- name: Fast DDS Python test summary
212+
uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0
213+
if: ${{ !cancelled() }}
214+
with:
215+
junit_reports_dir: "${{ steps.python_test.outputs.ctest_results_path }}"
216+
print_summary: 'True'
217+
show_failed: 'True'
218+
show_disabled: 'False'
219+
show_skipped: 'False'

0 commit comments

Comments
 (0)