Implement support for further grouping HVAC library by category #1229
This file contains 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: C++ CI for OpenStudioApplication | |
on: | |
push: | |
branches: [ master, develop ] | |
# Sequence of patterns matched against refs/tags | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | |
pull_request: | |
branches: [ master, develop ] | |
env: | |
BUILD_TYPE: Release | |
BUILD_DOCUMENTATION: OFF | |
BUILD_TESTING: ON | |
BUILD_BENCHMARK: ON | |
BUILD_PACKAGE: ON | |
CPACK_BINARY_NSIS: OFF | |
CPACK_BINARY_RPM: OFF | |
CPACK_BINARY_STGZ: OFF | |
CPACK_BINARY_TBZ2: OFF | |
CPACK_BINARY_TGZ: ON | |
CPACK_BINARY_TXZ: OFF | |
CPACK_BINARY_TZ: OFF | |
CPACK_SOURCE_RPM: OFF | |
CPACK_SOURCE_TBZ2: OFF | |
CPACK_SOURCE_TGZ: OFF | |
CPACK_SOURCE_TXZ: OFF | |
CPACK_SOURCE_TZ: OFF | |
CPACK_SOURCE_ZIP: OFF | |
QT_VERSION: 6.6.3 | |
# CPACK_BINARY_DEB: OS-SPECIFIC | |
# CPACK_BINARY_IFW: OS-SPECIFIC | |
jobs: | |
build: | |
# Note: as of 2021-01-29, this only works for push, not for pull request | |
# if: "!(contains(github.event.head_commit.message, 'skip') && contains(github.event.head_commit.message, 'ci'))" | |
runs-on: ${{ matrix.os }} | |
continue-on-error: true | |
strategy: | |
# fail-fast: Default is true, switch to false to allow one platform to fail and still run others | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, ubuntu-22.04, windows-2022, macos-13, macos-arm64] | |
include: | |
- os: ubuntu-20.04 | |
SELF_HOSTED: false | |
PLATFORM_NAME: Linux | |
CPACK_BINARY_DEB: ON | |
CPACK_BINARY_IFW: OFF | |
CPACK_BINARY_TGZ: ON | |
CPACK_BINARY_ZIP: OFF | |
BINARY_EXT: deb | |
COMPRESSED_EXT: tar.gz | |
BINARY_PKG_PATH: _CPack_Packages/Linux/DEB | |
COMPRESSED_PKG_PATH: _CPack_Packages/Linux/TGZ | |
QT_OS_NAME: linux | |
QT_ARCH: gcc_64 | |
- os: ubuntu-22.04 | |
SELF_HOSTED: false | |
PLATFORM_NAME: Linux | |
CPACK_BINARY_DEB: ON | |
CPACK_BINARY_IFW: OFF | |
CPACK_BINARY_TGZ: ON | |
CPACK_BINARY_ZIP: OFF | |
BINARY_EXT: deb | |
COMPRESSED_EXT: tar.gz | |
BINARY_PKG_PATH: _CPack_Packages/Linux/DEB | |
COMPRESSED_PKG_PATH: _CPack_Packages/Linux/TGZ | |
QT_OS_NAME: linux | |
QT_ARCH: gcc_64 | |
- os: windows-2022 | |
SELF_HOSTED: false | |
PLATFORM_NAME: Windows | |
CPACK_BINARY_DEB: OFF | |
CPACK_BINARY_IFW: ON | |
CPACK_BINARY_TGZ: OFF | |
CPACK_BINARY_ZIP: ON | |
BINARY_EXT: exe | |
COMPRESSED_EXT: zip | |
BINARY_PKG_PATH: _CPack_Packages/win64/IFW | |
COMPRESSED_PKG_PATH: _CPack_Packages/win64/ZIP | |
QT_OS_NAME: windows | |
QT_ARCH: win64_msvc2019_64 | |
- os: macos-13 | |
SELF_HOSTED: false | |
PLATFORM_NAME: Darwin | |
CPACK_BINARY_DEB: OFF | |
CPACK_BINARY_IFW: ON | |
CPACK_BINARY_TGZ: ON | |
CPACK_BINARY_ZIP: OFF | |
BINARY_EXT: dmg | |
COMPRESSED_EXT: tar.gz | |
BINARY_PKG_PATH: _CPack_Packages/Darwin/IFW | |
COMPRESSED_PKG_PATH: _CPack_Packages/Darwin/TGZ | |
MACOSX_DEPLOYMENT_TARGET: 11.0 | |
SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk | |
QT_OS_NAME: mac | |
QT_ARCH: clang_64 | |
- os: macos-arm64 | |
SELF_HOSTED: true | |
PLATFORM_NAME: Darwin | |
CPACK_BINARY_DEB: OFF | |
CPACK_BINARY_IFW: ON | |
CPACK_BINARY_TGZ: ON | |
CPACK_BINARY_ZIP: OFF | |
BINARY_EXT: dmg | |
COMPRESSED_EXT: tar.gz | |
BINARY_PKG_PATH: _CPack_Packages/Darwin/IFW | |
COMPRESSED_PKG_PATH: _CPack_Packages/Darwin/TGZ | |
MACOSX_DEPLOYMENT_TARGET: 12.1 | |
SDKROOT: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk | |
QT_OS_NAME: mac | |
QT_ARCH: arm_64 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
if: ${{ !matrix.SELF_HOSTED }} | |
with: | |
python-version: '3.8.x' | |
- uses: ruby/setup-ruby@v1 | |
if: ${{ !matrix.SELF_HOSTED }} | |
with: | |
ruby-version: 2.7 | |
- name: Extract OSApp and OS SDK versions from CMakeLists.txt | |
shell: bash | |
run: | | |
# This both prints the variables and adds them to GITHUB_ENV | |
python ci/parse_cmake_versions.py | |
- name: Set OS-specific options and system dependencies (and QtIFW) | |
# Use a bash shell so we can use the same syntax for environment variable | |
# access regardless of the host operating system | |
shell: bash | |
run: | | |
set -x | |
pwd | |
echo PLATFORM_NAME=${{ matrix.PLATFORM_NAME }} >> $GITHUB_ENV | |
echo CPACK_BINARY_DEB=${{ matrix.CPACK_BINARY_DEB }} >> $GITHUB_ENV | |
echo CPACK_BINARY_IFW=${{ matrix.CPACK_BINARY_IFW }} >> $GITHUB_ENV | |
echo CPACK_BINARY_ZIP=${{ matrix.CPACK_BINARY_ZIP }} >> $GITHUB_ENV | |
echo CPACK_BINARY_TGZ=${{ matrix.CPACK_BINARY_TGZ }} >> $GITHUB_ENV | |
echo BINARY_EXT=${{ matrix.BINARY_EXT }} >> $GITHUB_ENV | |
echo COMPRESSED_EXT=${{ matrix.COMPRESSED_EXT }} >> $GITHUB_ENV | |
if [ "${{ matrix.SELF_HOSTED }}" == "true" ]; then | |
echo CONAN_PROFILE_DEFAULT=$HOME/.conan/profiles/default >> $GITHUB_ENV | |
elif [ "$RUNNER_OS" == "Windows" ]; then | |
echo CONAN_USER_HOME="${{ github.workspace }}\conan-cache" >> $GITHUB_ENV | |
echo CONAN_USER_HOME_SHORT="${{ github.workspace }}\conan-cache\short" >> $GITHUB_ENV | |
echo CONAN_PROFILE_DEFAULT="${{ github.workspace }}\conan-cache\.conan\profiles\default" >> $GITHUB_ENV | |
CCACHE_DIR="${{ github.workspace }}\.ccache" | |
echo CCACHE_DIR=$CCACHE_DIR >> $GITHUB_ENV | |
else | |
echo CONAN_USER_HOME=${{ github.workspace }}/conan-cache >> $GITHUB_ENV | |
echo CONAN_USER_HOME_SHORT=${{ github.workspace }}/conan-cache/short >> $GITHUB_ENV | |
echo CONAN_PROFILE_DEFAULT=${{ github.workspace }}/conan-cache/.conan/profiles/default >> $GITHUB_ENV | |
CCACHE_DIR=${{ github.workspace }}/.ccache | |
echo CCACHE_DIR=$CCACHE_DIR >> $GITHUB_ENV | |
fi | |
N=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu) | |
echo "There are $N threads available" | |
echo "N=$N" >> $GITHUB_ENV | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
echo "Install needed system dependencies for OPENGL (due to Qt) for Linux" | |
sudo apt update -qq | |
sudo apt install -y mesa-common-dev libglu1-mesa-dev patchelf ninja-build ccache libxkbcommon-x11-dev libgl1-mesa-dev chrpath libxcb-cursor0 | |
gcc --version | |
ccache --set-config=cache_dir=$CCACHE_DIR | |
ccache --set-config=max_size=500M | |
ccache --set-config=compression=true | |
elif [ "$RUNNER_OS" == "Windows" ]; then | |
curl -L -O https://download.qt.io/official_releases/qt-installer-framework/4.6.1/QtInstallerFramework-windows-x64-4.6.1.exe | |
./QtInstallerFramework-windows-x64-4.6.1.exe --verbose --script ./ci/install_script_qtifw.qs | |
dir "C:/Qt/" | |
echo "C:/Qt/QtIFW-4.6.1/bin" >> $GITHUB_PATH | |
echo "Using chocolatey to install ninja" | |
choco install ninja | |
# using ccache fails to build .rc files on Windows | |
# ccache is installed under chocolatey but `choco uninstall ccache` fails | |
# setting CCACHE_DISABLE=1 did not work, just remove ccache | |
# echo "Remove ccache if it exists" | |
# rm -f "/c/ProgramData/Chocolatey/bin/ccache" || true | |
choco install ccache | |
ccache --set-config=cache_dir=$CCACHE_DIR | |
ccache --set-config=max_size=500M | |
ccache --set-config=compression=true | |
# C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise | |
MSVC_DIR=$(vswhere -products '*' -requires Microsoft.Component.MSBuild -property installationPath -latest) | |
echo "Latest is: $MSVC_DIR" | |
echo "MSVC_DIR=$MSVC_DIR" >> $GITHUB_ENV | |
# add folder containing vcvarsall.bat | |
echo "$MSVC_DIR\VC\Auxiliary\Build" >> $GITHUB_PATH | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
# The MACOSX_DEPLOYMENT_TARGET environment variable sets the default value for the CMAKE_OSX_DEPLOYMENT_TARGET variable. | |
echo MACOSX_DEPLOYMENT_TARGET=${{ matrix.MACOSX_DEPLOYMENT_TARGET }} >> $GITHUB_ENV | |
echo SDKROOT=${{ matrix.SDKROOT }} >> $GITHUB_ENV | |
echo CMAKE_MACOSX_DEPLOYMENT_TARGET='-DCMAKE_OSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET' >> $GITHUB_ENV | |
if [ "${{ matrix.SELF_HOSTED }}" = "true" ]; then | |
echo "Using previously installed ninja and IFW" | |
echo "/Users/irvinemac/Qt/Tools/QtInstallerFramework/4.3/bin/" >> $GITHUB_PATH | |
else | |
echo "Using brew to install ninja" | |
brew install ninja md5sha1sum ccache | |
ccache --set-config=cache_dir=$CCACHE_DIR | |
ccache --set-config=max_size=500M | |
ccache --set-config=compression=true | |
ccache --set-config=compiler_check=content # darwin only | |
# The openssl@3 package installed on CI adds these files to the pkgconfig directory | |
# Remove them here so they aren't found instead of the version of OpenSSL built by Conan | |
rm /usr/local/lib/pkgconfig/libcrypto.pc | |
rm /usr/local/lib/pkgconfig/libssl.pc | |
rm /usr/local/lib/pkgconfig/openssl.pc | |
echo "Installing IFW" | |
curl -L -O https://download.qt.io/official_releases/qt-installer-framework/4.6.1/QtInstallerFramework-macOS-x64-4.6.1.dmg | |
hdiutil attach -mountpoint ./qtfiw_installer QtInstallerFramework-macOS-x64-4.6.1.dmg | |
echo "ls ./qtfiw_installer" | |
ls ./qtfiw_installer | |
echo "ls ./qtfiw_installer/QtInstallerFramework-macOS-x64-4.6.1.app/" | |
ls ./qtfiw_installer/QtInstallerFramework-macOS-x64-4.6.1.app/ | |
echo "ls ./qtfiw_installer/QtInstallerFramework-macOS-x64-4.6.1.app/Contents/" | |
ls ./qtfiw_installer/QtInstallerFramework-macOS-x64-4.6.1.app/Contents/ | |
echo "ls ./qtfiw_installer/QtInstallerFramework-macOS-x64-4.6.1.app/Contents/MacOS" | |
ls ./qtfiw_installer/QtInstallerFramework-macOS-x64-4.6.1.app/Contents/MacOS | |
echo "ls ./qtfiw_installer/QtInstallerFramework-macOS-x64-4.6.1.app/Contents/Resources" | |
ls ./qtfiw_installer/QtInstallerFramework-macOS-x64-4.6.1.app/Contents/Resources | |
sudo ./qtfiw_installer/QtInstallerFramework-macOS-x64-4.6.1.app/Contents/MacOS/QtInstallerFramework-macOS-x64-4.6.1 --verbose --script ./ci/install_script_qtifw.qs | |
ls ~ | |
ls ~/Qt/ || true | |
ls ~/Qt/QtIFW-4.6.1 || true | |
echo "~/Qt/QtIFW-4.6.1/bin/" >> $GITHUB_PATH | |
fi; | |
fi; | |
cmake --version | |
ccache --show-config || true | |
ccache --zero-stats || true | |
- name: Install conan | |
shell: bash | |
run: | | |
set -x | |
python --version | |
pip install 'conan<2' | |
conan --version | |
echo "Enabling conan revisions and setting parallel_download" | |
conan config set general.revisions_enabled=True | |
conan config set general.parallel_download=8 | |
# We detect the profile and use that as one of the cache key parameters, so if GHA upgrades compilers it won't pick up old binaries | |
conan profile new --detect --force default | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
conan profile update settings.compiler.libcxx=libstdc++11 default | |
fi | |
conan profile show default | |
if [ "${{ matrix.SELF_HOSTED }}" == "false" ]; then | |
echo "runner.workspace=${{ runner.workspace }}" | |
echo "GITHUB_WORKSPACE=$GITHUB_WORKSPACE" | |
echo "github.workspace=${{ github.workspace }}" | |
cat $CONAN_PROFILE_DEFAULT | |
echo format=${{ format('{0}/.conan/profiles/default', env.CONAN_USER_HOME) }} | |
echo hashFiles=${{ hashFiles(format('{0}/.conan/profiles/default', env.CONAN_USER_HOME)) }} | |
echo $CONAN_PROFILE_DEFAULT | |
echo hashFiles=${{ hashFiles(env.CONAN_PROFILE_DEFAULT) }} | |
echo hashFiles_rel=${{ hashFiles('./conan-cache/.conan/profiles/default') }} | |
echo hashFiles_conanInstall=${{ hashFiles('./ConanInstall.cmake') }} | |
fi | |
# Note: I'm picking up the ccache before I do the conan cache, otheriwe on windows when trying to hashFiles('**/CMakeLists.txt') it looks into the conan folder which fails | |
# To prevent problems, changing to multiple more specific glob patterns | |
- name: Setup CCache | |
uses: actions/cache@v3 | |
id: cacheccache | |
if: ${{ !matrix.SELF_HOSTED }} | |
with: | |
path: | | |
${{ env.CCACHE_DIR}} | |
key: ccache-${{ matrix.os }}-build=${{ env.BUILD_TYPE }}-conan-profile=${{ hashFiles(env.CONAN_PROFILE_DEFAULT) }}-ck=${{ secrets.CACHE_KEY }}-cmakelists=${{ hashFiles('CMakeLists.txt', 'src/*/CMakeLists.txt', '*/CMakeLists.txt') }} | |
restore-keys: | | |
ccache-${{ matrix.os }}-build=${{ env.BUILD_TYPE }}-conan-profile=${{ hashFiles(env.CONAN_PROFILE_DEFAULT) }}-ck=${{ secrets.CACHE_KEY }}- | |
- name: Did restoring the CCache-cache work? Yes | |
# If the SDK wasn't found in the cache | |
if: steps.cacheccache.outputs.cache-hit == 'true' | |
shell: bash | |
run: | | |
ccache --show-stats -vv || ccache --show-stats | |
ccache --zero-stats | |
- name: Setup Conan Cache | |
uses: actions/cache@v3 | |
id: cacheconan | |
if: ${{ !matrix.SELF_HOSTED }} | |
with: | |
path: | | |
${{ env.CONAN_USER_HOME }} | |
key: conan-cache-${{ matrix.os }}-build=${{ env.BUILD_TYPE }}-conan-profile=${{ hashFiles(env.CONAN_PROFILE_DEFAULT) }}-ck=${{ secrets.CACHE_KEY }}-conaninstall=${{ hashFiles('./ConanInstall.cmake') }} | |
restore-keys: | | |
conan-cache-${{ matrix.os }}-build=${{ env.BUILD_TYPE }}-conan-profile=${{ hashFiles(env.CONAN_PROFILE_DEFAULT) }}-ck=${{ secrets.CACHE_KEY }}- | |
- name: Did restoring the conan-cache work? Yes | |
# If the SDK wasn't found in the cache | |
if: steps.cacheconan.outputs.cache-hit == 'true' | |
working-directory: ${{ env.CONAN_USER_HOME }} | |
shell: bash | |
run: | | |
cat $CONAN_USER_HOME/.conan/profiles/default | |
ls $CONAN_USER_HOME/.conan/data | |
ls $CONAN_USER_HOME/short || true | |
# This includes the Qt install, the OpenStudio SDK tar.gz, | |
# TODO: problem is that caching the entire build dir is limited to 10 GB. The build folder takes 3-4 GB per runner, and we have 4 of them that try to cache | |
# Perhaps we should just cache the ccache. Anyways, for incremental builds triggered one after another, cache eviction hasn't happened yet and all of them do a cache hit | |
- name: Cache entire build directory | |
id: cachebuild | |
if: ${{ !matrix.SELF_HOSTED }} | |
uses: actions/cache@v3 | |
with: | |
path: | | |
build/Qt-install | |
build/OpenStudio-${{ env.OS_SDK_VERSION }} | |
key: minimal-build-cache-${{ matrix.os }}-build=${{ env.BUILD_TYPE }}-qt=${{ env.QT_VERSION }}-conan-profile=${{ hashFiles(env.CONAN_PROFILE_DEFAULT)}}-ck=${{ secrets.CACHE_KEY }} | |
- name: Did restoring the build-cache work? Yes | |
# If it was found in the cache, list files, and Delete the packages already produced | |
if: steps.cachebuild.outputs.cache-hit == 'true' | |
shell: bash | |
run: | | |
set -x | |
ls build/ || true | |
cat build/CMakeCache.txt || true | |
/bin/rm build/OpenStudioApplication-*${{ env.PLATFORM_NAME }}* || true | |
ls build/ || true | |
# Delete the archived OS SDK if not the expected version | |
if [ -d "build/OpenStudio-$OS_SDK_VERSION" ]; then | |
cd build/OpenStudio-$OS_SDK_VERSION | |
ls $OS_SDK_INSTALLER_NAME* || rm -Rf ./* | |
fi | |
- name: Install Qt | |
# Some projects don't allow in-source building, so create a separate build directory | |
# We'll use this as our working directory for all subsequent commands | |
shell: bash | |
if: ${{ !matrix.SELF_HOSTED }} | |
run: | | |
set -x | |
cmake -E make_directory ./build | |
if [ "$RUNNER_OS" == "Windows" ]; then | |
# QT_INSTALL_DIR="$(pwd)/build/Qt-install/$QT_VERSION/msvc2019_64" | |
QT_INSTALL_DIR="$(cmd.exe //c cd)\build\Qt-install\${{ env.QT_VERSION }}\msvc2019_64" | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
QT_INSTALL_DIR="$(pwd)/build/Qt-install/$QT_VERSION/macos" | |
else | |
QT_INSTALL_DIR="$(pwd)/build/Qt-install/$QT_VERSION/${{ matrix.QT_ARCH }}" | |
fi | |
if [ -d "$QT_INSTALL_DIR" ]; then | |
echo "Qt $QT_VERSION already installed" | |
else | |
echo "Install aqtinstall, then install Qt $QT_VERSION for ${{ matrix.QT_OS_NAME }} ${{ matrix.QT_ARCH }}" | |
pip show setuptools | |
pip install setuptools --upgrade | |
pip3 install aqtinstall | |
aqt install-qt --outputdir ./build/Qt-install/ ${{ matrix.QT_OS_NAME }} desktop $QT_VERSION ${{ matrix.QT_ARCH }} -m qtwebchannel qtwebengine qtwebview qt5compat qtpositioning | |
fi | |
echo "$QT_INSTALL_DIR/bin" >> $GITHUB_PATH | |
echo QT_INSTALL_DIR=$QT_INSTALL_DIR >> $GITHUB_ENV | |
#ls ./build/Qt-install/$QT_VERSION/ | |
#ls $QT_INSTALL_DIR || true | |
#ls $QT_INSTALL_DIR/lib || true | |
#ls $QT_INSTALL_DIR/lib/cmake || true | |
find ./build/Qt-install -name "*.cmake" | |
#ls $QT_INSTALL_DIR/translations || true | |
#ls $QT_INSTALL_DIR/translations/qtwebengine_locales || true | |
find ./build/Qt-install . -name "*.qm" | |
find ./build/Qt-install . -name "*.pak" | |
- name: Find Qt (Self-Hosted) | |
shell: bash | |
if: ${{ matrix.SELF_HOSTED }} | |
run: | | |
set -x | |
cmake -E make_directory ./build | |
if [ "$RUNNER_OS" == "macOS" ]; then | |
QT_INSTALL_DIR="/Users/irvinemac/Qt/6.6.3/macos/" | |
fi | |
echo "$QT_INSTALL_DIR/bin" >> $GITHUB_PATH | |
echo QT_INSTALL_DIR=$QT_INSTALL_DIR >> $GITHUB_ENV | |
#ls ./build/Qt-install/$QT_VERSION/ | |
#ls $QT_INSTALL_DIR || true | |
#ls $QT_INSTALL_DIR/lib || true | |
#ls $QT_INSTALL_DIR/lib/cmake || true | |
find $QT_INSTALL_DIR -name "*.cmake" | |
#ls $QT_INSTALL_DIR/translations || true | |
#ls $QT_INSTALL_DIR/translations/qtwebengine_locales || true | |
find $QT_INSTALL_DIR . -name "*.qm" | |
find $QT_INSTALL_DIR . -name "*.pak" | |
- name: Configure CMake & build (Windows) | |
if: runner.os == 'Windows' | |
shell: cmd | |
working-directory: ./build | |
# Note the current convention is to use the -S and -B options here to specify source | |
# and build directories, but this is only available with CMake 3.13 and higher. | |
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12 | |
# NOTE: If you re-enable 'Download the OpenStudio installer' step, then pass `openstudio_DIR=$openstudio_DIR cmake [etc]` | |
run: | | |
echo "Using vcvarsall to initialize the development environment" | |
call vcvarsall.bat x64 | |
dir | |
cmake -G Ninja -DQT_INSTALL_DIR:PATH=${{ env.QT_INSTALL_DIR }} -DCMAKE_BUILD_TYPE:STRING=${{ env.BUILD_TYPE }} ^ | |
-DBUILD_DOCUMENTATION:BOOL=${{ env.BUILD_DOCUMENTATION }} -DBUILD_TESTING:BOOL=${{ env.BUILD_TESTING }} -DBUILD_BENCHMARK:BOOL=${{ env.BUILD_BENCHMARK}} ^ | |
-DBUILD_PACKAGE:BOOL=${{ env.BUILD_PACKAGE }} -DCPACK_BINARY_DEB:BOOL=${{ env.CPACK_BINARY_DEB }} -DCPACK_BINARY_IFW:BOOL=${{ env.CPACK_BINARY_IFW }} ^ | |
-DCPACK_BINARY_NSIS:BOOL=${{ env.CPACK_BINARY_NSIS }} -DCPACK_BINARY_RPM:BOOL=${{ env.CPACK_BINARY_RPM }} -DCPACK_BINARY_STGZ:BOOL=${{ env.CPACK_BINARY_STGZ }} ^ | |
-DCPACK_BINARY_TBZ2:BOOL=${{ env.CPACK_BINARY_TBZ2 }} -DCPACK_BINARY_TGZ:BOOL=${{ env.CPACK_BINARY_TGZ }} -DCPACK_BINARY_ZIP:BOOL=${{ env.CPACK_BINARY_ZIP }} ^ | |
-DCPACK_BINARY_TXZ:BOOL=${{ env.CPACK_BINARY_TXZ }} -DCPACK_BINARY_TZ:BOOL=${{ env.CPACK_BINARY_TZ }} -DCPACK_SOURCE_RPM:BOOL=${{ env.CPACK_SOURCE_RPM }} ^ | |
-DCPACK_SOURCE_TBZ2:BOOL=${{ env.CPACK_SOURCE_TBZ2 }} -DCPACK_SOURCE_TGZ:BOOL=${{ env.CPACK_SOURCE_TGZ }} -DCPACK_SOURCE_TXZ:BOOL=${{ env.CPACK_SOURCE_TXZ }} ^ | |
-DCPACK_SOURCE_TZ:BOOL=${{ env.CPACK_SOURCE_TZ }} -DCPACK_SOURCE_ZIP:BOOL=${{ env.CPACK_SOURCE_ZIP }} ^ | |
-DANALYTICS_API_SECRET:STRING=${{secrets.ANALYTICS_API_SECRET }} -DANALYTICS_MEASUREMENT_ID:STRING=${{secrets.ANALYTICS_MEASUREMENT_ID }} ^ | |
../ | |
ninja | |
ninja package | |
# Delete conan build and source folders | |
conan remove "*" -s -b -f | |
ccache --show-stats -vv || ccache --show-stats || true | |
# Debug CPack: | |
# "C:\Program Files\CMake\bin\cpack.exe" --debug --verbose --config CPackConfig.cmake | |
- name: Configure CMake (Unix) | |
if: runner.os != 'Windows' | |
shell: bash | |
working-directory: ./build | |
# Note the current convention is to use the -S and -B options here to specify source | |
# and build directories, but this is only available with CMake 3.13 and higher. | |
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12 | |
# NOTE: If you re-enable 'Download the OpenStudio installer' step, then pass `openstudio_DIR=$openstudio_DIR cmake [etc]` | |
run: | | |
set -x | |
cmake -G Ninja -DQT_INSTALL_DIR:PATH=$QT_INSTALL_DIR -DCMAKE_BUILD_TYPE:STRING=$BUILD_TYPE \ | |
-DBUILD_DOCUMENTATION:BOOL=$DBUILD_DOCUMENTATION -DBUILD_TESTING:BOOL=$BUILD_TESTING -DBUILD_BENCHMARK:BOOL=$BUILD_BENCHMARK \ | |
-DBUILD_PACKAGE:BOOL=$BUILD_PACKAGE -DCPACK_BINARY_DEB:BOOL=$CPACK_BINARY_DEB -DCPACK_BINARY_IFW:BOOL=$CPACK_BINARY_IFW \ | |
-DCPACK_BINARY_NSIS:BOOL=$CPACK_BINARY_NSIS -DCPACK_BINARY_RPM:BOOL=$CPACK_BINARY_RPM -DCPACK_BINARY_STGZ:BOOL=$CPACK_BINARY_STGZ \ | |
-DCPACK_BINARY_TBZ2:BOOL=$CPACK_BINARY_TBZ2 -DCPACK_BINARY_TGZ:BOOL=$CPACK_BINARY_TGZ -DCPACK_BINARY_ZIP:BOOL=$CPACK_BINARY_ZIP \ | |
-DCPACK_BINARY_TXZ:BOOL=$CPACK_BINARY_TXZ -DCPACK_BINARY_TZ:BOOL=$CPACK_BINARY_TZ -DCPACK_SOURCE_RPM:BOOL=$CPACK_SOURCE_RPM \ | |
-DCPACK_SOURCE_TBZ2:BOOL=$CPACK_SOURCE_TBZ2 -DCPACK_SOURCE_TGZ:BOOL=$CPACK_SOURCE_TGZ -DCPACK_SOURCE_TXZ:BOOL=$CPACK_SOURCE_TXZ \ | |
-DCPACK_SOURCE_TZ:BOOL=$CPACK_SOURCE_TZ -DCPACK_SOURCE_ZIP:BOOL=$CPACK_SOURCE_ZIP \ | |
-DANALYTICS_API_SECRET:STRING=${{secrets.ANALYTICS_API_SECRET }} -DANALYTICS_MEASUREMENT_ID:STRING=${{secrets.ANALYTICS_MEASUREMENT_ID }} \ | |
../ | |
# Note: JM 2020-07-22 This is an example of how to get a config log for a failed conan dependency build (no binary available) | |
# This WILL be handy some day, so leave it here | |
#- name: upload config.log for failed gdbm build | |
#if: ${{ failure() }} | |
#shell: bash | |
#run: | | |
#configlog=$(find ~/.conan/data/gdbm/1.18.1/_/_/build -name config.log) | |
#cat $configlog | |
#- name: upload config.log for failed gdbm build | |
#if: ${{ failure() }} | |
#uses: actions/upload-artifact@v4 | |
#with: | |
#name: ${{ matrix.os }}-gdbm_config.log | |
#path: ~/.conan/data/gdbm/1.18.1/_/_/build/**/source_subfolder/config.log | |
- name: Build (Unix) | |
working-directory: ./build | |
if: runner.os != 'Windows' | |
shell: bash | |
# Execute the build. You can specify a specific target with "--target <NAME>" | |
run: | | |
set -x | |
ninja | |
ninja package || ( echo "Package Step failed" && cpack --debug --verbose --config CPackConfig.cmake ) | |
# Delete conan build and source folders | |
conan remove "*" -s -b -f | |
# Show ccache stats | |
ccache --show-stats -vv || ccache --show-stats || true | |
- name: Test bed Sign inner portable executable files and exe package (Windows 2022) | |
working-directory: ./build | |
if: (matrix.os == 'windows-2022') | |
shell: powershell | |
run: | | |
$installer_exe = Get-ChildItem -Filter "${{ matrix.BINARY_PKG_PATH }}/*.${{ env.BINARY_EXT }}" -File | Select-Object -First 1 | % { $_.FullName} | |
echo $installer_exe | |
echo "$installer_exe" | |
- name: Sign inner portable executable files and exe package (Windows 2022) | |
working-directory: ./build | |
# if: (runner.os == 'Windows') | |
if: contains(github.ref, 'refs/tags') && (matrix.os == 'windows-2022') | |
shell: powershell | |
run: | | |
# Install signpath | |
Install-Module -Name SignPath -Force | |
# Sign the OpenStudioApp.exe, put the signed version in place | |
Submit-SigningRequest ` | |
-InputArtifactPath "Products/OpenStudioApp.exe" ` | |
-CIUserToken "${{ secrets.SIGNPATH_CI_TOKEN }}" ` | |
-OrganizationId "97f757f1-cd69-467b-b87b-db3eb5102a57" ` | |
-ProjectSlug "OpenStudioApplication" ` | |
-SigningPolicySlug "No_Approval_Release_GHA" ` | |
-OutputArtifactPath "Products/OpenStudioApp.exe" ` | |
-WaitForCompletion -Force | |
# Repackage | |
cpack | |
# Sign the .exe installer as well | |
$installer_exe = Get-ChildItem -Filter "${{ matrix.BINARY_PKG_PATH }}/*.${{ env.BINARY_EXT }}" -File | Select-Object -First 1 | % { $_.FullName} | |
Submit-SigningRequest ` | |
-InputArtifactPath "$installer_exe" ` | |
-CIUserToken "${{ secrets.SIGNPATH_CI_TOKEN }}" ` | |
-OrganizationId "97f757f1-cd69-467b-b87b-db3eb5102a57" ` | |
-ProjectSlug "OpenStudioApplication" ` | |
-SigningPolicySlug "No_Approval_Release_GHA" ` | |
-OutputArtifactPath "$installer_exe" ` | |
-WaitForCompletion -Force | |
- name: Archive binary artifacts | |
uses: actions/upload-artifact@v4 | |
# build/_CPack_Packages/win64/IFW/*.exe | |
# build/_CPack_Packages/Linux/DEB/*.deb | |
# build/_CPack_Packages/Darwin/IFW/*.dmg | |
with: | |
name: OpenStudioApplication-${{ env.OS_APP_VERSION }}.${{ github.sha }}-${{ matrix.os }}.${{ env.BINARY_EXT }} | |
path: build/${{ matrix.BINARY_PKG_PATH }}/*.${{ env.BINARY_EXT }} | |
- name: Archive TGZ or ZIP artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: OpenStudioApplication-${{ env.OS_APP_VERSION }}.${{ github.sha }}-${{ matrix.os }}.${{ env.COMPRESSED_EXT }} | |
path: build/${{ matrix.COMPRESSED_PKG_PATH }}/*.${{ env.COMPRESSED_EXT }} | |
- name: Test | |
working-directory: ./build | |
shell: bash | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: | | |
Xvfb :99 & | |
export DISPLAY=:99 | |
ctest -j -T test --output-on-failure --no-compress-output -C $BUILD_TYPE || true | |
- name: Archive test results? | |
uses: actions/upload-artifact@v4 | |
with: | |
name: OpenStudioApplication-${{ env.OS_APP_VERSION }}.${{ github.sha }}-${{ matrix.os }}-Test.xml | |
path: build/Testing/**/*.xml | |
- name: Benchmark | |
working-directory: ./build | |
shell: bash | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: | | |
Xvfb :99 & | |
export DISPLAY=:99 | |
Products/SpacesSurfaces_Benchmark --benchmark_out_format=csv --benchmark_out='bench_results_SpacesSurfaces.csv' || true | |
- name: Archive benchmark results? | |
uses: actions/upload-artifact@v4 | |
with: | |
name: OpenStudioApplication-${{ env.OS_APP_VERSION }}.${{ github.sha }}-${{ matrix.os }}-bench_results.csv | |
path: build/bench_results_*.csv | |
- name: Upload Binary installer to release | |
if: contains(github.ref, 'refs/tags') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: build/${{ matrix.BINARY_PKG_PATH }}/*.${{ env.BINARY_EXT }} | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true | |
- name: Upload TGZ or ZIP to release | |
if: contains(github.ref, 'refs/tags') | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: build/${{ matrix.COMPRESSED_PKG_PATH }}/*.${{ env.COMPRESSED_EXT }} | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true | |
- name: Delete binary packages | |
working-directory: ./build/ | |
shell: bash | |
run: | | |
ls OpenStudioApplication-* | |
/bin/rm OpenStudioApplication-*${{ env.COMPRESSED_EXT }} || true | |
/bin/rm OpenStudioApplication-*${{ env.BINARY_EXT }} || true | |
ls OpenStudioApplication-* || true |