-
Notifications
You must be signed in to change notification settings - Fork 14
162 lines (137 loc) · 4.87 KB
/
build_and_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: test
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
schedule:
- cron: '0 0 * * *'
jobs:
windows-build-test:
runs-on: windows-2019
env:
CXXFLAGS: /MP
OPENSSL64_ROOT: "C:/Program Files/OpenSSL-Win64"
steps:
- name: install OpenSSL
shell: pwsh
run: |
choco install openssl -yr --no-progress
"System32;SysWoW64" -split ";" | Join-Path -Path $env:windir -ChildPath {$_} `
| ls -Include libssl-*.dll | rm
- name: install swig
shell: pwsh
run: choco install swig --allow-downgrade --version=4.0.2.04082020
- name: Install python build dependencies
shell: pwsh
run: >
pip install -U colcon-common-extensions colcon-mixin vcstool;
- name: Install python tests dependencies
shell: pwsh
run: |
cd (ni -Type Directory -Path "$Env:TMP\$(New-Guid)")
$cr = "`n"
'cmake_minimum_required(VERSION 3.5)' + $cr +
'project(dummy VERSION 1.0.0 LANGUAGES CXX)' + $cr +
'find_package (Python3 COMPONENTS Interpreter Development REQUIRED)' + $cr +
'message(STATUS "cmake detected python=>>>>>${Python3_EXECUTABLE}<<<<<<")' |
Out-File CMakeLists.txt
(cmake .) *>&1 | % {
if($_ -Match "cmake detected python=>>>>>(?<exec>.*)<<<<<<")
{
$python_exec = $Matches.exec
return
}
}
& $python_exec -m pip install -U pytest pywin32
- uses: actions/checkout@v2
with:
path: src/fastdds_python
- name: Fetch repositories
shell: pwsh
run: |
vcs import src --skip-existing --input src/fastdds_python/fastdds_python.repos
- name: Get minimum supported version of CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.22.6
- name: Use cmake
run: cmake --version
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
windows_compile_environment: msvc
- name: Build workspace
shell: pwsh
run: |
$installpath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
$modulepath = "$installpath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
Import-Module $modulepath
Enter-VsDevShell -SetDefaultWindowTitle -InstallPath $installpath `
-StartInPath (pwd) -DevCmdArguments '/arch=x64 /host_arch=x64';
colcon build --executor parallel --event-handlers console_direct+ desktop_notification- `
--metas ./src/fastdds_python/.github/workflows/test.meta `
--cmake-args -DCMAKE_C_COMPILER_LAUNCHER="${{ env.ccache_symlinks_path }}" `
-DCMAKE_CXX_COMPILER_LAUNCHER="${{ env.ccache_symlinks_path }}"
- name: Run tests
shell: pwsh
run: |
colcon test --packages-select fastdds_python --event-handlers console_direct+ desktop_notification- `
--return-code-on-test-failure --ctest-args --timeout 60
- name: Upload Logs
uses: actions/upload-artifact@v1
with:
name: colcon-logs-windows
path: log/
if: always()
ubuntu-build-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
path: src/fastdds_python
- name: Install apt dependencies
run: |
sudo apt update
sudo apt install -y \
python3 \
python3-pip \
swig \
libpython3-dev
- name: Install python dependencies
run: |
sudo pip3 install -U \
vcstool \
colcon-common-extensions
- name: Fetch repositories
run: |
vcs import --skip-existing src < src/fastdds_python/fastdds_python.repos
- name: Get minimum supported version of CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.22.6
- name: Use cmake
run: cmake --version
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
- name: Build workspace
run: >
colcon build --event-handlers=console_direct+ --metas ./src/fastdds_python/.github/workflows/test.meta \
--cmake-args -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Run tests
run: |
source install/setup.bash && \
colcon test \
--packages-select fastdds_python \
--event-handlers=console_direct+ \
--return-code-on-test-failure \
--ctest-args \
--output-on-failure \
--timeout 60
- name: Upload Logs
uses: actions/upload-artifact@v1
with:
name: colcon-logs-ubuntu
path: log/
if: always()