move windows download #293
Workflow file for this run
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: CI | |
on: | |
push: | |
pull_request: | |
jobs: | |
build-on-ubuntu: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} | |
steps: | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: '3.24.x' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: wex | |
- name: Download wxWidgets | |
run: | | |
cd $HOME | |
python --version | |
pip install requests | |
python $GITHUB_WORKSPACE/wex/.github/workflows/download_wx.py wx-3.2.3 | |
echo "WXMSW3=$HOME/wx-3.2.3" >>$GITHUB_ENV | |
chmod +x wx-3.2.3/bin/wx-config | |
sudo ln -s $HOME/wx-3.2.3/bin/wx-config /usr/local/bin/wx-config-3 | |
wx-config-3 --cflags | grep I | |
echo ${HOME}/wx-3.2.3/bin >> $GITHUB_PATH | |
- name: Install OS dependencies | |
run: | | |
sudo apt-get update --fix-missing | |
sudo apt-get install -y \ | |
build-essential \ | |
freeglut3-dev \ | |
g++ \ | |
libcurl4-openssl-dev \ | |
libfontconfig-dev \ | |
libgl1-mesa-dev \ | |
libgtk2.0-dev \ | |
mesa-common-dev \ | |
unzip | |
# - name: Install wxWidgets | |
# run: | | |
# sudo apt-get install -y libwxgtk*-dev | |
# sudo ln -s $(which wx-config) /usr/local/bin/wx-config-3 | |
# wx-config-3 --cflags | grep I | |
- name: Get git ref of sibling dependency LK | |
run: | | |
ref=$(git ls-remote --exit-code https://github.com/NREL/lk.git refs/heads/develop | awk '{print $1}') | |
echo "ref_of_lk=$ref" | tee --append $GITHUB_ENV | |
- name: Get cached build data of sibling dependency LK | |
uses: actions/cache@v4 | |
id: cachedlk | |
with: | |
path: ${{ env.GH_WORKSPACE }}/lk | |
key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK | |
- name: Clone sibling dependency LK | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.ref_of_lk }} | |
path: lk | |
repository: NREL/lk | |
- name: Build LK | |
run: | | |
ls | |
ls $WXMSW3 | |
cd $GITHUB_WORKSPACE/lk | |
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug | |
cmake --build build_linux -j4 | |
- name: Set env vars | |
run: | | |
echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV | |
echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build_linux" >>$GITHUB_ENV | |
echo "RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc" >>$GITHUB_ENV | |
- name: Get git ref of sibling dependency SSC | |
run: | | |
ref=$(git ls-remote --exit-code https://github.com/NREL/ssc.git refs/heads/develop | awk '{print $1}') | |
echo "ref_of_ssc=$ref" | tee --append $GITHUB_ENV | |
- name: Get cached build data of sibling dependency SSC | |
uses: actions/cache@v4 | |
id: cachedssc | |
with: | |
path: ${{ env.GH_WORKSPACE }}/ssc | |
key: ${{ env.RUNS_ON }}-${{ env.ref_of_ssc }}-SSC | |
- name: Clone sibling dependency SSC | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.ref_of_ssc }} | |
path: ssc | |
repository: NREL/ssc | |
- name: Build WEX | |
run: | | |
cd $GITHUB_WORKSPACE/wex | |
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug | |
cmake --build build_linux | |
- name: Save static lib, Dview & wexsandbox | |
uses: actions/upload-artifact@v4 | |
with: | |
name: WEX-linux-x86_64 | |
path: | | |
${{ env.GH_WORKSPACE }}/wex/build_linux/tools/DView* | |
${{ env.GH_WORKSPACE }}/wex/build_linux/tools/wexsandbox* | |
${{ env.GH_WORKSPACE }}/wex/build_linux/wex*.a | |
build-on-windows: | |
runs-on: windows-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} | |
steps: | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: wex | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: '3.24.x' | |
- name: Get branch name | |
shell: bash | |
run: | | |
# Short name for current branch. base ref is set on push builds, head ref is for pull request builds | |
if [ -z ${GITHUB_HEAD_REF+x} ]; then GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}; else GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}; fi | |
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV | |
- name: Determine branches for other repos | |
shell: bash | |
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=develop" >> $GITHUB_ENV; else echo "LK_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV; fi | |
- name: Checkout lk | |
uses: actions/checkout@v4 | |
with: | |
path: lk | |
repository: ${{ env.GITHUB_REPOSITORY_OWNER }}/lk | |
ref: ${{ env.LK_BRANCH }} | |
- name: Download wxWidgets | |
shell: bash | |
run: | | |
python --version | |
pip install requests | |
python $GITHUB_WORKSPACE/wex/.github/workflows/download_wx.py wx-3.2.3 | |
dir | |
dir wx-3.2.3 | |
echo "WXMSW3=$GITHUB_WORKSPACE/wx-3.2.3" >>$GITHUB_ENV | |
- name: Build LK | |
run: | | |
cd lk | |
mkdir build | |
cd build | |
dir $env:WXMSW3 | |
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: Set LK paths | |
shell: bash | |
run: | | |
echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV | |
echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build/Release" >>$GITHUB_ENV | |
echo "LK_LIB=$GITHUB_WORKSPACE/lk/build/Release" >>$GITHUB_ENV | |
echo "RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc" >>$GITHUB_ENV | |
- name: Checkout ssc | |
uses: actions/checkout@v4 | |
with: | |
path: ssc | |
repository: ${{ env.GITHUB_REPOSITORY_OWNER }}/ssc | |
ref: ${{ env.SSC_BRANCH }} | |
- name: Build WEX | |
run: | | |
cd wex | |
mkdir build | |
cd build | |
cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_SYSTEM_VERSION=10 .. | |
MSBuild.exe .\wex.sln /t:Build /p:Configuration=Release | |
- name: Save static lib, Dview & wexsandbox | |
uses: actions/upload-artifact@v4 | |
with: | |
name: WEX-windows-x86_64 | |
path: | | |
${{ env.GH_WORKSPACE }}/wex/build_linux/tools/DView* | |
${{ env.GH_WORKSPACE }}/wex/build_linux/tools/wexsandbox* | |
${{ env.GH_WORKSPACE }}/wex/build_linux/wex*.a | |
build-on-mac: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-14-large, macos-latest] | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} | |
steps: | |
- name: Set relative paths | |
run: | | |
WXMSW3=$HOME/wx-3.2.3 | |
echo "WXMSW3=$WXMSW3" >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: wex | |
- name: Download wxWidgets | |
run: | | |
cd $HOME | |
python --version | |
pip install requests | |
python $GITHUB_WORKSPACE/wex/.github/workflows/download_wx.py wx-3.2.3 | |
ls | |
ls wx-3.2.3 | |
echo "WXMSW3=$HOME/wx-3.2.3" >>$GITHUB_ENV | |
chmod +x wx-3.2.3/bin/wx-config | |
sudo ln -s $HOME/wx-3.2.3/bin/wx-config /usr/local/bin/wx-config-3 | |
wx-config-3 --cflags | grep I | |
echo ${HOME}/wx-3.2.3/bin >> $GITHUB_PATH | |
- name: Get git ref of sibling dependency LK | |
run: | | |
ref=$(git ls-remote --exit-code https://github.com/NREL/lk.git refs/heads/develop | awk '{print $1}') | |
echo "ref_of_lk=$ref" | tee -a $GITHUB_ENV | |
- name: Get cached build data of sibling dependency LK | |
uses: actions/cache@v4 | |
id: cachedlk | |
with: | |
path: ${{ env.GH_WORKSPACE }}/lk | |
key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK | |
- name: Clone sibling dependency LK | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.ref_of_lk }} | |
path: lk | |
repository: NREL/lk | |
- name: Build LK | |
run: | | |
ls | |
ls $WXMSW3 | |
cd $GITHUB_WORKSPACE/lk | |
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug | |
cmake --build build_linux -j4 | |
- name: Set env vars | |
run: | | |
echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV | |
echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build_linux" >>$GITHUB_ENV | |
echo "RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc" >>$GITHUB_ENV | |
- name: Get git ref of sibling dependency SSC | |
run: | | |
ref=$(git ls-remote --exit-code https://github.com/NREL/ssc.git refs/heads/develop | awk '{print $1}') | |
echo "ref_of_ssc=$ref" | tee -a $GITHUB_ENV | |
- name: Get cached build data of sibling dependency SSC | |
uses: actions/cache@v4 | |
id: cachedssc | |
with: | |
path: ${{ env.GH_WORKSPACE }}/ssc | |
key: ${{ env.RUNS_ON }}-${{ env.ref_of_ssc }}-SSC | |
- name: Clone sibling dependency SSC | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.ref_of_ssc }} | |
path: ssc | |
repository: NREL/ssc | |
- name: Setup cmake | |
uses: jwlawson/actions-setup-cmake@v2 | |
with: | |
cmake-version: '3.24.x' | |
- name: Build WEX | |
run: | | |
cd wex | |
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug | |
cmake --build build_linux | |
- name: Save static lib, Dview & wexsandbox | |
uses: actions/upload-artifact@v4 | |
with: | |
name: WEX-${{ matrix.os }}-x86_64 | |
path: | | |
${{ env.GH_WORKSPACE }}/wex/build_linux/tools/DView* | |
${{ env.GH_WORKSPACE }}/wex/build_linux/tools/wexsandbox* | |
${{ env.GH_WORKSPACE }}/wex/build_linux/wex*.a | |