Skip to content

Commit e1a3c41

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

7 files changed

Lines changed: 314 additions & 40 deletions

File tree

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

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
names:
2+
fastdds:
3+
cmake-args:
4+
- "-DSECURITY=ON"
5+
- "-DLOG_CONSUMER_DEFAULT=STDOUT"

.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: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
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+
defaults:
47+
run:
48+
shell: bash
49+
50+
jobs:
51+
fastdds_python_build:
52+
runs-on: ${{ inputs.os-version }}
53+
if: ${{ inputs.run-build == true }}
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
cmake-build-type:
58+
- 'RelWithDebInfo'
59+
steps:
60+
- name: Add ci-pending label if PR
61+
if: ${{ github.event_name == 'pull_request' }}
62+
uses: eProsima/eProsima-CI/external/add_labels@v0
63+
with:
64+
labels: ci-pending
65+
number: ${{ github.event.number }}
66+
repo: eProsima/Fast-DDS-Python
67+
68+
- name: Sync eProsima/Fast-DDS-Python repository
69+
uses: eProsima/eProsima-CI/external/checkout@v0
70+
with:
71+
path: src/fastdds_python
72+
ref: ${{ inputs.fastdds-python-branch }}
73+
74+
- name: Install Fix Python version
75+
uses: eProsima/eProsima-CI/external/setup-python@v0
76+
with:
77+
python-version: '3.11'
78+
79+
- name: Get minimum supported version of CMake
80+
uses: eProsima/eProsima-CI/external/get-cmake@v0
81+
with:
82+
cmakeVersion: '3.22.6'
83+
84+
- name: Install apt dependencies
85+
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
86+
with:
87+
packages: libasio-dev libtinyxml2-dev libssl-dev swig
88+
update: false
89+
upgrade: false
90+
91+
- name: Install colcon
92+
uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0
93+
94+
- name: Install Python dependencies
95+
uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0
96+
with:
97+
packages: vcstool xmlschema
98+
upgrade: false
99+
100+
- name: Get Fast DDS branch
101+
id: get_fastdds_branch
102+
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
103+
with:
104+
remote_repository: eProsima/Fast-DDS
105+
fallback_branch: ${{ inputs.fastdds-branch }}
106+
107+
- name: Download Fast DDS repo
108+
uses: eProsima/eProsima-CI/external/checkout@v0
109+
with:
110+
repository: eProsima/Fast-DDS
111+
path: src/fastdds
112+
ref: ${{ steps.get_fastdds_branch.outputs.deduced_branch }}
113+
114+
- name: Fetch Fast DDS Python dependencies
115+
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
116+
with:
117+
vcs_repos_file: ${{ github.workspace }}/src/fastdds_python/fastdds_python.repos
118+
destination_workspace: src
119+
skip_existing: 'true'
120+
121+
122+
- name: Colcon build
123+
continue-on-error: false
124+
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
125+
with:
126+
colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta
127+
colcon_build_args: ${{ inputs.colcon-args }}
128+
cmake_args: ${{ inputs.cmake-args }}
129+
cmake_build_type: ${{ matrix.cmake-build-type }}
130+
workspace: ${{ github.workspace }}
131+
132+
- name: Upload build artifacts
133+
uses: eProsima/eProsima-CI/external/upload-artifact@v0
134+
with:
135+
name: fastdds_python_build_${{ inputs.label }}
136+
path: ${{ github.workspace }}
137+
138+
fastdds_python_test:
139+
needs: fastdds_python_build
140+
runs-on: ${{ inputs.os-version }}
141+
if: ${{ inputs.run-tests == true }}
142+
strategy:
143+
fail-fast: false
144+
matrix:
145+
cmake-build-type:
146+
- 'RelWithDebInfo'
147+
steps:
148+
- name: Download python build artifacts
149+
uses: eProsima/eProsima-CI/external/download-artifact@v0
150+
with:
151+
name: fastdds_python_build_${{ inputs.label }}
152+
path: ${{ github.workspace }}
153+
154+
- name: Install Fix Python version
155+
uses: eProsima/eProsima-CI/external/setup-python@v0
156+
with:
157+
python-version: '3.11'
158+
159+
- name: Get minimum supported version of CMake
160+
uses: eProsima/eProsima-CI/external/get-cmake@v0
161+
with:
162+
cmakeVersion: '3.22.6'
163+
164+
- name: Install apt packages
165+
uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
166+
with:
167+
packages: libasio-dev libtinyxml2-dev libssl-dev swig
168+
169+
- name: Install colcon
170+
uses: eProsima/eProsima-CI/ubuntu/install_colcon@v0
171+
172+
- name: Install Python dependencies
173+
uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0
174+
with:
175+
packages: vcstool xmlschema
176+
177+
- name: Fetch Fast DDS Python CI dependencies
178+
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
179+
with:
180+
vcs_repos_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/test.repos
181+
destination_workspace: src
182+
skip_existing: 'true'
183+
184+
- name: Colcon build
185+
continue-on-error: false
186+
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
187+
with:
188+
colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/test.meta
189+
colcon_build_args: ${{ inputs.colcon-args }}
190+
cmake_args: ${{ inputs.cmake-args }}
191+
cmake_args_default: ''
192+
cmake_build_type: ${{ matrix.cmake-build-type }}
193+
workspace: ${{ github.workspace }}
194+
195+
- name: Colcon test
196+
id: python_test
197+
uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0
198+
with:
199+
colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/test.meta
200+
colcon_test_args: ${{ inputs.colcon-args }}
201+
colcon_test_args_default: --event-handlers=console_direct+
202+
ctest_args: ${{ inputs.ctest-args }}
203+
packages_names: fastdds_python
204+
workspace: ${{ github.workspace }}
205+
workspace_dependencies: ''
206+
test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }}
207+
208+
- name: Fast DDS Python test summary
209+
uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0
210+
if: ${{ !cancelled() }}
211+
with:
212+
junit_reports_dir: "${{ steps.python_test.outputs.ctest_results_path }}"
213+
print_summary: 'True'
214+
show_failed: 'True'
215+
show_disabled: 'False'
216+
show_skipped: 'False'

.github/workflows/test.meta

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/ubuntu-ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Fast DDS Python Ubuntu CI
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
os-version:
7+
description: 'OS version to run the workflow'
8+
required: false
9+
default: 'ubuntu-22.04'
10+
type: string
11+
colcon-args:
12+
description: 'Extra arguments for colcon cli'
13+
required: false
14+
type: string
15+
cmake-args:
16+
description: 'Extra arguments for cmake cli'
17+
required: false
18+
type: string
19+
ctest-args:
20+
description: 'Extra arguments for ctest cli'
21+
required: false
22+
type: string
23+
fastdds-python-branch:
24+
description: 'Branch or tag of Fast DDS Python repository'
25+
required: true
26+
type: string
27+
fastdds-branch:
28+
description: 'Branch or tag of Fast DDS repository'
29+
type: string
30+
required: true
31+
run-tests:
32+
description: 'Run test suite of Fast DDS python'
33+
required: false
34+
type: boolean
35+
default: true
36+
37+
pull_request:
38+
types:
39+
- review_requested
40+
paths-ignore:
41+
- '**.md'
42+
- '**.txt'
43+
- '!**/CMakeLists.txt'
44+
45+
concurrency:
46+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
47+
cancel-in-progress: true
48+
49+
jobs:
50+
ubuntu-ci:
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
os-version:
55+
- 'ubuntu-22.04'
56+
fastdds-python-branch:
57+
- '1.4.x'
58+
fastdds-branch:
59+
- '2.14.x'
60+
- '2.13.x'
61+
uses: ./.github/workflows/reusable-ubuntu-ci.yml
62+
with:
63+
# It would be desirable to have a matrix of ubuntu OS for this job, but due to the issue opened in this ticket:
64+
# https://github.com/orgs/community/discussions/128118 , it has been set as a single OS job.
65+
os-version: ${{ inputs.os-version || matrix.os-version }}
66+
label: '${{ matrix.os-version }}-ci-${{ matrix.fastdds-python-branch }}-${{ matrix.fastdds-branch }}'
67+
colcon-args: ${{ inputs.colcon-args }}
68+
cmake-args: ${{ inputs.cmake-args }}
69+
ctest-args: ${{ inputs.ctest-args }}
70+
fastdds-python-branch: ${{ inputs.fastdds-python-branch || github.ref || matrix.fastdds-python-branch }}
71+
fastdds-branch: ${{ inputs.fastdds-branch || matrix.fastdds-branch }}
72+
run-build: ${{ !(github.event_name == 'pull_request') && true || (!contains(github.event.pull_request.labels.*.name, 'skip-ci') && !contains(github.event.pull_request.labels.*.name, 'conflicts')) && true || false }}
73+
run-tests: ${{ ((inputs.run-tests == true) && true) || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'no-test')) && true || false }}

0 commit comments

Comments
 (0)