Skip to content

Commit e465021

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

3 files changed

Lines changed: 462 additions & 0 deletions

File tree

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

0 commit comments

Comments
 (0)