@@ -2,80 +2,140 @@ name: test
22
33on :
44 workflow_dispatch :
5+ inputs :
6+ foonathan_memory_vendor_branch :
7+ description : ' foonathan_memory_vendor branch to be used'
8+ required : false
9+ default : ' master'
10+ fastcdr_version :
11+ description : ' Fast CDR branches to be used'
12+ required : false
13+ default : ' 1.1.x'
14+ fastdds_branch :
15+ description : ' Fast DDS branch to be used'
16+ required : false
17+ default : ' 2.11.x'
518 pull_request :
619 push :
720 branches :
8- - main
21+ - 1.2.x
922 schedule :
1023 - cron : ' 0 0 * * *'
1124
25+ concurrency :
26+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
27+ cancel-in-progress : true
28+
1229jobs :
1330 windows-build-test :
1431 runs-on : windows-2019
32+ strategy :
33+ fail-fast : false
34+ matrix :
35+ foonathan_memory_vendor_version :
36+ - ${{ github.event.inputs.foonathan_memory_vendor_branch || 'master' }}
37+ fastcdr_version :
38+ - ${{ github.event.inputs.fastcdr_version || '1.1.x' }}
39+ fastdds_version :
40+ - ${{ github.event.inputs.fastdds_branch || '2.11.x' }}
1541
1642 env :
1743 CXXFLAGS : /MP
1844 OPENSSL64_ROOT : " C:/Program Files/OpenSSL-Win64"
1945
2046 steps :
2147
22- - name : install OpenSSL
48+ - uses : eProsima/eProsima-CI/windows/install_openssl@v0
49+
50+ - name : Install Asio and TinyXML2
2351 shell : pwsh
2452 run : |
25- choco install openssl -yr --no-progress
26- "System32;SysWoW64" -split ";" | Join-Path -Path $env:windir -ChildPath {$_} `
27- | ls -Include libssl-*.dll | rm
28-
29- - name : Install python build dependencies
53+ mkdir "$pwdpath/choco_packages"
54+ Invoke-WebRequest -Uri https://github.com/ros2/choco-packages/releases/download/2020-02-24/asio.1.12.1.nupkg -OutFile "$pwdpath/choco_packages/asio.1.12.1.nupkg"
55+ Invoke-WebRequest -Uri https://github.com/ros2/choco-packages/releases/download/2020-02-24/tinyxml2.6.0.0.nupkg -OutFile "$pwdpath/choco_packages/tinyxml2.6.0.0.nupkg"
56+ choco install -y -s "$pwdpath/choco_packages" asio tinyxml2
57+ Set-Item -Force -Path "env:PATH" -Value "C:\ProgramData\chocolatey\lib\asio;C:\ProgramData\chocolatey\lib\tinyxml2;C:\ProgramData\chocolatey\lib\tinyxml2\lib;$env:PATH"
58+ echo "PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
59+
60+ - name : Install swig
3061 shell : pwsh
31- run : >
32- pip install -U colcon-common-extensions colcon-mixin vcstool;
62+ run : choco install swig --allow-downgrade --version=4.0.2.04082020
3363
34- - name : Install python tests dependencies
35- shell : pwsh
36- run : |
37- cd (ni -Type Directory -Path "$Env:TMP\$(New-Guid)")
38- $cr = "`n"
39- 'cmake_minimum_required(VERSION 3.5)' + $cr +
40- 'project(dummy VERSION 1.0.0 LANGUAGES CXX)' + $cr +
41- 'find_package (Python3 COMPONENTS Interpreter Development REQUIRED)' + $cr +
42- 'message(STATUS "cmake detected python=>>>>>${Python3_EXECUTABLE}<<<<<<")' |
43- Out-File CMakeLists.txt
44- (cmake .) *>&1 | % {
45- if($_ -Match "cmake detected python=>>>>>(?<exec>.*)<<<<<<")
46- {
47- $python_exec = $Matches.exec
48- return
49- }
50- }
51- & $python_exec -m pip install -U pytest pywin32
52-
53- - uses : actions/checkout@v2
64+ - name : Setup Python version
65+ uses : eProsima/eProsima-CI/external/setup-python@v0
66+ with :
67+ python-version : ' 3.11'
68+
69+ - name : Install Python dependencies
70+ uses : eProsima/eProsima-CI/multiplatform/install_python_packages@v0
71+ with :
72+ packages : pytest pywin32
73+
74+ - name : Install colcon
75+ uses : eProsima/eProsima-CI/multiplatform/install_colcon@v0
76+
77+ - name : Checkout Fast DDS Python
78+ uses : eProsima/eProsima-CI/external/checkout@v0
5479 with :
5580 path : src/fastdds_python
5681
57- - name : Fetch repositories
82+ - name : Checkout foonathan memory vendor
83+ uses : eProsima/eProsima-CI/external/checkout@v0
84+ with :
85+ repository : eProsima/foonathan_memory_vendor
86+ path : src/foonathan_memory_vendor
87+ ref : ${{ matrix.foonathan_memory_vendor_version }}
88+
89+ - name : Checkout Fast CDR
90+ uses : eProsima/eProsima-CI/external/checkout@v0
91+ with :
92+ repository : eProsima/Fast-CDR
93+ path : src/fastcdr
94+ ref : ${{ matrix.fastcdr_version }}
95+
96+ - name : Checkout Fast DDS
97+ uses : eProsima/eProsima-CI/external/checkout@v0
98+ with :
99+ repository : eProsima/Fast-DDS
100+ path : src/fastdds
101+ ref : ${{ matrix.fastdds_version }}
102+
103+ - name : Setup CMake version
104+ uses : eProsima/eProsima-CI/external/get-cmake@v0
105+ with :
106+ cmakeVersion : 3.22.6
107+
108+ - name : Setting ninja
109+ id : ninja
110+ if : github.event.schedule == ''
58111 shell : pwsh
59112 run : |
60- vcs import src --skip-existing --input src/fastdds_python/fastdds_python.repos
113+ echo "cmake_generator=ninja" >> $Env:GITHUB_OUTPUT
114+
115+ - name : Setup ccache
116+ uses : eProsima/eProsima-CI/external/setup-ccache-action@v0
117+ with :
118+ windows_compile_environment : msvc
61119
62120 - name : Build workspace
63- shell : pwsh
64- run : |
65- $installpath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
66- $modulepath = "$installpath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
67- Import-Module $modulepath
68- Enter-VsDevShell -SetDefaultWindowTitle -InstallPath $installpath `
69- -DevCmdArguments '/arch=x64 /host_arch=x64';
70- $cargs = @("--event-handlers=console_direct+", `
71- "--metas", "./src/fastdds_python/.github/workflows/test.meta")
72- colcon build --executor parallel $cargs
121+ uses : eProsima/eProsima-CI/windows/colcon_build@v0
122+ with :
123+ colcon_meta_file : ./src/fastdds_python/.github/workflows/test.meta
124+ colcon_build_args : --executor parallel --mixin ccache ${{ steps.ninja.outputs.cmake_generator }}
125+ colcon_build_args_default : --event-handlers console_direct+ desktop_notification-
126+ cmake_build_type : RelWithDebInfo
127+ cmake_args_default : ' '
128+ workspace : ${{ github.workspace }}
73129
74130 - name : Run tests
75- shell : pwsh
76- run : |
77- colcon test --packages-select fastdds_python --event-handlers=console_direct+ `
78- --return-code-on-test-failure --ctest-args --timeout 60
131+ id : test
132+ uses : eProsima/eProsima-CI/multiplatform/colcon_test@v0
133+ with :
134+ colcon_test_args : --packages-select fastdds_python --return-code-on-test-failure
135+ colcon_test_args_default : --event-handlers console_direct+ desktop_notification-
136+ ctest_args_default : --timeout 60
137+ workspace : ${{ github.workspace }}
138+ workspace_dependencies : ${{ github.workspace }}
79139
80140 - name : Upload Logs
81141 uses : actions/upload-artifact@v1
@@ -85,46 +145,79 @@ jobs:
85145 if : always()
86146
87147 ubuntu-build-test :
88- runs-on : ubuntu-20.04
148+ runs-on : ubuntu-22.04
149+ strategy :
150+ fail-fast : false
151+ matrix :
152+ foonathan_memory_vendor_version :
153+ - ${{ github.event.inputs.foonathan_memory_vendor_branch || 'master' }}
154+ fastcdr_version :
155+ - ${{ github.event.inputs.fastcdr_version || '1.1.x' }}
156+ fastdds_version :
157+ - ${{ github.event.inputs.fastdds_branch || '2.11.x' }}
158+
89159
90160 steps :
91- - uses : actions/checkout@v2
161+ - name : Checkout Fast DDS Python
162+ uses : eProsima/eProsima-CI/external/checkout@v0
92163 with :
93164 path : src/fastdds_python
94165
95166 - name : Install apt dependencies
96- run : |
97- sudo apt update
98- sudo apt install -y \
99- python3 \
100- python3-pip \
101- swig \
102- libpython3-dev
103-
104- - name : Install python dependencies
105- run : |
106- sudo pip3 install -U \
107- vcstool \
108- colcon-common-extensions
167+ uses : eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
168+ with :
169+ packages : libasio-dev libtinyxml2-dev libpython3-dev swig
109170
110- - name : Fetch repositories
111- run : |
112- vcs import --skip-existing src < src/fastdds_python/fastdds_python.repos
171+ - name : Install colcon
172+ uses : eProsima/eProsima-CI/multiplatform/install_colcon@v0
173+
174+ - name : Checkout foonathan memory vendor
175+ uses : eProsima/eProsima-CI/external/checkout@v0
176+ with :
177+ repository : eProsima/foonathan_memory_vendor
178+ path : src/foonathan_memory_vendor
179+ ref : ${{ matrix.foonathan_memory_vendor_version }}
180+
181+ - name : Checkout Fast CDR
182+ uses : eProsima/eProsima-CI/external/checkout@v0
183+ with :
184+ repository : eProsima/Fast-CDR
185+ path : src/fastcdr
186+ ref : ${{ matrix.fastcdr_version }}
187+
188+ - name : Checkout Fast DDS
189+ uses : eProsima/eProsima-CI/external/checkout@v0
190+ with :
191+ repository : eProsima/Fast-DDS
192+ path : src/fastdds
193+ ref : ${{ matrix.fastdds_version }}
194+
195+ - name : Setup CMake version
196+ uses : eProsima/eProsima-CI/external/get-cmake@v0
197+ with :
198+ cmakeVersion : 3.22.6
199+
200+ - name : Setup ccache
201+ uses : eProsima/eProsima-CI/external/setup-ccache-action@v0
113202
114203 - name : Build workspace
115- run : >
116- colcon build --event-handlers=console_direct+ --metas ./src/fastdds_python/.github/workflows/test.meta
204+ uses : eProsima/eProsima-CI/multiplatform/colcon_build@v0
205+ with :
206+ colcon_meta_file : ./src/fastdds_python/.github/workflows/test.meta
207+ colcon_build_args : --executor parallel --mixin ccache
208+ colcon_build_args_default : --event-handlers console_direct+
209+ cmake_build_type : RelWithDebInfo
210+ cmake_args_default : ' '
211+ workspace : ${{ github.workspace }}
117212
118213 - name : Run tests
119- run : |
120- source install/setup.bash && \
121- colcon test \
122- --packages-select fastdds_python \
123- --event-handlers=console_direct+ \
124- --return-code-on-test-failure \
125- --ctest-args \
126- --output-on-failure \
127- --timeout 60
214+ id : test
215+ uses : eProsima/eProsima-CI/multiplatform/colcon_test@v0
216+ with :
217+ colcon_test_args : --packages-select fastdds_python --return-code-on-test-failure
218+ colcon_test_args_default : --event-handlers console_direct+
219+ ctest_args_default : --timeout 60
220+ workspace : ${{ github.workspace }}
128221
129222 - name : Upload Logs
130223 uses : actions/upload-artifact@v1
0 commit comments