Priority in Microgrid Controller Selection #91
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "TMS Builds" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- '**' | |
- '!**/.gitignore' | |
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-2025 | |
- windows-2022 | |
- ubuntu-24.04 | |
- ubuntu-22.04 | |
- macos-14 | |
- macos-13 | |
runs-on: ${{ matrix.runner }} | |
steps: | |
# Clone git repositories | |
- name: 'Checkout TMS project' | |
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 | |
submodules: true | |
# Get 3rd-party Dependencies | |
- name: 'Install openssl, xerces (Linux)' | |
if: runner.os == 'Linux' | |
run: |- | |
sudo apt-get update | |
sudo apt-get -y install libssl-dev libxerces-c-dev | |
- name: 'Install xerces (macOS)' | |
if: runner.os == 'macOS' | |
run: |- | |
brew install xerces-c | |
- name: setup for run-vcpkg | |
if: runner.os == 'Windows' | |
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, xerces (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 -j $(getconf _NPROCESSORS_ONLN) | |
- 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 | |
# 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 TMS application | |
- name: 'Build TMS application with static libs (Linux / macOS)' | |
if: runner.os == 'Linux' || runner.os == 'macOS' | |
shell: bash | |
run: |- | |
cd OpenDDS | |
. setenv.sh | |
cd ../tactical-microgrid-standard | |
cmake -B build_static -D BUILD_TESTING=TRUE | |
cmake --build build_static | |
- name: 'Build TMS application with shared libs (Linux /macOS)' | |
if: runner.os == 'Linux' || runner.os == 'macOS' | |
shell: bash | |
run: |- | |
cd OpenDDS | |
. setenv.sh | |
cd ../tactical-microgrid-standard | |
cmake -DBUILD_SHARED_LIBS=yes -B build_shared -D BUILD_TESTING=TRUE | |
cmake --build build_shared | |
- name: 'Build TMS application with static libs (Windows)' | |
if: runner.os == 'Windows' | |
shell: cmd | |
run: |- | |
cd OpenDDS | |
call setenv.cmd | |
cd ..\tactical-microgrid-standard | |
cmake -B build_static -D BUILD_TESTING=TRUE | |
cmake --build build_static | |
- name: 'Build TMS application with shared libs (Windows)' | |
if: runner.os == 'Windows' | |
shell: cmd | |
run: |- | |
cd OpenDDS | |
call setenv.cmd | |
cd ..\tactical-microgrid-standard | |
cmake -DBUILD_SHARED_LIBS=yes -B build_shared -D BUILD_TESTING=TRUE | |
cmake --build build_shared | |
- name: 'Run tests with static libs (Linux)' | |
if: runner.os == 'Linux' | |
run: |- | |
cd OpenDDS | |
. setenv.sh | |
cd ../tactical-microgrid-standard/build_static | |
ctest --verbose --output-on-failure | |
- name: 'Run tests with shared libs (Linux)' | |
if: runner.os == 'Linux' | |
run: |- | |
cd OpenDDS | |
. setenv.sh | |
cd ../tactical-microgrid-standard/build_shared | |
ctest --verbose --output-on-failure | |
- name: 'Run tests with static libs (Windows)' | |
if: runner.os == 'Windows' | |
shell: cmd | |
run: |- | |
cd OpenDDS | |
call setenv.cmd | |
cd ..\tactical-microgrid-standard\build_static | |
ctest --verbose --output-on-failure -C Debug | |
- name: 'Run tests with shared libs (Windows)' | |
if: runner.os == 'Windows' | |
shell: cmd | |
run: |- | |
cd OpenDDS | |
call setenv.cmd | |
cd ..\tactical-microgrid-standard\build_shared | |
ctest --verbose --output-on-failure -C Debug |