|
| 1 | +name: "TMS Builds" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - '**' |
| 7 | + - '!**/.gitignore' |
| 8 | + pull_request: |
| 9 | + paths: |
| 10 | + - '**' |
| 11 | + - '!**/.gitignore' |
| 12 | + branches: |
| 13 | + - main |
| 14 | + workflow_dispatch: |
| 15 | + |
| 16 | +concurrency: |
| 17 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 18 | + cancel-in-progress: true |
| 19 | + |
| 20 | +jobs: |
| 21 | + build: |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + opendds_branch: |
| 26 | + - master |
| 27 | + - latest-release |
| 28 | + runner: |
| 29 | + - windows-2022 |
| 30 | + - windows-2019 |
| 31 | + - ubuntu-24.04 |
| 32 | + - ubuntu-22.04 |
| 33 | + - macos-14 |
| 34 | + - macos-13 |
| 35 | + |
| 36 | + runs-on: ${{ matrix.runner }} |
| 37 | + |
| 38 | + steps: |
| 39 | + # Clone git repositories |
| 40 | + - name: 'Checkout TMS project' |
| 41 | + uses: actions/checkout@v4 |
| 42 | + - name: 'Checkout MPC' |
| 43 | + uses: actions/checkout@v4 |
| 44 | + with: |
| 45 | + repository: DOCGroup/MPC |
| 46 | + path: MPC |
| 47 | + fetch-depth: 1 |
| 48 | + - name: 'Checkout ACE_TAO' |
| 49 | + uses: actions/checkout@v4 |
| 50 | + with: |
| 51 | + repository: DOCGroup/ACE_TAO |
| 52 | + ref: ace6tao2 |
| 53 | + path: ACE_TAO |
| 54 | + fetch-depth: 1 |
| 55 | + - name: 'Checkout OpenDDS' |
| 56 | + uses: actions/checkout@v4 |
| 57 | + with: |
| 58 | + repository: OpenDDS/OpenDDS |
| 59 | + ref: ${{ matrix.opendds_branch }} |
| 60 | + path: OpenDDS |
| 61 | + fetch-depth: 1 |
| 62 | + submodules: true |
| 63 | + |
| 64 | + # Get 3rd-party Dependencies |
| 65 | + - name: 'Install openssl, xerces (Linux)' |
| 66 | + if: runner.os == 'Linux' |
| 67 | + run: |- |
| 68 | + sudo apt-get update |
| 69 | + sudo apt-get -y install libssl-dev libxerces-c-dev |
| 70 | + - name: 'Install xerces (macOS)' |
| 71 | + if: runner.os == 'macOS' |
| 72 | + run: |- |
| 73 | + brew install xerces-c |
| 74 | + - name: setup for run-vcpkg |
| 75 | + if: runner.os == 'Windows' |
| 76 | + shell: cmd |
| 77 | + run: | |
| 78 | + echo { "name": "opendds", "version-string": "github-actions", "dependencies": [ "openssl", "xerces-c" ] } > vcpkg.json |
| 79 | + echo VCPKG_DEFAULT_TRIPLET=x64-windows>> %GITHUB_ENV% |
| 80 | + echo VCPKG_INSTALLED_DIR=${{ github.workspace }}\vcpkg\installed>> %GITHUB_ENV% |
| 81 | + - name: 'Install openssl, xerces (Windows)' |
| 82 | + if: runner.os == 'Windows' |
| 83 | + uses: lukka/run-vcpkg@v11 |
| 84 | + with: |
| 85 | + vcpkgDirectory: '${{ github.workspace }}/vcpkg' |
| 86 | + vcpkgGitCommitId: 898b728edc5e0d12b50015f9cd18247c4257a3eb |
| 87 | + runVcpkgInstall: true |
| 88 | + |
| 89 | + # Set Up Build Environments |
| 90 | + - name: 'Set Up MSVC Environment' |
| 91 | + if: runner.os == 'Windows' |
| 92 | + uses: ilammy/msvc-dev-cmd@v1 |
| 93 | + - name: 'Set environment variables (Linux / macOS)' |
| 94 | + if: runner.os == 'Linux' || runner.os == 'macOS' |
| 95 | + shell: bash |
| 96 | + run: |- |
| 97 | + echo "ACE_ROOT=$GITHUB_WORKSPACE/ACE_TAO/ACE" >> $GITHUB_ENV |
| 98 | + echo "TAO_ROOT=$GITHUB_WORKSPACE/ACE_TAO/TAO" >> $GITHUB_ENV |
| 99 | + echo "DDS_ROOT=$GITHUB_WORKSPACE/OpenDDS" >> $GITHUB_ENV |
| 100 | + echo "MPC_ROOT=$GITHUB_WORKSPACE/MPC" >> $GITHUB_ENV |
| 101 | + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/ACE_TAO/ACE/lib:$GITHUB_WORKSPACE/OpenDDS/lib" >> $GITHUB_ENV |
| 102 | + CONFIG_OPTIONS+=" --no-tests --std=c++17 --ipv6 --security" |
| 103 | + if [ '${{ runner.os }}' == 'macOS' ]; then |
| 104 | + if [ '${{ matrix.runner }}' == 'macos-13' ]; then |
| 105 | + CONFIG_OPTIONS+=" --xerces3=$(brew --prefix xerces-c) --openssl=/usr/local/opt/[email protected]" |
| 106 | + else |
| 107 | + CONFIG_OPTIONS+=" --xerces3=$(brew --prefix xerces-c) --openssl=$(brew --prefix openssl)" |
| 108 | + fi |
| 109 | + fi |
| 110 | + echo "CONFIG_OPTIONS=$CONFIG_OPTIONS" >> $GITHUB_ENV |
| 111 | + export COMPILER_VERSION=$(c++ --version 2>&1 | head -n 1) |
| 112 | + echo "COMPILER_VERSION=$COMPILER_VERSION" >> $GITHUB_ENV |
| 113 | + echo "OBJ_EXT=\\.o" >> $GITHUB_ENV |
| 114 | + TAR_EXE="tar" |
| 115 | + MD5_EXE="md5sum" |
| 116 | + if [ '${{ runner.os }}' == 'macOS' ]; then |
| 117 | + TAR_EXE="gtar" |
| 118 | + MD5_EXE="md5 -r" |
| 119 | + fi |
| 120 | + echo "TAR_EXE=$TAR_EXE" >> $GITHUB_ENV |
| 121 | + echo "MD5_EXE=$MD5_EXE" >> $GITHUB_ENV |
| 122 | + - name: 'Set environment variables (Windows)' |
| 123 | + if: runner.os == 'Windows' |
| 124 | + shell: bash |
| 125 | + run: |- |
| 126 | + echo "ACE_ROOT=$GITHUB_WORKSPACE\\ACE_TAO\\ACE" >> $GITHUB_ENV |
| 127 | + echo "TAO_ROOT=$GITHUB_WORKSPACE\\ACE_TAO\\TAO" >> $GITHUB_ENV |
| 128 | + echo "DDS_ROOT=$GITHUB_WORKSPACE\\OpenDDS" >> $GITHUB_ENV |
| 129 | + echo "MPC_ROOT=$GITHUB_WORKSPACE\\MPC" >> $GITHUB_ENV |
| 130 | + CONFIG_OPTIONS+=" --no-tests --std=c++17 --ipv6 --security --xerces3=\"$VCPKG_INSTALLED_DIR\\x64-windows\" --openssl=\"$VCPKG_INSTALLED_DIR\\x64-windows\"" |
| 131 | + echo "CONFIG_OPTIONS=$CONFIG_OPTIONS" >> $GITHUB_ENV |
| 132 | + export COMPILER_VERSION=$("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -property catalog_productDisplayVersion) |
| 133 | + echo "COMPILER_VERSION=$COMPILER_VERSION" >> $GITHUB_ENV |
| 134 | + echo "OBJ_EXT=\\.obj" >> $GITHUB_ENV |
| 135 | + TAR_EXE="tar" |
| 136 | + MD5_EXE="md5sum" |
| 137 | + echo "TAR_EXE=$TAR_EXE" >> $GITHUB_ENV |
| 138 | + echo "MD5_EXE=$MD5_EXE" >> $GITHUB_ENV |
| 139 | + - name: 'Set environment variables (Common)' |
| 140 | + shell: bash |
| 141 | + run: |- |
| 142 | + cd ACE_TAO |
| 143 | + export ACE_COMMIT=$(git rev-parse HEAD) |
| 144 | + echo "ACE_COMMIT=$ACE_COMMIT" >> $GITHUB_ENV |
| 145 | + cd ../OpenDDS |
| 146 | + export DDS_COMMIT=$(git rev-parse HEAD) |
| 147 | + echo "DDS_COMMIT=$DDS_COMMIT" >> $GITHUB_ENV |
| 148 | + export MATRIX_MD5=$(echo "${{ matrix }}" | ${{ env.MD5_EXE }} | cut -d ' ' -f 1) |
| 149 | + echo "MATRIX_MD5=$MATRIX_MD5" >> $GITHUB_ENV |
| 150 | + export COMPILER_MD5=$(echo "$COMPILER_VERSION" | ${{ env.MD5_EXE }} | cut -d ' ' -f 1) |
| 151 | + echo "COMPILER_MD5=$COMPILER_MD5" >> $GITHUB_ENV |
| 152 | + export CONFIG_MD5=$(echo "$CONFIG_OPTIONS" | ${{ env.MD5_EXE }} | cut -d ' ' -f 1) |
| 153 | + echo "CONFIG_MD5=$CONFIG_MD5" >> $GITHUB_ENV |
| 154 | +
|
| 155 | + # Configure and build OpenDDS (using cache) |
| 156 | + - name: 'Check Build Cache' |
| 157 | + id: cache-build |
| 158 | + uses: actions/cache@v4 |
| 159 | + with: |
| 160 | + path: ${{ env.MATRIX_MD5 }}.tar.xz |
| 161 | + key: c01_${{ env.MATRIX_MD5 }}_${{ env.COMPILER_MD5 }}_${{ env.ACE_COMMIT }}_${{ env.DDS_COMMIT }}_${{ env.CONFIG_MD5 }} |
| 162 | + - name: 'Extract Build Cache' |
| 163 | + if: steps.cache-build.outputs.cache-hit == 'true' |
| 164 | + shell: bash |
| 165 | + run: | |
| 166 | + tar xvfJ ${{ env.MATRIX_MD5 }}.tar.xz |
| 167 | + cd OpenDDS |
| 168 | + git submodule init && git submodule update |
| 169 | + - name: 'Configure & Build OpenDDS (Linux / macOS)' |
| 170 | + if: steps.cache-build.outputs.cache-hit != 'true' && (runner.os == 'Linux' || runner.os == 'macOS') |
| 171 | + shell: bash |
| 172 | + run: |- |
| 173 | + cd OpenDDS |
| 174 | + ./configure ${{ env.CONFIG_OPTIONS }} |
| 175 | + - name: 'Configure OpenDDS (Windows)' |
| 176 | + if: steps.cache-build.outputs.cache-hit != 'true' && runner.os == 'Windows' |
| 177 | + shell: cmd |
| 178 | + run: |- |
| 179 | + cd OpenDDS |
| 180 | + configure ${{ env.CONFIG_OPTIONS }} |
| 181 | + - name: 'Build OpenDDS (Linux / macOS)' |
| 182 | + if: steps.cache-build.outputs.cache-hit != 'true' && (runner.os == 'Linux' || runner.os == 'macOS') |
| 183 | + shell: bash |
| 184 | + run: |- |
| 185 | + cd OpenDDS |
| 186 | + . setenv.sh |
| 187 | + make -j $(getconf _NPROCESSORS_ONLN) |
| 188 | + - name: 'Build OpenDDS (Windows)' |
| 189 | + if: steps.cache-build.outputs.cache-hit != 'true' && runner.os == 'Windows' |
| 190 | + shell: cmd |
| 191 | + run: |- |
| 192 | + cd OpenDDS |
| 193 | + call setenv.cmd |
| 194 | + msbuild -p:Configuration=Debug,Platform=x64 -m DDS_TAOv2.sln |
| 195 | + - name: 'Create Build Cache' |
| 196 | + if: steps.cache-build.outputs.cache-hit != 'true' |
| 197 | + shell: bash |
| 198 | + run: | |
| 199 | + cd ACE_TAO |
| 200 | + find . -iname "*$OBJ_EXT" | xargs rm |
| 201 | + git clean -xdfn | cut -d ' ' -f 3- | sed 's/^/ACE_TAO\//g' | tee ../ACE_TAO_files.txt |
| 202 | + cd .. |
| 203 | + $TAR_EXE cvf ${{ env.MATRIX_MD5 }}.tar ACE_TAO/ACE/ace/config.h |
| 204 | + cat ACE_TAO_files.txt | xargs $TAR_EXE uvf ${{ env.MATRIX_MD5 }}.tar |
| 205 | + cd OpenDDS |
| 206 | + find . -iname "*$OBJ_EXT" | xargs rm |
| 207 | + git clean -xdfn | cut -d ' ' -f 3- | sed 's/^/OpenDDS\//g' | tee ../OpenDDS_files.txt |
| 208 | + cd .. |
| 209 | + cat OpenDDS_files.txt | xargs $TAR_EXE uvf ${{ env.MATRIX_MD5 }}.tar |
| 210 | + xz -3 ${{ env.MATRIX_MD5 }}.tar |
| 211 | + - name: 'Show OpenDDS Configuration' |
| 212 | + run: | |
| 213 | + cd OpenDDS |
| 214 | + perl tools/scripts/show_build_config.pl |
| 215 | +
|
| 216 | + # Set up problem matchers |
| 217 | + - name: 'Set Up Problem Matcher (Linux / macOS)' |
| 218 | + if: runner.os == 'Linux' || runner.os == 'macOS' |
| 219 | + uses: ammaraskar/[email protected] |
| 220 | + - name: 'Set Up Problem Matcher (Windows)' |
| 221 | + if: runner.os == 'Windows' |
| 222 | + uses: ammaraskar/[email protected] |
| 223 | + |
| 224 | + # Build TMS application |
| 225 | + - name: 'Build TMS application with static libs (Linux / macOS)' |
| 226 | + if: runner.os == 'Linux' || runner.os == 'macOS' |
| 227 | + shell: bash |
| 228 | + run: |- |
| 229 | + cd OpenDDS |
| 230 | + . setenv.sh |
| 231 | + cd .. |
| 232 | + cmake -B build_static |
| 233 | + cmake --build build_static |
| 234 | + - name: 'Build TMS application with shared libs (Linux /macOS)' |
| 235 | + if: runner.os == 'Linux' || runner.os == 'macOS' |
| 236 | + shell: bash |
| 237 | + run: |- |
| 238 | + cd OpenDDS |
| 239 | + . setenv.sh |
| 240 | + cd .. |
| 241 | + cmake -DBUILD_SHARED_LIBS=yes -B build_shared |
| 242 | + cmake --build build_shared |
| 243 | + - name: 'Build TMS application with static libs (Windows)' |
| 244 | + if: runner.os == 'Windows' |
| 245 | + shell: cmd |
| 246 | + run: |- |
| 247 | + cd OpenDDS |
| 248 | + call setenv.cmd |
| 249 | + cd .. |
| 250 | + cmake -B build_static |
| 251 | + cmake --build build_static |
| 252 | + - name: 'Build TMS application with shared libs (Windows)' |
| 253 | + if: runner.os == 'Windows' |
| 254 | + shell: cmd |
| 255 | + run: |- |
| 256 | + cd OpenDDS |
| 257 | + call setenv.cmd |
| 258 | + cd .. |
| 259 | + cmake -DBUILD_SHARED_LIBS=yes -B build_shared |
| 260 | + cmake --build build_shared |
0 commit comments