Skip to content

node-opendds CI

node-opendds CI #326

Workflow file for this run

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:
build:
strategy:
fail-fast: false
matrix:
node_version:
- 18
- 20
opendds_branch:
- master
- latest-release
m:
- {os: ubuntu-22.04, dds_security: 1}
- {os: ubuntu-22.04, dds_security: 0}
- {os: macos-12, dds_security: 1}
- {os: macos-12, dds_security: 0}
- {os: windows-2022, dds_security: 1}
- {os: windows-2022, dds_security: 0}
runs-on: ${{ matrix.m.os }}
steps:
- uses: actions/checkout@v4
- name: 'Checkout MPC'
uses: actions/checkout@v4
with:
repository: DOCGroup/MPC
path: MPC
fetch-depth: 1
- name: 'Checkout ACE_TAO'
uses: actions/checkout@v4
with:
repository: DOCGroup/ACE_TAO
ref: ace6tao2
path: ACE_TAO
fetch-depth: 1
- name: 'Checkout OpenDDS'
uses: actions/checkout@v4
with:
repository: OpenDDS/OpenDDS
ref: ${{ matrix.opendds_branch }}
path: OpenDDS
fetch-depth: 1
- name: 'Set Up node'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- 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-12' }}
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: 898b728edc5e0d12b50015f9cd18247c4257a3eb
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/[email protected]
- name: 'Set Up Problem Matcher (ubuntu / macos)'
if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-12' }}
uses: ammaraskar/[email protected]
- name: 'Set environment variables (ubuntu / macos)'
if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-12' }}
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-12' ]; then
CONFIG_OPTIONS+=" --xerces3=$(brew --prefix xerces-c) --openssl=/usr/local/opt/[email protected]"
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-12' }}
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' }}
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' }}
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-12' }}
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-12' }}
shell: bash
run: |
sudo chmod o+w /cores
- name: 'Test (ubuntu / macos)'
if: ${{ matrix.m.os == 'ubuntu-22.04' || matrix.m.os == 'macos-12' }}
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-12') && 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