Skip to content

Commit 9fec4c2

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

3 files changed

Lines changed: 464 additions & 0 deletions

File tree

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Fast DDS Python Windows CI (nightly)
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 1 * * *'
7+
8+
jobs:
9+
# python main - fastdds master
10+
nightly-windows-ci-main:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os-version:
15+
- 'windows-2019'
16+
vs-toolset:
17+
- 'v142'
18+
fastdds-python-branch:
19+
- 'main'
20+
fastdds-branch:
21+
- 'master'
22+
uses: eProsima/Fast-DDS-Python/.github/workflows/reusable-windows-ci.yml@main
23+
with:
24+
os-version: ${{ matrix.os-version }}
25+
vs.toolset: ${{ matrix.vs-toolset }}
26+
label: 'nightly-${{ matrix.os-version }}-${{ matrix.vs-toolset }}-ci-${{ matrix.fastdds-python-branch }}'
27+
fastdds-python-branch: ${{ matrix.fastdds-python-branch }}
28+
fastdds-branch: ${{ matrix.fastdds-branch }}
29+
run-build: true
30+
run-tests: true
31+
32+
# python 1.4.x - fastdds 2.14.x/2.13.x
33+
nightly-windows-ci-1_4_x:
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
include:
38+
- os-version: 'windows-2019'
39+
vs-toolset: 'v142'
40+
41+
- os-version: 'windows-2017'
42+
vs-toolset: 'v141'
43+
fastdds-python-branch:
44+
- '1.4.x'
45+
fastdds-branch:
46+
- '2.14.x'
47+
- '2.13.x'
48+
uses: eProsima/Fast-DDS-Python/.github/workflows/reusable-windows-ci.yml@1.4.x
49+
with:
50+
os-version: ${{ matrix.os-version }}
51+
vs.toolset: ${{ matrix.vs-toolset }}
52+
label: 'nightly-${{ matrix.os-version }}-${{ matrix.vs-toolset }}-ci-${{ matrix.fastdds-python-branch }}-${{ matrix.fastdds-branch }}'
53+
fastdds-python-branch: ${{ matrix.fastdds-python-branch }}
54+
fastdds-branch: ${{ matrix.fastdds-branch }}
55+
run-build: true
56+
run-tests: true
57+
58+
# python 1.2.x - fastdds 2.10.x
59+
nightly-windows-ci-1_2_x:
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
include:
64+
- os-version: 'windows-2019'
65+
vs-toolset: 'v142'
66+
67+
- os-version: 'windows-2017'
68+
vs-toolset: 'v141'
69+
fastdds-python-branch:
70+
- '1.2.x'
71+
fastdds-branch:
72+
- '2.10.x'
73+
uses: eProsima/Fast-DDS-Python/.github/workflows/reusable-windows-ci.yml@1.2.x
74+
with:
75+
os-version: ${{ matrix.os-version }}
76+
vs.toolset: ${{ matrix.vs-toolset }}
77+
label: 'nightly-${{ matrix.os-version }}-${{ matrix.vs-toolset }}-ci-${{ matrix.fastdds-python-branch }}'
78+
fastdds-python-branch: ${{ matrix.fastdds-python-branch }}
79+
fastdds-branch: ${{ matrix.fastdds-branch }}
80+
run-build: true
81+
run-tests: true
82+
83+
# python 1.0.x - fastdds 2.6.x
84+
nightly-windows-ci-1_0_x:
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
include:
89+
- os-version: 'windows-2019'
90+
vs-toolset: 'v142'
91+
92+
- os-version: 'windows-2017'
93+
vs-toolset: 'v141'
94+
fastdds-python-branch:
95+
- '1.0.x'
96+
fastdds-branch:
97+
- '2.6.x'
98+
uses: eProsima/Fast-DDS-Python/.github/workflows/reusable-windows-ci.yml@1.0.x
99+
with:
100+
os-version: ${{ matrix.os-version }}
101+
vs.toolset: ${{ matrix.vs-toolset }}
102+
label: 'nightly-${{ matrix.os-version }}-${{ matrix.vs-toolset }}-ci-${{ matrix.fastdds-python-branch }}'
103+
fastdds-python-branch: ${{ matrix.fastdds-python-branch }}
104+
fastdds-branch: ${{ matrix.fastdds-branch }}
105+
run-build: true
106+
run-tests: false
Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,285 @@
1+
name: Fast DDS Python Windows 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: 'windows-2019'
10+
type: string
11+
vs-toolset:
12+
description: 'The VS toolset to use for the build'
13+
required: false
14+
default: 'v142'
15+
type: string
16+
label:
17+
description: 'ID associated to the workflow'
18+
required: true
19+
type: string
20+
colcon-args:
21+
description: 'Extra arguments for colcon cli'
22+
required: false
23+
type: string
24+
cmake-args:
25+
description: 'Extra arguments for cmake cli'
26+
required: false
27+
type: string
28+
ctest-args:
29+
description: 'Extra arguments for ctest cli'
30+
required: false
31+
type: string
32+
fastdds-python-branch:
33+
description: 'Branch or tag of Fast DDS Python repository'
34+
required: true
35+
type: string
36+
fastdds-branch:
37+
description: 'Branch or tag of Fast DDS repository'
38+
required: true
39+
type: string
40+
run-build:
41+
description: 'Build Fast DDS Python (CI skipped otherwise)'
42+
required: false
43+
type: boolean
44+
default: true
45+
run-tests:
46+
description: 'Run test suite of Fast DDS python'
47+
required: false
48+
type: boolean
49+
default: true
50+
env:
51+
colcon-build-default-cmake-args: '-DTHIRDPARTY_Asio=FORCE -DTHIRDPARTY_TinyXML2=FORCE -DTHIRDPARTY_fastcdr=OFF -DTHIRDPARTY_UPDATE=ON -DEPROSIMA_EXTRA_CMAKE_CXX_FLAGS="/MP /WX"'
52+
defaults:
53+
run:
54+
shell: pwsh
55+
56+
jobs:
57+
fastdds_python_build:
58+
runs-on: ${{ inputs.os-version }}
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
cmake-build-type:
63+
- 'RelWithDebInfo'
64+
65+
steps:
66+
- name: Add ci-pending label if PR
67+
if: ${{ github.event_name == 'pull_request' }}
68+
uses: eProsima/eProsima-CI/external/add_labels@v0
69+
with:
70+
labels: ci-pending
71+
number: ${{ github.event.number }}
72+
repo: eProsima/Fast-DDS
73+
74+
- name: Sync eProsima/Fast-DDS-Python repository
75+
uses: eProsima/eProsima-CI/external/checkout@v0
76+
with:
77+
path: src/fastdds_python
78+
ref: ${{ inputs.fastdds-python-branch }}
79+
80+
- name: Install Fix Python version
81+
uses: eProsima/eProsima-CI/external/setup-python@v0
82+
with:
83+
python-version: '3.11'
84+
85+
- name: Get minimum supported version of CMake
86+
uses: eProsima/eProsima-CI/external/get-cmake@v0
87+
with:
88+
cmakeVersion: '3.22.6'
89+
90+
- name: Install OpenSSL
91+
uses: eProsima/eprosima-CI/windows/install_openssl@v0
92+
with:
93+
version: '3.1.1'
94+
95+
- name: Update OpenSSL environment variables
96+
run: |
97+
# Update the environment
98+
if (Test-Path -Path $Env:ProgramW6432\OpenSSL)
99+
{
100+
"OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM
101+
}
102+
elseif (Test-Path -Path $Env:ProgramW6432\OpenSSL-Win)
103+
{
104+
"OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL-Win" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM
105+
}
106+
elseif (Test-Path -Path $Env:ProgramW6432\OpenSSL-Win64)
107+
{
108+
"OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL-Win64" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM
109+
}
110+
else
111+
{
112+
Write-Error -Message "Cannot find OpenSSL installation."
113+
exit 1
114+
}
115+
116+
- name: Install colcon
117+
uses: eProsima/eProsima-CI/windows/install_colcon@v0
118+
119+
- name: Install Python dependencies
120+
uses: eProsima/eProsima-CI/windows/install_python_packages@v0
121+
with:
122+
packages: vcstool xmlschema pywin32
123+
124+
- name: Install swig
125+
shell: pwsh
126+
run: choco install swig --allow-downgrade --version=4.0.2.04082020
127+
128+
# Although this is a ubuntu action becuase it uses bash, it is compatible with windows
129+
- name: Get Fast DDS branch
130+
id: get_fastdds_branch
131+
uses: eProsima/eProsima-CI/ubuntu/get_related_branch_from_repo@v0
132+
with:
133+
remote_repository: eProsima/Fast-DDS
134+
fallback_branch: ${{ inputs.fastdds-branch }}
135+
136+
- name: Download Fast DDS repo
137+
uses: eProsima/eProsima-CI/external/checkout@v0
138+
with:
139+
repository: eProsima/Fast-DDS
140+
path: src/fastdds
141+
ref: ${{ steps.get_fastdds_branch.outputs.deduced_branch }}
142+
143+
- name: Fetch Fast DDS Python dependencies
144+
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
145+
with:
146+
vcs_repos_file: ${{ github.workspace }}/src/fastdds_python/fastdds_python.repos
147+
destination_workspace: src
148+
skip_existing: 'true'
149+
150+
- name: Colcon build
151+
continue-on-error: false
152+
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
153+
with:
154+
colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build.meta
155+
colcon_build_args: ${{ inputs.colcon-args }}
156+
colcon_build_args_default: --event-handlers console_direct+ desktop_notification-
157+
cmake_args: ${{ inputs.cmake-args }}
158+
cmake_args_default: '-T ${{ inputs.vs-toolset }} ${{ env.colcon-build-default-cmake-args }}'
159+
cmake_build_type: ${{ matrix.cmake-build-type }}
160+
workspace: ${{ github.workspace }}
161+
162+
- name: Upload build artifacts
163+
uses: eProsima/eProsima-CI/external/upload-artifact@v0
164+
with:
165+
name: fastdds_python_build_${{ inputs.label }}
166+
path: ${{ github.workspace }}
167+
168+
169+
fastdds_python_test:
170+
needs: fastdds_python_build
171+
runs-on: ${{ inputs.os-version }}
172+
if: ${{ inputs.run-tests == true }}
173+
strategy:
174+
fail-fast: false
175+
matrix:
176+
cmake-build-type:
177+
- 'RelWithDebInfo'
178+
steps:
179+
- name: Download python build artifacts
180+
uses: eProsima/eProsima-CI/external/download-artifact@v0
181+
with:
182+
name: fastdds_python_build_${{ inputs.label }}
183+
path: ${{ github.workspace }}
184+
185+
- name: Install Fix Python version
186+
uses: eProsima/eProsima-CI/external/setup-python@v0
187+
with:
188+
python-version: '3.11'
189+
190+
- name: Get minimum supported version of CMake
191+
uses: eProsima/eProsima-CI/external/get-cmake@v0
192+
with:
193+
cmakeVersion: '3.22.6'
194+
195+
- name: Install OpenSSL
196+
uses: eProsima/eprosima-CI/windows/install_openssl@v0
197+
with:
198+
version: '3.1.1'
199+
200+
- name: Update OpenSSL environment variables
201+
run: |
202+
# Update the environment
203+
if (Test-Path -Path $Env:ProgramW6432\OpenSSL)
204+
{
205+
"OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM
206+
}
207+
elseif (Test-Path -Path $Env:ProgramW6432\OpenSSL-Win)
208+
{
209+
"OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL-Win" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM
210+
}
211+
elseif (Test-Path -Path $Env:ProgramW6432\OpenSSL-Win64)
212+
{
213+
"OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL-Win64" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM
214+
}
215+
else
216+
{
217+
Write-Error -Message "Cannot find OpenSSL installation."
218+
exit 1
219+
}
220+
221+
- name: Install colcon
222+
uses: eProsima/eProsima-CI/windows/install_colcon@v0
223+
224+
- name: Install Python dependencies
225+
uses: eProsima/eProsima-CI/windows/install_python_packages@v0
226+
with:
227+
packages: vcstool xmlschema pywin32 pytest
228+
229+
- name: Install swig
230+
shell: pwsh
231+
run: choco install swig --allow-downgrade --version=4.0.2.04082020
232+
233+
234+
- name: Prepare build meta file
235+
run: |
236+
$build_meta_file = '${{ github.workspace }}\src\fastdds_python\.github\workflows\config\build.meta'
237+
$test_meta_file = '${{ github.workspace }}\src\fastdds_python\.github\workflows\config\test.meta'
238+
$build_test_meta_file = '${{ github.workspace }}\src\fastdds_python\.github\workflows\config\build_test.meta'
239+
240+
# Read the content of the build meta file
241+
$build_meta_content = Get-Content -Path $build_meta_file
242+
243+
# Read the content of the test meta file, starting from line 4 (skipping "name" line [1], cmake project name line [2] and "cmake-args" line [3])
244+
$test_meta_content = Get-Content -Path $test_meta_file | Select-Object -Skip 3
245+
246+
# Combine the content of the build meta file and the test meta file
247+
$combined_content = $build_meta_content + $test_meta_content
248+
249+
# Write the combined content to the build test meta file
250+
$combined_content | Out-File -FilePath $build_test_meta_file -Encoding UTF8
251+
252+
- name: Colcon build
253+
continue-on-error: false
254+
uses: eProsima/eProsima-CI/multiplatform/colcon_build@v0
255+
with:
256+
colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/build_test.meta
257+
colcon_build_args: ${{ inputs.colcon-args }}
258+
colcon_build_args_default: --event-handlers console_direct+ desktop_notification-
259+
cmake_args: ${{ inputs.cmake-args }}
260+
cmake_args_default: '-T ${{ inputs.vs-toolset }} ${{ env.colcon-build-default-cmake-args }}'
261+
cmake_build_type: ${{ matrix.cmake-build-type }}
262+
workspace: ${{ github.workspace }}
263+
264+
- name: Colcon test
265+
id: python_test
266+
uses: eProsima/eProsima-CI/multiplatform/colcon_test@v0
267+
with:
268+
colcon_meta_file: ${{ github.workspace }}/src/fastdds_python/.github/workflows/config/test.meta
269+
colcon_test_args: ${{ inputs.colcon-args }}
270+
colcon_test_args_default: --event-handlers=console_direct+ desktop_notification-
271+
ctest_args: ${{ inputs.ctest-args }}
272+
packages_names: fastdds_python
273+
workspace: ${{ github.workspace }}
274+
workspace_dependencies: ''
275+
test_report_artifact: ${{ format('test_report_{0}_{1}_{2}', inputs.label, github.job, join(matrix.*, '_')) }}
276+
277+
- name: Test summary
278+
uses: eProsima/eProsima-CI/multiplatform/junit_summary@v0
279+
if: ${{ !cancelled() }}
280+
with:
281+
junit_reports_dir: "${{ steps.python_test.outputs.ctest_results_path }}"
282+
print_summary: 'True'
283+
show_failed: 'True'
284+
show_disabled: 'False'
285+
show_skipped: 'False'

0 commit comments

Comments
 (0)