Skip to content

Commit

Permalink
Merge pull request #652 from openstudiocoalition/develop
Browse files Browse the repository at this point in the history
Merge to master for 1.7.0
  • Loading branch information
macumber authored Feb 1, 2024
2 parents 53c249a + 45132f6 commit 58ef8ce
Show file tree
Hide file tree
Showing 280 changed files with 73,321 additions and 4,817 deletions.
526 changes: 196 additions & 330 deletions .github/workflows/app_build.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/check_osm_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
# Beta Release
uses: cla-assistant/github-action@v2.1.3-beta
uses: cla-assistant/github-action@v2.3.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# the below token should have repo scope and must be manually added by you in the repository's secret
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clangformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run clang-format against C++ files touched by the PR
shell: bash
Expand All @@ -19,7 +19,7 @@ jobs:
- name: Upload clang-format patch as artifact
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: OpenStudioApplication-${{ github.sha }}-clang_format.patch
path: clang_format.patch
4 changes: 2 additions & 2 deletions .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install cppcheck
shell: bash
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:

- name: Upload cppcheck results as artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: OpenStudioApplication-${{ github.sha }}-cppcheck_results.txt
path: cppcheck.txt
4 changes: 2 additions & 2 deletions .github/workflows/export_standards_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8.x'

Expand Down
220 changes: 220 additions & 0 deletions .github/workflows/manual_cli_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
name: Test OS SDK CLI from OpenStudio Application

on:
workflow_dispatch:
inputs:
run_id:
description: 'The github actions run_id where to find the artifacts'
required: true

jobs:
test:
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
BINARY_EXT: deb
COMPRESSED_EXT: tar.gz
- os: ubuntu-22.04
SELF_HOSTED: false
PLATFORM_NAME: Linux
BINARY_EXT: deb
COMPRESSED_EXT: tar.gz
- os: windows-2022
SELF_HOSTED: false
PLATFORM_NAME: Windows
BINARY_EXT: exe
COMPRESSED_EXT: zip
- os: macos-13
SELF_HOSTED: false
PLATFORM_NAME: Darwin
BINARY_EXT: dmg
COMPRESSED_EXT: tar.gz
MACOSX_DEPLOYMENT_TARGET: 10.15
- os: macos-arm64
SELF_HOSTED: true
PLATFORM_NAME: Darwin
BINARY_EXT: dmg
COMPRESSED_EXT: tar.gz
MACOSX_DEPLOYMENT_TARGET: 12.1

steps:
- name: Download binary installer
uses: actions/download-artifact@v4
id: downloader
with:
pattern: OpenStudioApplication-*-${{ matrix.os }}.${{ matrix.COMPRESSED_EXT }}
run-id: ${{ github.event.inputs.run_id}}
github-token: ${{ secrets.GITHUB_TOKEN }}
path: cli_tester
merge-multiple: true

- name: Install OSApp
working-directory: cli_tester
shell: bash
run: |
set -x
echo "steps.downloader.outputs.download-path=${{ steps.downloader.outputs.download-path }}"
ls -R
archive=$(ls *.${{ matrix.COMPRESSED_EXT }})
OSAPP_DIR_NAME=$(basename $archive .${{ matrix.COMPRESSED_EXT }})
echo "OSAPP_DIR_NAME=$OSAPP_DIR_NAME" >> $GITHUB_ENV
if [ "${{ matrix.COMPRESSED_EXT }}" == "tar.gz" ]; then
#OSAPP_DIR_NAME=$(tar tzf $archive | head -1 | cut -f1 -d"/")
tar xfz $archive
else
7z X $archive
fi
examples_dir=$(find $(pwd)/$OSAPP_DIR_NAME -name "Examples" -type d)
OSAPP_ROOT_DIR=$(dirname $examples_dir)
echo "OSAPP_ROOT_DIR=$OSAPP_ROOT_DIR" >> $GITHUB_ENV
echo "puts ARGV" > test.rb
echo "import sys" > test.py
echo "print(sys.argv)" >> test.py
ls
cp -R $examples_dir/compact_osw/* .
if [ ! -d "$OSAPP_ROOT_DIR" ]; then
echo "Directly does not exist! $OSAPP_ROOT_DIR"
exit 1
fi
if [ "$RUNNER_OS" == "Linux" ]; then
export PATH="$OSAPP_ROOT_DIR/bin:$PATH"
echo "$OSAPP_ROOT_DIR/bin" >> $GITHUB_PATH
elif [ "$RUNNER_OS" == "Windows" ]; then
export PATH="$OSAPP_ROOT_DIR/bin:$PATH"
echo "$OSAPP_ROOT_DIR/bin" >> $GITHUB_PATH
elif [ "$RUNNER_OS" == "macOS" ]; then
export PATH="$OSAPP_ROOT_DIR/OpenStudioApp.app/Contents/MacOS:$PATH"
echo "$OSAPP_ROOT_DIR/OpenStudioApp.app/Contents/MacOS" >> $GITHUB_PATH
fi
which openstudio
openstudio openstudio_version
if openstudio labs; then
echo "The Ruby CLI is the default"
echo CLASSIC_SUBCOMMAND= >> $GITHUB_ENV
echo LABS_SUBCOMMAND=labs >> $GITHUB_ENV
else
echo "The C++ CLI is the default"
echo CLASSIC_SUBCOMMAND=classic >> $GITHUB_ENV
echo LABS_SUBCOMMAND= >> $GITHUB_ENV
fi
- name: EnergyPlus itself works
working-directory: cli_tester
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
$OSAPP_ROOT_DIR/EnergyPlus/energyplus --help || ( echo "EnergyPlus missing dependencies!" && sudo apt install -y libgomp1 libx11-6 && $OSAPP_ROOT_DIR/EnergyPlus/energyplus --help )
else
$OSAPP_ROOT_DIR/EnergyPlus/energyplus --help
fi
- name: Classic Ruby CLI test
working-directory: cli_tester
shell: bash
run: |
set -x
openstudio $CLASSIC_SUBCOMMAND --help
openstudio $CLASSIC_SUBCOMMAND openstudio_version
openstudio $CLASSIC_SUBCOMMAND energyplus_version
openstudio $CLASSIC_SUBCOMMAND ruby_version
openstudio $CLASSIC_SUBCOMMAND -e "puts OpenStudio::Model::Model.new()"
openstudio $CLASSIC_SUBCOMMAND -e "require 'oga'; puts Oga::VERSION"
openstudio $CLASSIC_SUBCOMMAND execute_ruby_script test.rb -x arg2
openstudio $CLASSIC_SUBCOMMAND run -w compact_ruby_only.osw
- name: Labs C++ CLI Test
working-directory: cli_tester
shell: bash
run: |
set -x
openstudio $LABS_SUBCOMMAND --help
openstudio $LABS_SUBCOMMAND openstudio_version
openstudio $LABS_SUBCOMMAND energyplus_version
openstudio $LABS_SUBCOMMAND ruby_version
openstudio $LABS_SUBCOMMAND python_version
openstudio $LABS_SUBCOMMAND -e "puts OpenStudio::Model::Model.new()"
openstudio $LABS_SUBCOMMAND -e "require 'oga'; puts Oga::VERSION"
openstudio $LABS_SUBCOMMAND execute_ruby_script test.rb -x arg2
openstudio $LABS_SUBCOMMAND execute_python_script test.py -x arg2
openstudio $LABS_SUBCOMMAND run -w compact_ruby_only.osw
openstudio $LABS_SUBCOMMAND run -w compact_python_only_twomeasures.osw
openstudio $LABS_SUBCOMMAND run -w compact_ruby_then_python.osw
openstudio $LABS_SUBCOMMAND run -w compact_python_then_ruby.osw
- name: Display structure
if: ${{ always() && runner.os == 'Windows' }}
working-directory: cli_tester/${{ env.OSAPP_DIR_NAME }}
run: |
tree /f /a
- name: Display structure
if: ${{ always() && runner.os != 'Windows' }}
working-directory: ${{ env.OSAPP_ROOT_DIR }}
run: |
separator() {
echo -e "\n\033[0;31m===========================================================\033[0m"
};
if [ "$RUNNER_OS" == "macOS" ]; then
brew install tree
inspect_lib() {
separator
echo -e "\033[0;33m$1\033[0m"
otool -L $1
otool -l $1 | grep -A2 LC_RPATH || true
}
BUNDLE_EXT=bundle
SONAME=dylib
CLI_PREFIX=OpenStudioApp.app/Contents/MacOS
else
inspect_lib() {
separator
echo -e "\033[0;33m$1\033[0m"
ldd $1
objdump -x $1 | grep RUNPATH || true
}
BUNDLE_EXT=so
SONAME=so
CLI_PREFIX=bin
fi
tree -I 'Radiance|python_standard_lib|include'
inspect_lib $CLI_PREFIX/openstudio
inspect_lib lib/libopenstudiolib.$SONAME
inspect_lib lib/libpythonengine.so
inspect_lib lib/librubyengine.so
inspect_lib Python/_openstudiomodel.so
inspect_lib Ruby/openstudio.$BUNDLE_EXT
inspect_lib EnergyPlus/energyplus
inspect_lib EnergyPlus/libenergyplusapi.$SONAME
inspect_lib EnergyPlus/ExpandObjects || true
- name: cleanup
if: ${{ always() }}
shell: bash
run: |
rm -Rf ./cli_tester/ || true
rm -Rf ./OpenStudioApplication-*-${{ matrix.os }}.${{ matrix.BINARY_EXT }} || true
rm -Rf ./OpenStudioApplication-*-${{ matrix.os }}.${{ matrix.COMPRESSED_EXT }} || true
4 changes: 2 additions & 2 deletions .github/workflows/release_notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8.x'

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ developer/msvc/Visualizers/all_concat.natvis
.clangd/
cppcheck.txt*
clang_format.patch
conan-cache
.ccache
5 changes: 5 additions & 0 deletions CMake/FixupBundleOverrides.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@ function(gp_resolved_file_type_override file type)
if( file_lower MATCHES ".*concrt.*")
set(type "system" PARENT_SCOPE)
endif()
if( file_lower MATCHES ".*openstudiolib.*")
if(UNIX AND NOT APPLE)
set(type "system" PARENT_SCOPE)
endif()
endif()
endfunction()

Loading

0 comments on commit 58ef8ce

Please sign in to comment.