Skip to content

Commit 3592a72

Browse files
committed
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into negative-coil-capacity-sizing
2 parents 1884a53 + 5d733a0 commit 3592a72

File tree

233 files changed

+9118
-9826
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

233 files changed

+9118
-9826
lines changed
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: "CMake Configure and Build"
2+
description: "Run CMake Configure and Build the targets"
3+
4+
inputs:
5+
build-directory:
6+
description: "the E+ working directory, top level of the repo"
7+
nproc:
8+
required: true
9+
minimal-targets:
10+
description: "If true will build only energyplus and a couple of fortran ones, just enough to run reg tests"
11+
type: boolean
12+
default: false
13+
python-version:
14+
required: true
15+
python-root-dir:
16+
required: true
17+
enable-pch:
18+
description: "Turn on ENABLE_PCH to have pre-compiled headers. Pass ON or OFF"
19+
default: "OFF"
20+
21+
runs:
22+
using: "composite"
23+
steps:
24+
25+
- name: Configure CMake And Build on Windows
26+
if: runner.os == 'Windows'
27+
working-directory: ${{ inputs.build-directory }}
28+
shell: pwsh
29+
run: |
30+
$ErrorActionPreference = 'stop'
31+
$PSNativeCommandUseErrorActionPreference = $true
32+
33+
function Begin-Group {
34+
param([string]$Title)
35+
Write-Output "::group::`e[93m$Title`e[0m"
36+
}
37+
38+
switch ($env:PROCESSOR_ARCHITECTURE) {
39+
"AMD64" { $target_arch = "x64" }
40+
"ARM64" { $target_arch = "arm64" }
41+
default { throw "Unknown architecture: $env:PROCESSOR_ARCHITECTURE" }
42+
}
43+
44+
Begin-Group "Entering a VS Dev Shell"
45+
Import-Module "$env:MSVC_DIR\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
46+
Enter-VsDevShell -VsInstallPath "$env:MSVC_DIR" -SkipAutomaticLocation -devCmdArguments "-arch=$target_arch"
47+
Write-Output "::endgroup::"
48+
49+
Begin-Group "CMake configure"
50+
cmake `
51+
-G Ninja `
52+
-DENABLE_PCH:BOOL=${{ inputs.enable-pch }} `
53+
-DCMAKE_BUILD_TYPE:STRING=Release `
54+
-DLINK_WITH_PYTHON:BOOL=ON `
55+
-DPYTHON_CLI:BOOL=ON `
56+
-DPython_REQUIRED_VERSION:STRING=${{ inputs.python-version }} `
57+
-DPython_ROOT_DIR:PATH=${{ inputs.python-root-dir }} `
58+
-DBUILD_TESTING:BOOL=ON `
59+
-DBUILD_FORTRAN:BOOL=ON `
60+
-DBUILD_PACKAGE:BOOL=OFF `
61+
-DDOCUMENTATION_BUILD:STRING=DoNotBuild `
62+
-DENABLE_OPENMP:BOOL=OFF `
63+
../
64+
Write-Output "::endgroup::"
65+
66+
if ("${{ inputs.minimal-targets }}" -eq "true") {
67+
Begin-Group "Building only energyplus and fortran targets"
68+
ninja energyplus ExpandObjects_build ReadVars_build Slab_build Basement_build AppGPostProcess_build ParametricPreprocessor_build
69+
Write-Output "::endgroup::"
70+
}
71+
else {
72+
Begin-Group "Building full energyplus"
73+
ninja
74+
Write-Output "::endgroup::"
75+
}
76+
77+
Begin-Group "Showing CCache Stats"
78+
try { ccache --show-stats -vv } catch { ccache --show-stats }
79+
ccache --zero-stats
80+
ccache -p
81+
Write-Output "::endgroup::"
82+
83+
- name: Configure CMake And Build on Unix
84+
if: runner.os != 'Windows'
85+
working-directory: ${{ inputs.build-directory }}
86+
shell: bash
87+
run: |
88+
begin_group() { echo -e "::group::\033[93m$1\033[0m"; }
89+
90+
begin_group "CMake configure"
91+
cmake \
92+
-G Ninja \
93+
-DENABLE_PCH:BOOL=${{ inputs.enable-pch }} \
94+
-DCMAKE_BUILD_TYPE:STRING=Release \
95+
-DLINK_WITH_PYTHON:BOOL=ON \
96+
-DPYTHON_CLI:BOOL=ON \
97+
-DPython_REQUIRED_VERSION:STRING=${{ inputs.python-version }} \
98+
-DPython_ROOT_DIR:PATH=${{ inputs.python-root-dir }} \
99+
-DBUILD_TESTING:BOOL=ON \
100+
-DBUILD_FORTRAN:BOOL=ON \
101+
-DBUILD_PACKAGE:BOOL=OFF \
102+
-DDOCUMENTATION_BUILD:STRING=DoNotBuild \
103+
-DENABLE_OPENMP:BOOL=OFF \
104+
../
105+
106+
if [ "${{ inputs.minimal-targets }}" == "true" ]; then
107+
begin_group "Builing only energyplus and fortran targets"
108+
ninja energyplus ExpandObjects ReadVarsESO Slab Basement AppGPostProcess ParametricPreprocessor
109+
echo "::endgroup::"
110+
else
111+
begin_group "Builing full energyplus"
112+
ninja
113+
echo "::endgroup::"
114+
fi;
115+
116+
begin_group "Showing CCache Stats"
117+
ccache --show-stats -vv || ccache --show-stats || true
118+
ccache --zero-stats
119+
ccache -p
120+
echo "::endgroup::"
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: "Setup Runner"
2+
description: "Setup Python, System Dependencies and configure CCache"
3+
4+
inputs:
5+
python-version:
6+
required: true
7+
python-arch:
8+
required: true
9+
10+
outputs:
11+
nproc:
12+
description: "The number of processors"
13+
value: ${{ steps.install-deps.outputs.nproc }}
14+
python-root-dir:
15+
description: "The Python_ROOT_DIR"
16+
value: ${{ steps.install-deps.outputs.python-root-dir }}
17+
ccache-dir:
18+
description: "The ccache directory"
19+
value: ${{ steps.install-deps.outputs.ccache-dir }}
20+
compiler-id:
21+
description: "The computer compiler id to use as a caching key"
22+
value: ${{ steps.install-deps.outputs.compiler-id }}
23+
24+
runs:
25+
using: "composite"
26+
steps:
27+
28+
- name: Set up Python ${{ inputs.python-version }}
29+
id: setup-python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: ${{ inputs.python-version }}
33+
architecture: ${{ inputs.python-arch }}
34+
35+
- name: Install Dependencies
36+
id: install-deps
37+
shell: bash
38+
run: |
39+
echo "Configuring"
40+
begin_group() { echo -e "::group::\033[93m$1\033[0m"; }
41+
42+
begin_group "Figure out NPROC"
43+
NPROC=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu)
44+
echo "There are $NPROC threads available"
45+
echo "NPROC=$NPROC" >> $GITHUB_ENV
46+
echo "nproc=$NPROC" >> $GITHUB_OUTPUT
47+
echo "::endgroup::"
48+
49+
if [ "$RUNNER_OS" == "Windows" ]; then
50+
DIR_SEP="\\"
51+
else
52+
DIR_SEP="/"
53+
fi
54+
echo "DIR_SEP=$DIR_SEP" >> $GITHUB_ENV
55+
56+
begin_group "Install system dependencies such as ninja and ccache"
57+
export CCACHE_DIR="${{ github.workspace }}${DIR_SEP}.ccache"
58+
echo "CCACHE_DIR=$CCACHE_DIR"
59+
echo "CCACHE_DIR=$CCACHE_DIR" >> $GITHUB_ENV
60+
echo "ccache-dir=$CCACHE_DIR" >> $GITHUB_OUTPUT
61+
62+
if [ "$RUNNER_OS" == "Linux" ]; then
63+
echo "FC=gfortran-13" >> $GITHUB_ENV
64+
sudo apt-get -qq update
65+
sudo apt-get -qq install -y libxkbcommon-x11-0 xorg-dev libgl1-mesa-dev ccache
66+
67+
COMPILER="gcc-$(gcc -dumpversion)"
68+
elif [ "$RUNNER_OS" == "Windows" ]; then
69+
choco install ninja ccache
70+
71+
# C:\Program Files\Microsoft Visual Studio\2022\Enterprise
72+
MSVC_DIR=$(vswhere -products '*' -requires Microsoft.Component.MSBuild -latest -property installationPath)
73+
echo "Latest MSVC_DIR is: $MSVC_DIR"
74+
echo "MSVC_DIR=$MSVC_DIR" >> $GITHUB_ENV
75+
# add folder containing vcvarsall.bat
76+
echo "$MSVC_DIR\VC\Auxiliary\Build" >> $GITHUB_PATH
77+
# msvc-17.14
78+
# COMPILER="msvc-$(vswhere -products '*' -requires Microsoft.Component.MSBuild -latest -property installationVersion | cut -d'.' -f 1,2)"
79+
# msvc-2022
80+
COMPILER="msvc-$(vswhere -products '*' -requires Microsoft.Component.MSBuild -latest -property catalog_productLineVersion)"
81+
elif [ "$RUNNER_OS" == "macOS" ]; then
82+
brew update
83+
brew install tcl-tk
84+
brew reinstall gcc@13
85+
echo "FC=$(brew --prefix gcc@13)/bin/gfortran-13" >> $GITHUB_ENV
86+
echo "MACOSX_DEPLOYMENT_TARGET=${{ matrix.macos_dev_target }}" >> $GITHUB_ENV
87+
88+
brew install ccache
89+
ccache --set-config=compiler_check=content # darwin only
90+
# clang-19
91+
COMPILER="clang-$(clang -dumpversion | cut -d'.' -f 1)"
92+
fi;
93+
echo "::endgroup::"
94+
95+
begin_group "compiler ID"
96+
echo "compiler-id=$COMPILER"
97+
echo "COMPILER=$COMPILER" >> $GITHUB_ENV
98+
echo "compiler-id=$COMPILER" >> $GITHUB_OUTPUT
99+
echo "::endgroup::"
100+
101+
# Setup ccache, common
102+
begin_group "Configure CCache"
103+
ccache --set-config=cache_dir=$CCACHE_DIR
104+
ccache --set-config=max_size=500M
105+
ccache --set-config=compression=true
106+
ccache --set-config=sloppiness=pch_defines,time_macros
107+
ccache --set-config=base_dir="${{ github.workspace }}"
108+
ccache -p
109+
echo "::endgroup::"
110+
111+
begin_group "App Python_ROOT_DIR env variable"
112+
Python_ROOT_DIR="$RUNNER_TOOL_CACHE/Python/${{ steps.setup-python.outputs.python-version }}/${{ inputs.python-arch }}"
113+
echo "Python_ROOT_DIR=$Python_ROOT_DIR" >> $GITHUB_ENV
114+
echo "python-root-dir=$Python_ROOT_DIR" >> $GITHUB_OUTPUT
115+
echo "::endgroup::"
116+
117+
begin_group "Install python dependencies"
118+
pip install pytest lxml tzdata
119+
echo "::endgroup::"

.github/workflows/build_documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
steps:
3030
- name: Checkout EnergyPlus
31-
uses: actions/checkout@v4
31+
uses: actions/checkout@v5
3232

3333
- name: Set up Python 3.12
3434
uses: actions/setup-python@v5

.github/workflows/build_wheels.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
python-version: ["3.9"]
24-
os: [ubuntu-22.04] # , macos-13, windows-2019]
24+
os: [ubuntu-22.04] # , macos-13, windows-2022]
2525

2626
runs-on: ${{ matrix.os }}
2727

2828
steps:
2929
- name: Checkout EnergyPlus
30-
uses: actions/checkout@v4
30+
uses: actions/checkout@v5
3131
with:
3232
ref: ${{ github.event.inputs.ref }}
3333

@@ -47,7 +47,7 @@ jobs:
4747
path: ./dist
4848

4949
- name: Deploy on Test PyPi
50-
uses: pypa/gh-action-pypi-publish@v1.12.4
50+
uses: pypa/gh-action-pypi-publish@v1.13.0
5151
with:
5252
repository-url: https://test.pypi.org/legacy/
5353
user: __token__

.github/workflows/clean_cache.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Cleanup github runner caches on closed pull requests
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
7+
jobs:
8+
cleanup:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
actions: write
12+
steps:
13+
- name: Cleanup
14+
run: |
15+
echo "Fetching list of cache keys"
16+
cacheKeysForPR=$(gh cache list --ref $BRANCH --limit 100 --json id --jq '.[].id')
17+
18+
## Setting this to not fail the workflow while deleting cache keys.
19+
set +e
20+
echo "Deleting caches..."
21+
for cacheKey in $cacheKeysForPR
22+
do
23+
gh cache delete $cacheKey
24+
done
25+
echo "Done"
26+
env:
27+
GH_TOKEN: ${{ github.token }}
28+
GH_REPO: ${{ github.repository }}
29+
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge

.github/workflows/disabled_test_debug_builds.yml.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
-DBUILD_PACKAGE:BOOL=OFF
6060
-DDOCUMENTATION_BUILD:STRING=DoNotBuild
6161
-DENABLE_OPENMP:BOOL=OFF
62-
-DUSE_OpenMP:BOOL=OFF
6362
../
6463

6564
- name: Build
@@ -129,7 +128,6 @@ jobs:
129128
-DBUILD_PACKAGE:BOOL=OFF
130129
-DDOCUMENTATION_BUILD:STRING=DoNotBuild
131130
-DENABLE_OPENMP:BOOL=OFF
132-
-DUSE_OpenMP:BOOL=OFF
133131
-DENABLE_COVERAGE:BOOL=ON
134132
../
135133

.github/workflows/release_linux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
contents: write
4444

4545
steps:
46-
- uses: actions/checkout@v4
46+
- uses: actions/checkout@v5
4747

4848
- name: Set up Python ${{ env.Python_REQUIRED_VERSION }}
4949
id: setup-python
@@ -152,7 +152,7 @@ jobs:
152152
test_key: ubuntu2404-arm64
153153

154154
steps:
155-
- uses: actions/checkout@v4 # Still need E+ checked out to get testing scripts
155+
- uses: actions/checkout@v5 # Still need E+ checked out to get testing scripts
156156
with:
157157
path: checkout
158158

@@ -164,7 +164,7 @@ jobs:
164164
architecture: ${{ matrix.arch }}
165165

166166
- name: Gather Test Package from Artifacts
167-
uses: actions/download-artifact@v4
167+
uses: actions/download-artifact@v5
168168
with:
169169
name: energyplus-${{ matrix.os }}
170170
path: package

.github/workflows/release_mac.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
contents: write
5050

5151
steps:
52-
- uses: actions/checkout@v4
52+
- uses: actions/checkout@v5
5353

5454
# - name: Setup QtIFW 4.x
5555
# uses: jmarrec/setup-qtifw@v1
@@ -166,7 +166,7 @@ jobs:
166166
-DPython_ROOT_DIR:PATH=$RUNNER_TOOL_CACHE/Python/${{ steps.setup-python.outputs.python-version }}/${{ matrix.python-arch }}/ \
167167
-DBUILD_FORTRAN:BOOL=ON -DBUILD_PACKAGE:BOOL=ON \
168168
-DDOCUMENTATION_BUILD:STRING=$DOCUMENTATION_BUILD -DTEX_INTERACTION:STRING="batchmode" \
169-
-DENABLE_OPENMP:BOOL=OFF -DUSE_OpenMP:BOOL=OFF \
169+
-DENABLE_OPENMP:BOOL=OFF \
170170
-DCPACK_CODESIGNING_DEVELOPPER_ID_APPLICATION:STRING="Developer ID Application: National Renewable Energy Laboratory (K7JYVQJL7R)" \
171171
-DCPACK_CODESIGNING_NOTARY_PROFILE_NAME:STRING=EnergyPlus \
172172
../
@@ -293,7 +293,7 @@ jobs:
293293
test_key: mac13-arm64
294294

295295
steps:
296-
- uses: actions/checkout@v4 # Still need E+ checked out to get testing scripts
296+
- uses: actions/checkout@v5 # Still need E+ checked out to get testing scripts
297297
with:
298298
path: checkout
299299

@@ -305,7 +305,7 @@ jobs:
305305
architecture: ${{ matrix.python-arch }}
306306

307307
- name: Gather Test Package from Artifacts
308-
uses: actions/download-artifact@v4
308+
uses: actions/download-artifact@v5
309309
with:
310310
name: energyplus-${{ matrix.os }}.tar.gz
311311
path: package
@@ -323,7 +323,7 @@ jobs:
323323
run: python checkout/scripts/package_tests/runner.py --verbose ${{ matrix.test_key }} package/
324324

325325
- name: Gather Dmg Package from Artifacts
326-
uses: actions/download-artifact@v4
326+
uses: actions/download-artifact@v5
327327
with:
328328
name: energyplus-${{ matrix.os }}.dmg
329329
path: dmg

0 commit comments

Comments
 (0)