Skip to content

Commit

Permalink
Merge branch 'develop' into 4544_CoilCoolingDX_clone_proper
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec authored Feb 16, 2023
2 parents c19e317 + 962f53e commit cdcfa0a
Show file tree
Hide file tree
Showing 337 changed files with 122,480 additions and 4,009 deletions.
165 changes: 82 additions & 83 deletions .github/workflows/buildCSharp.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: buildCSharpSDK

on:
on:
push:
branches: [ develop ]
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 ]

jobs:
build-csharp:
Expand All @@ -15,21 +20,21 @@ jobs:
name: [Ubuntu, macOS, Windows64, Windows32]
include:
- name: Ubuntu
os: ubuntu-18.04
os: ubuntu-20.04
- name: macOS
os: macos-10.15
- name: Windows64
os: windows-2019
os: windows-latest
- name: Windows32
os: windows-2019
os: windows-latest

steps:
- name: "Checkout develop Branch"
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: develop

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

Expand All @@ -54,7 +59,7 @@ jobs:
cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DBUILD_CSHARP_BINDINGS=ON -DBUILD_NUGET_PACKAGE=OFF \
-DBUILD_TESTING=OFF -DBUILD_RUBY_BINDINGS=OFF -DBUILD_CLI=OFF \
-DBUILD_TESTING=OFF -DBUILD_RUBY_BINDINGS=OFF -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_CLI=OFF \
-DBUILD_PACKAGE=OFF \
../
Expand All @@ -72,37 +77,47 @@ jobs:
cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DBUILD_CSHARP_BINDINGS=ON -DBUILD_NUGET_PACKAGE=OFF \
-DBUILD_TESTING=OFF -DBUILD_RUBY_BINDINGS=OFF -DBUILD_CLI=OFF \
-DBUILD_TESTING=OFF -DBUILD_RUBY_BINDINGS=OFF -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_CLI=OFF \
-DBUILD_PACKAGE=OFF \
../
make -j3
- name: Compile Windows 64
if: matrix.name == 'Windows64'
uses: lukka/run-cmake@v2
with:
cmakeGenerator: VS16Win64
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: ${{ github.workspace }}/CMakeLists.txt
cmakeBuildType: Release
cmakeAppendedArgs: '-DCMAKE_BUILD_TYPE=Release -DBUILD_CSHARP_BINDINGS=ON -DBUILD_NUGET_PACKAGE=OFF -DBUILD_TESTING=OFF -DBUILD_RUBY_BINDINGS=OFF -DBUILD_CLI=OFF -DBUILD_PACKAGE=OFF'
buildWithCMakeArgs: "--config Release -j2"
buildDirectory: ${{ github.workspace }}/build
buildWithCMake: true
shell: cmd
run: |
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -A x64 ^
-DCMAKE_BUILD_TYPE=Release ^
-DBUILD_CSHARP_BINDINGS=ON -DBUILD_NUGET_PACKAGE=OFF ^
-DBUILD_TESTING=OFF -DBUILD_RUBY_BINDINGS=OFF -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_CLI=OFF ^
-DBUILD_PACKAGE=OFF ^
../
cmake --build . --verbose --config Release -j 2
- name: Install Dotnet x86
if: matrix.name == 'Windows32'
run: |
Invoke-WebRequest 'https://dotnetcli.azureedge.net/dotnet/Runtime/7.0.1/dotnet-runtime-7.0.1-win-x86.exe' -OutFile './dotnet-runtime-7.0.1-win-x86.exe'
./dotnet-runtime-7.0.1-win-x86.exe /install /quiet /norestart
dotnet --info
- name: Compile Windows 32
if: matrix.name == 'Windows32'
uses: lukka/run-cmake@v2
with:
cmakeGenerator: VS16Win32
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: ${{ github.workspace }}/CMakeLists.txt
cmakeBuildType: Release
cmakeAppendedArgs: '-A Win32 -DCMAKE_BUILD_TYPE=Release -DBUILD_CSHARP_BINDINGS=ON -DBUILD_NUGET_PACKAGE=OFF -DBUILD_TESTING=OFF -DBUILD_RUBY_BINDINGS=OFF -DBUILD_CLI=OFF -DBUILD_PACKAGE=OFF'
buildWithCMakeArgs: "--config Release -j2"
buildDirectory: ${{ github.workspace }}/build
buildWithCMake: true
shell: cmd
run: |
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -A Win32 ^
-DCMAKE_BUILD_TYPE=Release ^
-DBUILD_CSHARP_BINDINGS=ON -DBUILD_NUGET_PACKAGE=OFF ^
-DBUILD_TESTING=OFF -DBUILD_RUBY_BINDINGS=OFF -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_CLI=OFF ^
-DBUILD_PACKAGE=OFF ^
../
cmake --build . --verbose --config Release -j 2
- name: build nuget for Windows
Expand Down Expand Up @@ -145,37 +160,7 @@ jobs:
echo "Listing ./build/Products/=========================================="
ls -R ./build/Products
- name: Tests on Windows for x64
if: matrix.name == 'Windows64'
run: |
cd csharp/examples/OpenStudio.Tests/
dotnet remove package OpenStudio
dotnet restore OpenStudio.Tests.csproj
dotnet add OpenStudio.Tests.csproj package OpenStudio -s "./../../../build/Products/csharp/Release"
echo "Testing for both Net5 and Net45"
dotnet test OpenStudio.Tests.csproj /p:Platform=x64
- name: Tests on Windows for x32
if: matrix.name == 'Windows32'
run: |
cd csharp/examples/OpenStudio.Tests/
dotnet remove package OpenStudio
dotnet restore OpenStudio.Tests.csproj
dotnet add OpenStudio.Tests.csproj package OpenStudio -s "./../../../build/Products/csharp/Release"
echo "Testing for both Net5 and Net45"
dotnet test OpenStudio.Tests.csproj /p:Platform=x86
- name: Tests dotnet 5 on Mac and Linux
if: runner.os != 'Windows'
run: |
cd csharp/examples/OpenStudio.Tests/
dotnet remove package OpenStudio
dotnet restore OpenStudio.Tests.csproj
dotnet add OpenStudio.Tests.csproj package OpenStudio -s "./../../../build/Products/csharp/Release"
dotnet test OpenStudio.Tests.csproj -f NET5 /p:Platform=x64
- name: Zip Build/Source Artifact
if: runner.os != 'Windows'
run: |
Expand All @@ -191,20 +176,20 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: CSharp_${{ matrix.name }}
path: CSharp_${{ matrix.name }}.zip

- name: Upload artifact generated_sources
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: CSharp_${{ matrix.name }}_Src
path: CSharp_${{ matrix.name }}_Src.zip

- name: Upload artifact (if failed)
if: failure()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}_Failed
path: |
Expand All @@ -213,22 +198,23 @@ jobs:
Test_Windows:
name: "Merge x86 and x64 nuget packages for windows"
name: "Test x86 and x64 nuget packages for windows"
runs-on: windows-latest
timeout-minutes: 20
needs: build-csharp

steps:
- name: "Checkout Master Branch"
uses: actions/checkout@v2
uses: actions/checkout@v3


- name: Download CSharp_Windows32
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: CSharp_Windows32

- name: Download CSharp_Windows64
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: CSharp_Windows64

Expand Down Expand Up @@ -272,22 +258,35 @@ jobs:
ls
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: nugetPackage
name: CSharp_Windows_x64x86
path: x64x86\OpenStudio.nupkg

- name: Install Dotnet x86
run: |
Invoke-WebRequest 'https://dotnetcli.azureedge.net/dotnet/Runtime/7.0.1/dotnet-runtime-7.0.1-win-x86.exe' -OutFile './dotnet-runtime-7.0.1-win-x86.exe'
./dotnet-runtime-7.0.1-win-x86.exe /install /quiet /norestart
dotnet --info
- name: Tests on Windows
run: |
$VERSION = (Get-Item x64x86\build\netstandard2.0\x64\OpenStudio.dll).VersionInfo.FileVersion
echo $VERSION
cp *.nupkg csharp/examples/OpenStudio.Tests/
cd csharp/examples/OpenStudio.Tests/
dotnet remove package OpenStudio
ls
dotnet remove OpenStudio.Tests.csproj package OpenStudio
dotnet remove OpenStudio.Tests.x86.csproj package OpenStudio
dotnet restore OpenStudio.Tests.csproj
dotnet add OpenStudio.Tests.csproj package OpenStudio -s "./../../../"
dotnet restore OpenStudio.Tests.x86.csproj
dotnet add OpenStudio.Tests.csproj package OpenStudio -s "." -v $VERSION
dotnet add OpenStudio.Tests.x86.csproj package OpenStudio -s "." -v $VERSION
dotnet test OpenStudio.Tests.csproj /p:Platform=x64
dotnet clean
dotnet test OpenStudio.Tests.csproj /p:Platform=x86
dotnet test OpenStudio.Tests.csproj --arch x64
dotnet clean OpenStudio.Tests.csproj
dotnet test OpenStudio.Tests.x86.csproj --arch x86
Test_Mac_ubuntu:
name: "Test x64 nuget packages for macos and ubuntu"
Expand All @@ -299,18 +298,18 @@ jobs:
name: [Ubuntu, macOS]
include:
- name: Ubuntu
os: ubuntu-18.04
os: ubuntu-latest
- name: macOS
os: macos-10.15
os: macos-latest
timeout-minutes: 20
needs: build-csharp

steps:
- name: "Checkout Master Branch"
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Download nuget
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: CSharp_${{ matrix.name }}

Expand All @@ -323,12 +322,12 @@ jobs:
- name: Tests
run: |
cd csharp/examples/OpenStudio.Tests/
dotnet remove package OpenStudio
dotnet remove OpenStudio.Tests.csproj package OpenStudio
dotnet restore OpenStudio.Tests.csproj
dotnet add OpenStudio.Tests.csproj package OpenStudio -s "./../../../nuget"
dotnet clean
dotnet test OpenStudio.Tests.csproj -f NET5 /p:Platform=x64
dotnet clean OpenStudio.Tests.csproj
dotnet test OpenStudio.Tests.csproj --arch x64
29 changes: 19 additions & 10 deletions .github/workflows/python_bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:
allow_failure: false
extra_cmake_args: "-DCONAN_FIRST_TIME_BUILD_ALL:BOOL=ON"
- name: macOS
os: macos-10.15
os: macos-11
python-version: 3.8
allow_failure: false
MACOSX_DEPLOYMENT_TARGET: 10.15
SDKROOT: /Applications/Xcode_11.7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer
SDKROOT: /Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app/Contents/Developer
extra_cmake_args: ""
- name: Windows_py37
os: windows-2019
Expand All @@ -60,6 +60,7 @@ jobs:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -182,7 +183,10 @@ jobs:
echo "Using vcvarsall to initialize the development environment"
call vcvarsall.bat x64
echo "Launching a build with BUILD_PYTHON_BINDINGS=ON and BUILD_PYTHON_PIP_PACKAGE=ON, turning off as many other things as possible to speed it up"
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON_BINDINGS=ON -DBUILD_PYTHON_PIP_PACKAGE=ON -DPYTHON_PIP_REPOSITORY=${{ env.PYTHON_PIP_REPOSITORY }} -DPYTHON_VERSION=${{ matrix.python-version }} -DBUILD_TESTING=OFF -DBUILD_RUBY_BINDINGS=${{ env.BUILD_RUBY_BINDINGS }} -DBUILD_CLI=${{ env.BUILD_CLI }} ../
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ^
-DBUILD_PYTHON_BINDINGS:BOOL=ON -DBUILD_PYTHON_PIP_PACKAGE:BOOL=ON -DPYTHON_PIP_REPOSITORY:STRING=${{ env.PYTHON_PIP_REPOSITORY }} ^
-DPYTHON_VERSION:STRING=${{ steps.setup-python.outputs.python-version }} ^
-DBUILD_TESTING:BOOL=OFF -DBUILD_RUBY_BINDINGS:BOOL=${{ env.BUILD_RUBY_BINDINGS }} -DBUILD_CLI:BOOL=${{ env.BUILD_CLI }} ../
ninja
ninja python_package
Expand All @@ -193,9 +197,10 @@ jobs:
run: |
set -x
echo "Launching a build with BUILD_PYTHON_BINDINGS=ON and BUILD_PYTHON_PIP_PACKAGE=ON, turning off as many other things as possible to speed it up"
cmake ${{ matrix.extra_cmake_args}} -DCMAKE_BUILD_TYPE=Release \
-DBUILD_PYTHON_BINDINGS=ON -DBUILD_PYTHON_PIP_PACKAGE=ON -DPYTHON_PIP_REPOSITORY=${{ env.PYTHON_PIP_REPOSITORY }} -DPYTHON_VERSION=${{ matrix.python-version }} \
-DBUILD_TESTING=OFF -DBUILD_RUBY_BINDINGS=${{ env.BUILD_RUBY_BINDINGS }} -DBUILD_CLI=${{ env.BUILD_CLI }} \
cmake ${{ matrix.extra_cmake_args}} -DCMAKE_BUILD_TYPE:STRING=Release \
-DBUILD_PYTHON_BINDINGS:BOOL=ON -DBUILD_PYTHON_PIP_PACKAGE:BOOL=ON -DPYTHON_PIP_REPOSITORY:STRING=${{ env.PYTHON_PIP_REPOSITORY }} \
-DPYTHON_VERSION:STRING=${{ steps.setup-python.outputs.python-version }} -DPython_ROOT_DIR:PATH=$RUNNER_TOOL_CACHE/Python/${{ steps.setup-python.outputs.python-version }}/x64/ \
-DBUILD_TESTING:BOOL=OFF -DBUILD_RUBY_BINDINGS:BOOL=${{ env.BUILD_RUBY_BINDINGS }} -DBUILD_CLI:BOOL=${{ env.BUILD_CLI }} \
../
- name: Build (Unix)
Expand Down Expand Up @@ -292,7 +297,7 @@ jobs:
python-version: 3.8
allow_failure: false
- name: macOS
os: macos-10.15
os: macos-11
python-version: 3.8
allow_failure: false
- name: Windows_py37
Expand Down Expand Up @@ -327,7 +332,11 @@ jobs:
python -m pip install --upgrade pip
# Note: if we choose to do ALL or nothing, remove setuptools wheel twine (not needed unless trying to upload within this step)
pip install requests packaging setuptools wheel twine
bindings_v=$(python ./python/find_pypi_tag.py --current)
if [[ "$GITHUB_REF" == *"refs/tags"* ]]; then
bindings_v=$(python ./python/module/find_pypi_tag.py --pypi)
else
bindings_v=$(python ./python/module/find_pypi_tag.py --current)
fi;
pip install -i https://test.pypi.org/simple/ openstudio==$bindings_v
mkdir wheel
Expand All @@ -338,7 +347,7 @@ jobs:
m = openstudio.model.exampleModel()
print(m)
# if python_bindings succeeds but test_python_bindings fails and this is a release,
# if python_bindings succeeds but test_python_bindings fails and this is a release,
# remove that version from testpypi
upload_python_bindings_to_pypi:
if: contains(github.ref, 'refs/tags')
Expand Down
Loading

0 comments on commit cdcfa0a

Please sign in to comment.