Skip to content

IPH models pull request #4696

IPH models pull request

IPH models pull request #4696

Workflow file for this run

name: CI
on:
push:
pull_request:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
DEFAULT_BRANCH: develop
WX_VERSION: '3.2.6'
jobs:
build-ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10' ]
steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.24.x'
- name: Set relative paths
run: |
LKDIR=$GITHUB_WORKSPACE/lk
echo "LKDIR=$LKDIR" >> $GITHUB_ENV
WEXDIR=$GITHUB_WORKSPACE/wex
echo "WEXDIR=$WEXDIR" >> $GITHUB_ENV
SSCDIR=$GITHUB_WORKSPACE/ssc
echo "SSCDIR=$SSCDIR" >> $GITHUB_ENV
RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc
echo "RAPIDJSONDIR=$RAPIDJSONDIR" >> $GITHUB_ENV
SAMNTDIR=$GITHUB_WORKSPACE/sam
echo "SAMNTDIR=$SAMNTDIR" >> $GITHUB_ENV
WXMSW3=$HOME/wx-$WX_VERSION
echo "WXMSW3=$WXMSW3" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y \
freeglut3-dev \
libcurl4-openssl-dev \
libfontconfig-dev \
libgl1-mesa-dev \
libgtk2.0-dev \
mesa-common-dev \
unzip
- name: Get cached build of wxWidgets
uses: actions/cache@v4
id: cachedwx
with:
path: ${{env.WXMSW3}}/
key: wxWidgets-${{ env.WX_VERSION }}-linux
- name: Install wxWidgets
if: steps.cachedwx.outputs.cache-hit != 'true'
run: |
curl -L https://github.com/wxWidgets/wxWidgets/releases/download/v$WX_VERSION/wxWidgets-$WX_VERSION.tar.bz2 -o wxWidgets-$WX_VERSION.tar.bz2
tar jxf wxWidgets-$WX_VERSION.tar.bz2
cd wxWidgets-$WX_VERSION
./configure --prefix=$HOME/wx-$WX_VERSION --enable-shared=no --enable-debug=no --with-gtk=2 --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin --without-libjbig --without-liblzma --without-gtkprint --with-libnotify=no --with-libmspack=no --with-gnomevfs=no --with-opengl=yes --with-sdl=no --with-cxx=11
make -j4
make install
sudo ln -s $HOME/wx-$WX_VERSION/bin/wx-config /usr/local/bin/wx-config-3
wx-config-3 --cflags
echo $HOME/wx-$WX_VERSION/bin >> $GITHUB_PATH
- name: Get branch name for pull request
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "GIT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
echo "DEFAULT_BRANCH=$GITHUB_BASE_REF" >> $GITHUB_ENV
- name: Get branch name for push
if: ${{ github.event_name == 'push' }}
run: |
echo "GIT_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Determine branches for other repos
shell: bash {0}
run: |
echo "GITHUB_REPOSITORY_OWNER=${GITHUB_REPOSITORY_OWNER}" >> $GITHUB_ENV
git ls-remote --heads --exit-code https://github.com/${GITHUB_REPOSITORY_OWNER}/lk.git $GIT_BRANCH
if [[ $? != "0" ]]; then echo "LK_BRANCH=$DEFAULT_BRANCH" >> $GITHUB_ENV; else echo "LK_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV; fi
git ls-remote --heads --exit-code https://github.com/${GITHUB_REPOSITORY_OWNER}/wex.git $GIT_BRANCH
if [[ $? != "0" ]]; then echo "WEX_BRANCH=$DEFAULT_BRANCH" >> $GITHUB_ENV; else echo "WEX_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV; fi
git ls-remote --heads --exit-code https://github.com/${GITHUB_REPOSITORY_OWNER}/ssc.git $GIT_BRANCH
if [[ $? != "0" ]]; then echo "SSC_BRANCH=$DEFAULT_BRANCH" >> $GITHUB_ENV; else echo "SSC_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV; fi
- name: Get git ref of sibling dependencies
run: |
ref=$(git ls-remote --exit-code https://github.com/NREL/lk.git refs/heads/$LK_BRANCH | awk '{print $1}')
echo "ref_of_lk=$ref" | tee --append $GITHUB_ENV
ref=$(git ls-remote --exit-code https://github.com/NREL/wex.git refs/heads/$WEX_BRANCH | awk '{print $1}')
echo "ref_of_wex=$ref" | tee --append $GITHUB_ENV
ref=$(git ls-remote --exit-code https://github.com/NREL/ssc.git refs/heads/$SSC_BRANCH | awk '{print $1}')
echo "ref_of_ssc=$ref" | tee --append $GITHUB_ENV
- name: Get cached build data of sibling dependency LK
uses: actions/cache@v4
id: cachedlk
with:
path: lk
key: linux-${{ env.ref_of_lk }}-LK
- name: Clone sibling dependency LK
if: steps.cachedlk.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: ${{ env.ref_of_lk }}
path: lk
repository: NREL/lk
- name: Get cached build data of sibling dependency WEX
uses: actions/cache@v4
id: cachedwex
with:
path: wex
key: linux-${{ env.ref_of_wex }}-WEX
- name: Clone sibling dependency WEX
if: steps.cachedwex.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: ${{ env.ref_of_wex }}
path: wex
repository: NREL/wex
- name: Get cached build data of sibling dependency SSC
uses: actions/cache@v4
id: cachedssc
with:
path: ssc
key: linux-${{ env.ref_of_ssc }}-SSC
- name: Clone sibling dependency SSC
if: steps.cachedssc.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: ${{ env.ref_of_ssc }}
path: ssc
repository: NREL/ssc
- name: Build LK
if: steps.cachedlk.outputs.cache-hit != 'true'
run: |
cd $GITHUB_WORKSPACE/lk
cmake -Bbuild -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSAM_SKIP_TOOLS=1
cmake --build build -j4
- name: Build WEX
if: steps.cachedwex.outputs.cache-hit != 'true'
run: |
cd $GITHUB_WORKSPACE/wex
cmake -Bbuild -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSAM_SKIP_TOOLS=1
cmake --build build -j4
- name: Build SSC
if: steps.cachedssc.outputs.cache-hit != 'true'
run: |
cd $GITHUB_WORKSPACE/ssc
cmake -Bbuild -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSAM_SKIP_TESTS=1 -DSAM_SKIP_TOOLS=1 -DSAMAPI_EXPORT=0
cmake --build build -j4 --target ssc
- name: Checkout SAM
uses: actions/checkout@v4
with:
path: sam
- name: Build sam
run: |
cd $GITHUB_WORKSPACE/sam
cmake -Bbuild -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSAMAPI_EXPORT=0
cmake --build build -j4
- name: Generate test file
shell: bash {0}
run: results="1"; nohup xvfb-run ${SAMNTDIR}"/build/deploy/linux_64/SAMOS.bin" no_sam_file ${SAMNTDIR}"/build/deploy/test_script_ow.lk" &>/dev/null & while [[ $results != "0" ]]; do sleep 60; lines=$(wc -l ${SAMNTDIR}/build/test_results_linux64.csv | cut -d' ' -f1); echo $lines; grep -i final_configuration_eof ${SAMNTDIR}/build/test_results_linux64.csv; results=$?; done
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Test Results Linux
path: ${{env.SAMNTDIR}}/build/test_results_linux64.csv
- name: Evaluate test results vs Linux file
run: |
python ${SAMNTDIR}/test/compare_lk_test_output.py ${SAMNTDIR}/test_results_linux64.csv ${SAMNTDIR}/build/test_results_linux64.csv false
- name: Evaluate test results vs Windows file
run: |
python $SAMNTDIR/test/compare_lk_test_output.py ${SAMNTDIR}/test_results_win64.csv ${SAMNTDIR}/build/test_results_linux64.csv true
- name: Run SSC Variable & SAM Defaults Differ
run: |
python -m pip install --upgrade pip
pip install -r ${SAMNTDIR}/test/requirements.txt
python ${SAMNTDIR}/test/run_defaults_diff.py
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: SSC Var & SAM Defaults Diff
path: ${{env.SAMNTDIR}}/version_diff.json
build-windows:
runs-on: windows-latest
strategy:
matrix:
python-version: [ '3.10' ]
steps:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.24.x'
- name: Set relative paths
shell: bash
run: |
LKDIR=$GITHUB_WORKSPACE/lk
echo "LKDIR=$LKDIR" >> $GITHUB_ENV
WEXDIR=$GITHUB_WORKSPACE/wex
echo "WEXDIR=$WEXDIR" >> $GITHUB_ENV
SSCDIR=$GITHUB_WORKSPACE/ssc
echo "SSCDIR=$SSCDIR" >> $GITHUB_ENV
RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc
echo "RAPIDJSONDIR=$RAPIDJSONDIR" >> $GITHUB_ENV
SAMNTDIR=$GITHUB_WORKSPACE/sam
echo "SAMNTDIR=$SAMNTDIR" >> $GITHUB_ENV
WXMSW3=$HOME/wx-$WX_VERSION
echo "WXMSW3=$WXMSW3" >> $GITHUB_ENV
- name: Get cached build of wxWidgets
uses: actions/cache@v4
id: cachedwx
with:
path: ${{env.WXMSW3}}/
key: wxWidgets-${{ env.WX_VERSION }}-windows
- name: Download wxWidgets
if: steps.cachedwx.outputs.cache-hit != 'true'
shell: bash
run: |
curl -L https://github.com/wxWidgets/wxWidgets/releases/download/v$WX_VERSION/wxWidgets-$WX_VERSION.tar.bz2 -o wxWidgets-$WX_VERSION.tar.bz2
tar jxf wxWidgets-$WX_VERSION.tar.bz2
- name: Install wxWidgets
if: steps.cachedwx.outputs.cache-hit != 'true'
run: |
cd wxWidgets-$env:WX_VERSION
msbuild build/msw/wx_vc17.sln /t:Build /p:Configuration=Release /p:Platform=x64
mkdir $env:WXMSW3
cp -r include $env:WXMSW3
cp -r lib $env:WXMSW3
- name: Get branch name for pull request
shell: bash
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "GIT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
echo "DEFAULT_BRANCH=$GITHUB_BASE_REF" >> $GITHUB_ENV
- name: Get branch name for push
shell: bash
if: ${{ github.event_name == 'push' }}
run: |
echo "GIT_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Determine branches for other repos
continue-on-error: true
shell: bash {0}
run: |
echo "GITHUB_REPOSITORY_OWNER=${GITHUB_REPOSITORY_OWNER}" >> $GITHUB_ENV
git ls-remote --heads --exit-code https://github.com/${GITHUB_REPOSITORY_OWNER}/lk.git $GIT_BRANCH
if [[ $? != "0" ]]; then echo "LK_BRANCH=$DEFAULT_BRANCH" >> $GITHUB_ENV; else echo "LK_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV; fi
git ls-remote --heads --exit-code https://github.com/${GITHUB_REPOSITORY_OWNER}/wex.git $GIT_BRANCH
if [[ $? != "0" ]]; then echo "WEX_BRANCH=$DEFAULT_BRANCH" >> $GITHUB_ENV; else echo "WEX_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV; fi
git ls-remote --heads --exit-code https://github.com/${GITHUB_REPOSITORY_OWNER}/ssc.git $GIT_BRANCH
if [[ $? != "0" ]]; then echo "SSC_BRANCH=$DEFAULT_BRANCH" >> $GITHUB_ENV; else echo "SSC_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV; fi
- name: Get git ref of sibling dependencies
shell: bash
run: |
ref=$(git ls-remote --exit-code https://github.com/NREL/lk.git refs/heads/$LK_BRANCH | awk '{print $1}')
echo "ref_of_lk=$ref" | tee --append $GITHUB_ENV
ref=$(git ls-remote --exit-code https://github.com/NREL/wex.git refs/heads/$WEX_BRANCH | awk '{print $1}')
echo "ref_of_wex=$ref" | tee --append $GITHUB_ENV
ref=$(git ls-remote --exit-code https://github.com/NREL/ssc.git refs/heads/$SSC_BRANCH | awk '{print $1}')
echo "ref_of_ssc=$ref" | tee --append $GITHUB_ENV
- name: Get cached build data of sibling dependency LK
uses: actions/cache@v4
id: cachedlk
with:
path: lk
key: windows-${{ env.ref_of_lk }}-LK
- name: Clone sibling dependency LK
if: steps.cachedlk.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: ${{ env.ref_of_lk }}
path: lk
repository: NREL/lk
- name: Get cached build data of sibling dependency WEX
uses: actions/cache@v4
id: cachedwex
with:
path: wex
key: windows-${{ env.ref_of_wex }}-WEX
- name: Clone sibling dependency WEX
if: steps.cachedwex.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: ${{ env.ref_of_wex }}
path: wex
repository: NREL/wex
- name: Get cached build data of sibling dependency SSC
uses: actions/cache@v4
id: cachedssc
with:
path: ssc
key: windows-${{ env.ref_of_ssc }}-SSC
- name: Clone sibling dependency SSC
if: steps.cachedssc.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: ${{ env.ref_of_ssc }}
path: ssc
repository: NREL/ssc
- name: Build LK
if: steps.cachedlk.outputs.cache-hit != 'true'
run: |
cd lk
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release;Debug" -DCMAKE_SYSTEM_VERSION=10 -DSAM_SKIP_TOOLS=1
MSBuild.exe .\lk.sln /t:Build /p:Configuration=Release
MSBuild.exe .\lk.sln /t:Build /p:Configuration=Debug
- name: Build WEX
if: steps.cachedwex.outputs.cache-hit != 'true'
run: |
cd wex
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release;Debug" -DCMAKE_SYSTEM_VERSION=10 -DSAM_SKIP_TOOLS=1 ..
MSBuild.exe .\wex.sln /t:Build /p:Configuration=Release
MSBuild.exe .\wex.sln /t:Build /p:Configuration=Debug
- name: Build SSC
if: steps.cachedssc.outputs.cache-hit != 'true'
run: |
cd ssc
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release;Debug" -DCMAKE_SYSTEM_VERSION=10 -DSAM_SKIP_TESTS=1 -DSAM_SKIP_TOOLS=1 -DSAMAPI_EXPORT=0 ..
MSBuild.exe .\sam_simulation_core.sln /t:Build /p:Configuration=Release
MSBuild.exe .\sam_simulation_core.sln /t:Build /p:Configuration=Debug
- name: Make temp cache of SAM
uses: actions/cache@v4
id: cachedsam
with:
path: sam
key: windows-SAM
- name: Checkout SAM
if: steps.cachedsam.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
path: sam
- name: Build sam
if: steps.cachedsam.outputs.cache-hit != 'true'
run: |
cd sam
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_SYSTEM_VERSION=10 -DSAMAPI_EXPORT=0 ..
MSBuild.exe .\samos.sln /t:Build /p:Configuration=Release
# - name: Download RunProcess
# shell: bash {0}
# run: |
# curl -L https://dennisbareis.com//zip3rdp/runprocess-v0.523.zip -o runprocess-v0.523.zip
# 7z x runprocess-v0.523.zip -orunprocess
# ls
# runprocess/RunProcess.exe
# - name: Build SDKTOOl
# run: |
# cd ssc
# cd build
# cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release;Debug" -DCMAKE_SYSTEM_VERSION=10 -DSAM_SKIP_TESTS=1 -DSAM_SKIP_TOOLS=0 -DSAMAPI_EXPORT=0 ..
# MSBuild.exe .\sam_simulation_core.sln /t:Build /p:Configuration=Release
# dir D:\a\SAM\SAM\ssc\build\sdktool\Release\
# - name: Run SAM
# run: |
# echo "ls ${{env.SAMNTDIR}}\deploy"
# ls ${{env.SAMNTDIR}}\deploy
# echo "ls ${{env.SAMNTDIR}}\deploy\x64"
# ls ${{env.SAMNTDIR}}\deploy\x64
# echo "ls"
# ls
# echo "ls runprocess"
# ls runprocess
# echo runprocess\RunProcess.exe ${{env.SAMNTDIR}}"\deploy\x64\SAMOS.exe no_sam_file" ${{env.SAMNTDIR}}"\deploy\test_script_ow.lk"
# runprocess\RunProcess.exe /w:S0 /k:60s D:\a\SAM\SAM\ssc\build\sdktool\Release\SDKtool.exe
# runprocess\RunProcess.exe /w:S0 D:\a\SAM\SAM\sam\deploy\x64\SAMOS.exe no_sam_file D:\a\SAM\SAM\sam\deploy\test_script_ow.lk
# - name: Generate test file
# shell: bash {0}
# run: results="1"; nohup xvfb-run ${SAMNTDIR}"/deploy/x64/SAMOS.exe" no_sam_file ${SAMNTDIR}"/deploy/test_script_ow.lk" &>/dev/null & while [[ $results != "0" ]]; do sleep 60; lines=$(wc -l ${SAMNTDIR}/build/test_results_win64.csv | cut -d' ' -f1); echo $lines; grep -i final_configuration_eof ${SAMNTDIR}/build/test_results_win64.csv; results=$?; done
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Upload Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: Test Results Windows
# path: ${{env.SAMNTDIR}}/build/test_results_win64.csv
# - name: Evaluate test results vs Windows file
# run: |
# python $SAMNTDIR/test/compare_lk_test_output.py ${SAMNTDIR}/test_results_win64.csv ${SAMNTDIR}/build/test_results_win64.csv true
build-mac:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14-large, macos-latest]
steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.24.x'
- name: Set relative paths
run: |
LKDIR=$GITHUB_WORKSPACE/lk
echo "LKDIR=$LKDIR" >> $GITHUB_ENV
WEXDIR=$GITHUB_WORKSPACE/wex
echo "WEXDIR=$WEXDIR" >> $GITHUB_ENV
SSCDIR=$GITHUB_WORKSPACE/ssc
echo "SSCDIR=$SSCDIR" >> $GITHUB_ENV
RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc
echo "RAPIDJSONDIR=$RAPIDJSONDIR" >> $GITHUB_ENV
SAMNTDIR=$GITHUB_WORKSPACE/sam
echo "SAMNTDIR=$SAMNTDIR" >> $GITHUB_ENV
- name: Set relative paths
run: |
WXMSW3=$HOME/wx-$WX_VERSION
echo "WXMSW3=$WXMSW3" >> $GITHUB_ENV
- name: Get cached build of wxWidgets
uses: actions/cache@v4
id: cachedwx
with:
path: ${{env.WXMSW3}}/
key: wxWidgets-${{ env.WX_VERSION }}-${{ matrix.os }}
- name: Install wxWidgets
if: steps.cachedwx.outputs.cache-hit != 'true'
run: |
curl -L https://github.com/wxWidgets/wxWidgets/releases/download/v$WX_VERSION/wxWidgets-$WX_VERSION.tar.bz2 -o wxWidgets-$WX_VERSION.tar.bz2
tar jxf wxWidgets-$WX_VERSION.tar.bz2
cd wxWidgets-$WX_VERSION
./configure --prefix=$HOME/wx-$WX_VERSION --enable-stl=yes --enable-shared=no --disable-debug_flag --with-cocoa --enable-universal_binary=x86_64,arm64 --enable-unicode --enable-webview --disable-mediactrl --with-cxx=11 --with-macosx-version-min=10.15 --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin
make -j3
make install
sudo ln -s $HOME/wx-$WX_VERSION/bin/wx-config /usr/local/bin/wx-config-3
wx-config-3 --cflags
echo ${HOME}/wx-$WX_VERSION/bin >> $GITHUB_PATH
- name: Get branch name to match with other repos for push
if: ${{ github.event_name == 'push' }}
run: |
echo "GIT_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Get branch name to match with other repos for pull_request
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "GIT_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
echo "DEFAULT_BRANCH=$GITHUB_BASE_REF" >> $GITHUB_ENV
- name: Determine branches for other repos
shell: bash {0}
run: |
echo "GITHUB_REPOSITORY_OWNER=${GITHUB_REPOSITORY_OWNER}" >> $GITHUB_ENV
git ls-remote --heads --exit-code https://github.com/${GITHUB_REPOSITORY_OWNER}/lk.git $GIT_BRANCH
if [[ $? != "0" ]]; then echo "LK_BRANCH=$DEFAULT_BRANCH" >> $GITHUB_ENV; else echo "LK_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV; fi
git ls-remote --heads --exit-code https://github.com/${GITHUB_REPOSITORY_OWNER}/wex.git $GIT_BRANCH
if [[ $? != "0" ]]; then echo "WEX_BRANCH=$DEFAULT_BRANCH" >> $GITHUB_ENV; else echo "WEX_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV; fi
git ls-remote --heads --exit-code https://github.com/${GITHUB_REPOSITORY_OWNER}/ssc.git $GIT_BRANCH
if [[ $? != "0" ]]; then echo "SSC_BRANCH=$DEFAULT_BRANCH" >> $GITHUB_ENV; else echo "SSC_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV; fi
- name: Get git ref of sibling dependencies
run: |
ref=$(git ls-remote --exit-code https://github.com/NREL/lk.git refs/heads/$LK_BRANCH | awk '{print $1}')
echo "ref_of_lk=$ref" | tee -a $GITHUB_ENV
ref=$(git ls-remote --exit-code https://github.com/NREL/wex.git refs/heads/$WEX_BRANCH | awk '{print $1}')
echo "ref_of_wex=$ref" | tee -a $GITHUB_ENV
ref=$(git ls-remote --exit-code https://github.com/NREL/ssc.git refs/heads/$SSC_BRANCH | awk '{print $1}')
echo "ref_of_ssc=$ref" | tee -a $GITHUB_ENV
- name: Get cached build data of sibling dependency LK
uses: actions/cache@v4
id: cachedlk
with:
path: lk
key: ${{ matrix.os }}-${{ env.ref_of_lk }}-LK
- name: Clone sibling dependency LK
if: steps.cachedlk.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: ${{ env.ref_of_lk }}
path: lk
repository: NREL/lk
- name: Get cached build data of sibling dependency WEX
uses: actions/cache@v4
id: cachedwex
with:
path: wex
key: ${{ matrix.os }}-${{ env.ref_of_wex }}-WEX
- name: Clone sibling dependency WEX
if: steps.cachedwex.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: ${{ env.ref_of_wex }}
path: wex
repository: NREL/wex
- name: Get cached build data of sibling dependency SSC
uses: actions/cache@v4
id: cachedssc
with:
path: ssc
key: ${{ matrix.os }}-${{ env.ref_of_ssc }}-SSC
- name: Clone sibling dependency SSC
if: steps.cachedssc.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
ref: ${{ env.ref_of_ssc }}
path: ssc
repository: NREL/ssc
- name: Build LK
if: steps.cachedlk.outputs.cache-hit != 'true'
run: |
cd $GITHUB_WORKSPACE/lk
cmake -Bbuild -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSAM_SKIP_TOOLS=1
cmake --build build -j4
- name: Build WEX
if: steps.cachedwex.outputs.cache-hit != 'true'
run: |
cd $GITHUB_WORKSPACE/wex
cmake -Bbuild -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSAM_SKIP_TOOLS=1
cmake --build build -j4
- name: Build SSC
if: steps.cachedssc.outputs.cache-hit != 'true'
run: |
cd $GITHUB_WORKSPACE/ssc
cmake -Bbuild -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSAM_SKIP_TESTS=1 -DSAM_SKIP_TOOLS=1 -DSAMAPI_EXPORT=0
cmake --build build -j4 --target ssc
- name: Checkout SAM
uses: actions/checkout@v4
with:
path: sam
- name: Build sam
run: |
mkdir ${SAMNTDIR}/build
cd ${SAMNTDIR}/build
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSAMAPI_EXPORT=0 && make -j 4
- name: Generate test file
shell: bash {0}
run: results="1"; nohup ${SAMNTDIR}/build/SAMOS.app/Contents/MacOS/SAMOS no_sam_file ${SAMNTDIR}/deploy/test_script_ow.lk &>/dev/null & while [[ $results != "0" ]]; do sleep 60; lines=$(wc -l ${SAMNTDIR}/build/SAMOS.app/Contents/MacOS/../../test_results_osx64.csv | cut -d' ' -f1); ls ${SAMNTDIR}/build/SAMOS.app/Contents/MacOS/../../; echo $lines; grep -i final_configuration_eof ${SAMNTDIR}/build/SAMOS.app/Contents/MacOS/../../test_results_osx64.csv; results=$?; done
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: Test Results ${{ matrix.os }}
path: ${{env.SAMNTDIR}}/build/SAMOS.app/test_results_osx64.csv
- name: Evaluate test results vs Mac file
run: |
python ${SAMNTDIR}/test/compare_lk_test_output.py ${SAMNTDIR}/test_results_osx64.csv ${SAMNTDIR}/build/SAMOS.app/Contents/MacOS/../../test_results_osx64.csv false
- name: Evaluate test results vs Windows file
run: |
python $SAMNTDIR/test/compare_lk_test_output.py ${SAMNTDIR}/test_results_win64.csv ${SAMNTDIR}/build/SAMOS.app/Contents/MacOS/../../test_results_osx64.csv true