-
Notifications
You must be signed in to change notification settings - Fork 20
292 lines (288 loc) · 11.5 KB
/
Copy pathbuild.yml
File metadata and controls
292 lines (288 loc) · 11.5 KB
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
name: "node-opendds CI"
on:
pull_request:
branches:
- master
push:
branches:
- master
schedule:
- cron: '10 0 * * 0'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: 'Set Up node'
uses: actions/setup-node@v6
with:
node-version: 20
cache: 'npm'
- run: npm install --include=dev --ignore-scripts
- name: 'Lint JS'
run: npm run lint:js
- name: 'Check C++ Formatting'
run: npm run lint:cpp
build:
needs: lint
strategy:
fail-fast: false
matrix:
node_version:
- 20
- 22
- 24
opendds_branch:
- master
- latest-release
m:
- {os: ubuntu-22.04, dds_security: 1}
- {os: ubuntu-22.04, dds_security: 0}
- {os: macos-14, dds_security: 1}
- {os: macos-14, dds_security: 0}
- {os: windows-2022, dds_security: 1}
- {os: windows-2022, dds_security: 0}
runs-on: ${{ matrix.m.os }}
steps:
- uses: actions/checkout@v7
- name: 'Checkout MPC'
uses: actions/checkout@v7
with:
repository: DOCGroup/MPC
path: MPC
fetch-depth: 1
- name: 'Checkout ACE_TAO'
uses: actions/checkout@v7
with:
repository: DOCGroup/ACE_TAO
ref: ace6tao2
path: ACE_TAO
fetch-depth: 1
- name: 'Checkout OpenDDS'
uses: actions/checkout@v7
with:
repository: OpenDDS/OpenDDS
ref: ${{ matrix.opendds_branch }}
path: OpenDDS
fetch-depth: 1
- name: 'Set Up node'
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node_version }}
cache: 'npm'
- name: 'Get Repository SHAs'
id: get-shas
shell: bash
run: |
echo "opendds_sha=$(cd OpenDDS && git rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "acetao_sha=$(cd ACE_TAO && git rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "mpc_sha=$(cd MPC && git rev-parse HEAD)" >> $GITHUB_OUTPUT
- name: 'Cache OpenDDS Build'
uses: actions/cache@v6
id: cache-opendds
with:
path: |
ACE_TAO
OpenDDS
MPC
key: opendds-build-${{ matrix.m.os }}-${{ matrix.opendds_branch }}-sec${{ matrix.m.dds_security }}-${{ steps.get-shas.outputs.opendds_sha }}-${{ steps.get-shas.outputs.acetao_sha }}
- name: 'Install xerces (ubuntu)'
if: ${{ matrix.m.dds_security == 1 && matrix.m.os == 'ubuntu-22.04' }}
run: |-
sudo apt-get update
sudo apt-get -y install libxerces-c-dev
- name: 'Install xerces (macos)'
if: ${{ matrix.m.dds_security == 1 && matrix.m.os == 'macos-14' }}
run: |
brew install xerces-c
- name: Setup for run-vcpkg
if: ${{ matrix.m.dds_security == 1 && matrix.m.os == 'windows-2022' }}
shell: cmd
run: |
echo { "name": "opendds", "version-string": "github-actions", "dependencies": [ "openssl", "xerces-c" ] } > vcpkg.json
echo VCPKG_DEFAULT_TRIPLET=x64-windows>> %GITHUB_ENV%
echo VCPKG_INSTALLED_DIR=${{ github.workspace }}\vcpkg\installed>> %GITHUB_ENV%
- name: 'Install openssl and xerces (windows)'
if: ${{ matrix.m.dds_security == 1 && matrix.m.os == 'windows-2022' }}
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
vcpkgGitCommitId: 940f58770cee8e2011bfb4847fb2bd70057301a8
runVcpkgInstall: true
- name: 'Set Up MSVC Environment'
if: ${{ matrix.m.os == 'windows-2022' }}
uses: ilammy/msvc-dev-cmd@v1
- name: 'Set Up Problem Matcher (windows)'
if: ${{ matrix.m.os == 'windows-2022' }}
uses: ammaraskar/msvc-problem-matcher@0.3.0
- name: 'Set Up Problem Matcher (ubuntu / macos)'
if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-14' }}
uses: ammaraskar/gcc-problem-matcher@0.3.0
- name: 'Set environment variables (ubuntu / macos)'
if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-14' }}
shell: bash
run: |-
echo "ACE_ROOT=$GITHUB_WORKSPACE/ACE_TAO/ACE" >> $GITHUB_ENV
echo "TAO_ROOT=$GITHUB_WORKSPACE/ACE_TAO/TAO" >> $GITHUB_ENV
echo "DDS_ROOT=$GITHUB_WORKSPACE/OpenDDS" >> $GITHUB_ENV
echo "MPC_ROOT=$GITHUB_WORKSPACE/MPC" >> $GITHUB_ENV
echo "npm_config_devdir=$GITHUB_WORKSPACE/opendds-node-gyp-devdir" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/ACE_TAO/ACE/lib:$GITHUB_WORKSPACE/OpenDDS/lib" >> $GITHUB_ENV
CONFIG_OPTIONS+=" --std=c++14"
if [ ${{ matrix.m.dds_security }} == 1 ]; then
CONFIG_OPTIONS+=" --security"
BUILD_TARGETS+=" OpenDDS_Security"
if [ '${{ matrix.m.os }}' == 'macos-14' ]; then
CONFIG_OPTIONS+=" --xerces3=$(brew --prefix xerces-c) --openssl=$(brew --prefix openssl@3)"
fi
fi
echo "CONFIG_OPTIONS=$CONFIG_OPTIONS" >> $GITHUB_ENV
echo "BUILD_TARGETS=DCPSInfoRepo_Main OpenDDS_Rtps_Udp$BUILD_TARGETS" >> $GITHUB_ENV
- name: 'Set environment variables (windows)'
if: ${{ matrix.m.os == 'windows-2022' }}
shell: bash
run: |-
echo "ACE_ROOT=$GITHUB_WORKSPACE\\ACE_TAO\\ACE" >> $GITHUB_ENV
echo "TAO_ROOT=$GITHUB_WORKSPACE\\ACE_TAO\\TAO" >> $GITHUB_ENV
echo "DDS_ROOT=$GITHUB_WORKSPACE\\OpenDDS" >> $GITHUB_ENV
echo "MPC_ROOT=$GITHUB_WORKSPACE\\MPC" >> $GITHUB_ENV
echo "npm_config_devdir=$GITHUB_WORKSPACE\\opendds-node-gyp-devdir" >> $GITHUB_ENV
if [ ${{ matrix.m.dds_security }} == 1 ]; then
CONFIG_OPTIONS+=" --security"
CONFIG_OPTIONS+=" --xerces3=$VCPKG_INSTALLED_DIR\\x64-windows --openssl=$VCPKG_INSTALLED_DIR\\x64-windows"
BUILD_TARGETS+=";OpenDDS_Security"
fi
echo "CONFIG_OPTIONS=$CONFIG_OPTIONS" >> $GITHUB_ENV
echo "BUILD_TARGETS=DCPSInfoRepo_Main;OpenDDS_Rtps_Udp$BUILD_TARGETS" >> $GITHUB_ENV
echo "ACE_TEST_LOG_STUCK_STACKS=1" >> $GITHUB_ENV
- name: 'Configure & Build OpenDDS (ubuntu / macos)'
if: ${{ (matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-14') && steps.cache-opendds.outputs.cache-hit != 'true' }}
shell: bash
run: |-
echo "dds_security=${{ matrix.m.dds_security }}; CONFIG_OPTIONS=${{ env.CONFIG_OPTIONS }}; BUILD_TARGETS=${{ env.BUILD_TARGETS }}"
cd OpenDDS
./configure --no-tests ${{ env.CONFIG_OPTIONS }}
tools/scripts/show_build_config.pl
. setenv.sh
make -j$(getconf _NPROCESSORS_ONLN) ${{ env.BUILD_TARGETS }}
- name: 'Configure OpenDDS (windows)'
if: ${{ matrix.m.os == 'windows-2022' && steps.cache-opendds.outputs.cache-hit != 'true' }}
shell: cmd
run: |-
echo "dds_security=${{ matrix.m.dds_security }}; CONFIG_OPTIONS=${{ env.CONFIG_OPTIONS }}; BUILD_TARGETS=${{ env.BUILD_TARGETS }}"
cd OpenDDS
configure --no-tests ${{ env.CONFIG_OPTIONS }}
perl tools/scripts/show_build_config.pl
- name: 'Build OpenDDS (windows)'
if: ${{ matrix.m.os == 'windows-2022' && steps.cache-opendds.outputs.cache-hit != 'true' }}
shell: cmd
run: |-
cd OpenDDS
call setenv.cmd
msbuild -p:Configuration=Debug,Platform=x64 -t:${{ env.BUILD_TARGETS }} -m DDS_TAOv2.sln
- name: 'Install (ubuntu / macos)'
if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-14' }}
shell: bash
run: |-
npm install
${{ env.ACE_ROOT }}/bin/mwc.pl -type gnuace -exclude ACE_TAO,OpenDDS
make -j$(getconf _NPROCESSORS_ONLN) || make
- name: Install gdb (ubuntu)
if: ${{ matrix.m.os == 'ubuntu-22.04' }}
shell: bash
run: |
sudo apt-get update
sudo apt-get install gdb
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
- name: 'Change Core File Pattern (ubuntu)'
if: ${{ matrix.m.os == 'ubuntu-22.04' }}
shell: bash
run: |
sudo sysctl -w kernel.core_pattern=core.%e.%p
echo Core file pattern set to:
cat /proc/sys/kernel/core_pattern
- name: 'Change Cores Directory Permissions (macos)'
if: ${{ matrix.m.os == 'macos-14' }}
shell: bash
run: |
sudo chmod o+w /cores
- name: 'Test (ubuntu / macos)'
if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-14' }}
shell: bash
run: |-
ulimit -c unlimited
cd test
./run_test.pl cpp2node
./run_test.pl node2cpp
./run_test.pl node2node
./run_test.pl cpp2node --rtps
./run_test.pl node2cpp --rtps
./run_test.pl node2node --rtps
- name: 'Test Secure (ubuntu / macos)'
if: ${{ (matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-14') && matrix.m.dds_security == 1 }}
shell: bash
run: |-
ulimit -c unlimited
cd test
./run_test.pl cpp2node --rtps --secure
./run_test.pl node2cpp --rtps --secure
./run_test.pl node2node --rtps --secure
- name: 'Install (windows)'
if: ${{ matrix.m.os == 'windows-2022' }}
shell: cmd
run: |-
cd OpenDDS
call setenv.cmd
cd ..
call npm.cmd install --debug --lib_suffix=d
- name: 'Build (windows)'
if: ${{ matrix.m.os == 'windows-2022' }}
shell: cmd
run: |-
cd OpenDDS
call setenv.cmd
cd ..
set PATH=%PATH%;%GITHUB_WORKSPACE%\ACE_TAO\ACE\lib;%GITHUB_WORKSPACE%\OpenDDS\lib"
set PATH
perl ${{ env.ACE_ROOT }}\bin\mwc.pl -type vs2022 -exclude ACE_TAO,OpenDDS
msbuild -p:Configuration=Debug,Platform=x64 -m node_opendds.sln
- name: 'Test (windows)'
if: ${{ matrix.m.os == 'windows-2022' }}
shell: cmd
run: |-
cd OpenDDS
call setenv.cmd
cd ..
set PATH=%PATH%;%GITHUB_WORKSPACE%\ACE_TAO\ACE\lib;%GITHUB_WORKSPACE%\OpenDDS\lib"
set PATH
cd test
perl run_test.pl cpp2node
if %errorlevel% neq 0 exit /b %errorlevel%
perl run_test.pl node2cpp
if %errorlevel% neq 0 exit /b %errorlevel%
perl run_test.pl node2node
if %errorlevel% neq 0 exit /b %errorlevel%
perl run_test.pl cpp2node --rtps
if %errorlevel% neq 0 exit /b %errorlevel%
perl run_test.pl node2cpp --rtps
if %errorlevel% neq 0 exit /b %errorlevel%
perl run_test.pl node2node --rtps
- name: 'Test Secure (windows)'
if: ${{ matrix.m.os == 'windows-2022' && matrix.m.dds_security == 1 }}
shell: cmd
run: |-
cd OpenDDS
call setenv.cmd
cd ..
set PATH=%PATH%;%GITHUB_WORKSPACE%\ACE_TAO\ACE\lib;%GITHUB_WORKSPACE%\OpenDDS\lib"
set PATH
cd test
perl run_test.pl cpp2node --rtps --secure
if %errorlevel% neq 0 exit /b %errorlevel%
perl run_test.pl node2cpp --rtps --secure
if %errorlevel% neq 0 exit /b %errorlevel%
perl run_test.pl node2node --rtps --secure