Skip to content

Add Initial Qt6 Build Support #239

Add Initial Qt6 Build Support

Add Initial Qt6 Build Support #239

Workflow file for this run

---
name: "opendds-monitor CI"
on:
pull_request:
branches:
- master
push:
branches:
- master
- latest-release
schedule:
- cron: '10 0 * * 0'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
opendds_branch:
- master
- latest-release
runner:
- windows-2022
- windows-2019
- ubuntu-22.04
- ubuntu-20.04
- macos-14
- macos-13
runs-on: ${{ matrix.runner }}
steps:
# Clone git repositories
- name: 'Checkout opendds-monitor'
uses: actions/checkout@v4
with:
submodules: true
- 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
submodules: true
# Get 3rd-party Dependencies
- name: 'Install openssl, xerces, qt5, and qwt (Linux)'
if: runner.os == 'Linux'
run: |-
sudo apt-get update
sudo apt-get -y install libssl-dev libxerces-c-dev qtbase5-dev libqt5svg5-dev libqwt-qt5-dev
- name: 'Install xerces, qt5, and qwt (macOS)'
if: runner.os == 'macOS'
run: |-
brew install xerces-c qt@5 qwt-qt5
- name: setup for run-vcpkg
if: runner.os == 'Windows'
shell: cmd
run: |
echo { "name": "opendds", "version-string": "github-actions", "dependencies": [ "qt5-base", "qt5-svg", "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, xerces, and qt5 (Windows)'
if: runner.os == 'Windows'
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
vcpkgGitCommitId: 898b728edc5e0d12b50015f9cd18247c4257a3eb
runVcpkgInstall: true
# Set Up Build Environments
- name: 'Set Up MSVC Environment'
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: 'Set environment variables (Linux / macOS)'
if: runner.os == 'Linux' || runner.os == 'macOS'
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 "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/ACE_TAO/ACE/lib:$GITHUB_WORKSPACE/OpenDDS/lib" >> $GITHUB_ENV
CONFIG_OPTIONS+=" --no-tests --std=c++17 --ipv6 --security"
if [ '${{ runner.os }}' == 'macOS' ]; then
if [ '${{ matrix.runner }}' == 'macos-13' ]; then
CONFIG_OPTIONS+=" --xerces3=$(brew --prefix xerces-c) --openssl=/usr/local/opt/[email protected]"
else
CONFIG_OPTIONS+=" --xerces3=$(brew --prefix xerces-c) --openssl=$(brew --prefix openssl)"
fi
fi
echo "CONFIG_OPTIONS=$CONFIG_OPTIONS" >> $GITHUB_ENV
export COMPILER_VERSION=$(c++ --version 2>&1 | head -n 1)
echo "COMPILER_VERSION=$COMPILER_VERSION" >> $GITHUB_ENV
echo "OBJ_EXT=\\.o" >> $GITHUB_ENV
TAR_EXE="tar"
MD5_EXE="md5sum"
if [ '${{ runner.os }}' == 'macOS' ]; then
TAR_EXE="gtar"
MD5_EXE="md5 -r"
fi
echo "TAR_EXE=$TAR_EXE" >> $GITHUB_ENV
echo "MD5_EXE=$MD5_EXE" >> $GITHUB_ENV
- name: 'Set environment variables (Windows)'
if: runner.os == 'Windows'
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
CONFIG_OPTIONS+=" --no-tests --std=c++17 --ipv6 --security --xerces3=\"$VCPKG_INSTALLED_DIR\\x64-windows\" --openssl=\"$VCPKG_INSTALLED_DIR\\x64-windows\""
echo "CONFIG_OPTIONS=$CONFIG_OPTIONS" >> $GITHUB_ENV
export COMPILER_VERSION=$("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -property catalog_productDisplayVersion)
echo "COMPILER_VERSION=$COMPILER_VERSION" >> $GITHUB_ENV
echo "OBJ_EXT=\\.obj" >> $GITHUB_ENV
TAR_EXE="tar"
MD5_EXE="md5sum"
echo "TAR_EXE=$TAR_EXE" >> $GITHUB_ENV
echo "MD5_EXE=$MD5_EXE" >> $GITHUB_ENV
- name: 'Set environment variables (Common)'
shell: bash
run: |-
cd ACE_TAO
export ACE_COMMIT=$(git rev-parse HEAD)
echo "ACE_COMMIT=$ACE_COMMIT" >> $GITHUB_ENV
cd ../OpenDDS
export DDS_COMMIT=$(git rev-parse HEAD)
echo "DDS_COMMIT=$DDS_COMMIT" >> $GITHUB_ENV
export MATRIX_MD5=$(echo "${{ matrix }}" | ${{ env.MD5_EXE }} | cut -d ' ' -f 1)
echo "MATRIX_MD5=$MATRIX_MD5" >> $GITHUB_ENV
export COMPILER_MD5=$(echo "$COMPILER_VERSION" | ${{ env.MD5_EXE }} | cut -d ' ' -f 1)
echo "COMPILER_MD5=$COMPILER_MD5" >> $GITHUB_ENV
export CONFIG_MD5=$(echo "$CONFIG_OPTIONS" | ${{ env.MD5_EXE }} | cut -d ' ' -f 1)
echo "CONFIG_MD5=$CONFIG_MD5" >> $GITHUB_ENV
# Configure and build OpenDDS (using cache)
- name: 'Check Build Cache'
id: cache-build
uses: actions/cache@v4
with:
path: ${{ env.MATRIX_MD5 }}.tar.xz
key: c01_${{ env.MATRIX_MD5 }}_${{ env.COMPILER_MD5 }}_${{ env.ACE_COMMIT }}_${{ env.DDS_COMMIT }}_${{ env.CONFIG_MD5 }}
- name: 'Extract Build Cache'
if: steps.cache-build.outputs.cache-hit == 'true'
shell: bash
run: |
tar xvfJ ${{ env.MATRIX_MD5 }}.tar.xz
cd OpenDDS
git submodule init && git submodule update
- name: 'Configure & Build OpenDDS (Linux / macOS)'
if: steps.cache-build.outputs.cache-hit != 'true' && (runner.os == 'Linux' || runner.os == 'macOS')
shell: bash
run: |-
cd OpenDDS
./configure ${{ env.CONFIG_OPTIONS }}
- name: 'Configure OpenDDS (Windows)'
if: steps.cache-build.outputs.cache-hit != 'true' && runner.os == 'Windows'
shell: cmd
run: |-
cd OpenDDS
configure ${{ env.CONFIG_OPTIONS }}
- name: 'Build OpenDDS (Linux / macOS)'
if: steps.cache-build.outputs.cache-hit != 'true' && (runner.os == 'Linux' || runner.os == 'macOS')
shell: bash
run: |-
cd OpenDDS
. setenv.sh
make -j3
- name: 'Build OpenDDS (Windows)'
if: steps.cache-build.outputs.cache-hit != 'true' && runner.os == 'Windows'
shell: cmd
run: |-
cd OpenDDS
call setenv.cmd
msbuild -p:Configuration=Debug,Platform=x64 -m DDS_TAOv2.sln
- name: 'Create Build Cache'
if: steps.cache-build.outputs.cache-hit != 'true'
shell: bash
run: |
cd ACE_TAO
find . -iname "*$OBJ_EXT" | xargs rm
git clean -xdfn | cut -d ' ' -f 3- | sed 's/^/ACE_TAO\//g' | tee ../ACE_TAO_files.txt
cd ..
$TAR_EXE cvf ${{ env.MATRIX_MD5 }}.tar ACE_TAO/ACE/ace/config.h
cat ACE_TAO_files.txt | xargs $TAR_EXE uvf ${{ env.MATRIX_MD5 }}.tar
cd OpenDDS
find . -iname "*$OBJ_EXT" | xargs rm
git clean -xdfn | cut -d ' ' -f 3- | sed 's/^/OpenDDS\//g' | tee ../OpenDDS_files.txt
cd ..
cat OpenDDS_files.txt | xargs $TAR_EXE uvf ${{ env.MATRIX_MD5 }}.tar
xz -3 ${{ env.MATRIX_MD5 }}.tar
- name: 'Show OpenDDS Configuration'
run: |
cd OpenDDS
perl tools/scripts/show_build_config.pl
# Build Qwt (Windows Only)
- name: 'Build Qwt (Windows)'
if: runner.os == 'Windows'
shell: cmd
run: |-
cmake -DBUILD_TYPE=debug -DVCPKG_INSTALLED_DIR=%VCPKG_INSTALLED_DIR% -DVCPKG_DEFAULT_TRIPLET=%VCPKG_DEFAULT_TRIPLET% -P BuildQwt.cmake
# Set up problem matchers
- name: 'Set Up Problem Matcher (Linux / macOS)'
if: runner.os == 'Linux' || runner.os == 'macOS'
uses: ammaraskar/[email protected]
- name: 'Set Up Problem Matcher (Windows)'
if: runner.os == 'Windows'
uses: ammaraskar/[email protected]
# Build opendds-monitor
- name: 'Build opendds-monitor (Linux / macOS)'
if: runner.os == 'Linux' || runner.os == 'macOS'
shell: bash
run: |-
cd OpenDDS
. setenv.sh
cd ..
mkdir build
cd build
CMAKE_ARGS=""
if [ '${{ runner.os }}' == 'macOS' ]; then
# CMAKE_ARGS+=" -DQt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5"
export QWT_DIR=$(brew --prefix qwt-qt5)
CMAKE_ARGS+=" -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5)"
fi
cmake $CMAKE_ARGS ..
cmake --build . -t all -t managed_testapp -t unmanaged_testapp
- name: 'Build opendds-monitor (Windows)'
if: runner.os == 'Windows'
shell: cmd
run: |-
cd OpenDDS
call setenv.cmd
cd ..
mkdir build
cd build
cmake -DQWT_IS_LOCAL=ON -DCMAKE_PREFIX_PATH=%VCPKG_INSTALLED_DIR%\x64-windows ..
cmake --build . && cmake --build test -t managed_testapp -t unmanaged_testapp