From d81c2b1b836f9be51673a0d348148cb462ba943f Mon Sep 17 00:00:00 2001 From: Brian Mirletz Date: Wed, 13 Dec 2023 09:51:46 -0700 Subject: [PATCH 01/62] Merge in patch branch and re-target develop --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ca4b649..af2ea1b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: - name: Get git ref of sibling dependency LK run: | - ref=$(git ls-remote --exit-code git://github.com/NREL/lk.git refs/heads/patch | awk '{print $1}') + ref=$(git ls-remote --exit-code git://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@v2 @@ -72,7 +72,7 @@ jobs: echo "RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc" >>$GITHUB_ENV - name: Get git ref of sibling dependency SSC run: | - ref=$(git ls-remote --exit-code git://github.com/NREL/ssc.git refs/heads/patch | awk '{print $1}') + ref=$(git ls-remote --exit-code git://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@v2 From 932a6ada802abcdd7116dc1cc319f3057b11d348 Mon Sep 17 00:00:00 2001 From: Darice Date: Wed, 15 May 2024 15:57:37 -0600 Subject: [PATCH 02/62] add windows build --- .github/workflows/ci.yml | 80 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af2ea1b9..027a6281 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,3 +105,83 @@ jobs: ${{ 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 + steps: + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: Download wxWidgets + shell: bash + run: | + curl -L https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.3/wxMSW-3.2.3_vc14x_x64_Dev.7z -o wxMSW-3.2.3_vc14x_x64_Dev.7z + mkdir wxMSW-3.2.3_vc14x_x64_Dev + 7z x wxMSW-3.2.3_vc14x_x64_Dev.7z -o$GITHUB_WORKSPACE/wxMSW-3.2.3_vc14x_x64_Dev + curl -L https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.3/wxMSW-3.2.3_vc14x_x64_ReleaseDLL.7z -o wxMSW-3.2.3_vc14x_x64_ReleaseDLL.7z + 7z x wxMSW-3.2.3_vc14x_x64_ReleaseDLL.7z -o$GITHUB_WORKSPACE/wxMSW-3.2.3_vc14x_x64_ReleaseDLL + cp wxMSW-3.2.3_vc14x_x64_ReleaseDLL/lib/vc14x_x64_dll/* wxMSW-3.2.3_vc14x_x64_Dev/lib/vc14x_x64_dll + curl -L https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.3/wxWidgets-3.2.3-headers.7z -o wxWidgets-3.2.3-headers.7z + 7z x wxWidgets-3.2.3-headers.7z -o$GITHUB_WORKSPACE/wxMSW-3.2.3_vc14x_x64_Dev + WXMSW3=$GITHUB_WORKSPACE\\wxMSW-3.2.3_vc14x_x64_Dev + echo "WXMSW3=$WXMSW3" >> $GITHUB_ENV + WXWIN=$GITHUB_WORKSPACE\\wxMSW-3.2.3_vc14x_x64_Dev + echo "WXWIN=$WXWIN" >> $GITHUB_ENV + + + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: '3.24.x' + + - name: Get git ref of sibling dependency LK + run: | + ref=$(git ls-remote --exit-code git://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@v2 + id: cachedlk + with: + path: ${{ env.GH_WORKSPACE }}/lk + key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK + - name: Clone sibling dependency LK + if: steps.cachedlk.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + ref: ${{ env.ref_of_lk }} + path: lk + repository: NREL/lk + - name: Build LK + if: steps.cachedlk.outputs.cache-hit != 'true' + run: | + cd $GITHUB_WORKSPACE/lk + mkdir build + cd build + cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_SYSTEM_VERSION=10.0 -DSAM_SKIP_TOOLS=1 .. + MSBuild.exe .\lk.sln /t:Build /p:Configuration=Release + 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: Checkout + uses: actions/checkout@v2 + with: + path: wex + - name: Build WEX + run: | + cd $GITHUB_WORKSPACE/wex + mkdir build + cd build + cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_SYSTEM_VERSION=10.0 .. + MSBuild.exe .\wex.sln /t:Build /p:Configuration=Release + + - name: Save static lib, Dview & wexsandbox + uses: actions/upload-artifact@v2 + with: + name: WEX-${{ env.RUNS_ON }}-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 + \ No newline at end of file From 4fb7abe83e577d3e5b8958e7366ba31d8739399b Mon Sep 17 00:00:00 2001 From: Darice Date: Wed, 15 May 2024 15:59:52 -0600 Subject: [PATCH 03/62] windows ci --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 027a6281..8c42a8f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -135,6 +135,7 @@ jobs: cmake-version: '3.24.x' - name: Get git ref of sibling dependency LK + shell: bash run: | ref=$(git ls-remote --exit-code git://github.com/NREL/lk.git refs/heads/develop | awk '{print $1}') echo "ref_of_lk=$ref" | tee --append $GITHUB_ENV From 3093659c8fb0d5f732a5bde6a9dc571860e4f12e Mon Sep 17 00:00:00 2001 From: Darice Date: Wed, 15 May 2024 16:15:29 -0600 Subject: [PATCH 04/62] windows --- .github/workflows/ci.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c42a8f6..1c5904b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,24 +134,27 @@ jobs: with: cmake-version: '3.24.x' - - name: Get git ref of sibling dependency LK + - 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: | - ref=$(git ls-remote --exit-code git://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@v2 - id: cachedlk - with: - path: ${{ env.GH_WORKSPACE }}/lk - key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK - - name: Clone sibling dependency LK - if: steps.cachedlk.outputs.cache-hit != 'true' + 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@v2 with: - ref: ${{ env.ref_of_lk }} path: lk - repository: NREL/lk + repository: ${{ env.GITHUB_REPOSITORY_OWNER }}/lk + ref: ${{ env.LK_BRANCH }} + - name: Build LK if: steps.cachedlk.outputs.cache-hit != 'true' run: | From dc311ac0682a9d960ad4e7b523ccf1606da0cb80 Mon Sep 17 00:00:00 2001 From: Darice Date: Wed, 15 May 2024 16:19:33 -0600 Subject: [PATCH 05/62] windows --- .github/workflows/ci.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c5904b3..490b3ed6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,13 +127,17 @@ jobs: echo "WXMSW3=$WXMSW3" >> $GITHUB_ENV WXWIN=$GITHUB_WORKSPACE\\wxMSW-3.2.3_vc14x_x64_Dev echo "WXWIN=$WXWIN" >> $GITHUB_ENV - - name: Setup cmake uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: '3.24.x' + - name: Checkout + uses: actions/checkout@v2 + with: + path: wex + - name: Get branch name shell: bash run: | @@ -158,7 +162,9 @@ jobs: - name: Build LK if: steps.cachedlk.outputs.cache-hit != 'true' run: | - cd $GITHUB_WORKSPACE/lk + echo $env:GITHUB_WORKSPACE + ls $env:GITHUB_WORKSPACE + cd $env:GITHUB_WORKSPACE/lk mkdir build cd build cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_SYSTEM_VERSION=10.0 -DSAM_SKIP_TOOLS=1 .. @@ -166,15 +172,10 @@ jobs: 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: Checkout - uses: actions/checkout@v2 - with: - path: wex - name: Build WEX run: | - cd $GITHUB_WORKSPACE/wex + cd $env:GITHUB_WORKSPACE/wex mkdir build cd build cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_SYSTEM_VERSION=10.0 .. From 93c3c1e76f9e5bf65f0d44b6bc82c203ced3f959 Mon Sep 17 00:00:00 2001 From: Darice Date: Wed, 15 May 2024 16:24:00 -0600 Subject: [PATCH 06/62] fix paths --- .github/workflows/ci.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 490b3ed6..8d36d393 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,7 +111,6 @@ jobs: steps: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v2 - - name: Download wxWidgets shell: bash run: | @@ -127,50 +126,49 @@ jobs: echo "WXMSW3=$WXMSW3" >> $GITHUB_ENV WXWIN=$GITHUB_WORKSPACE\\wxMSW-3.2.3_vc14x_x64_Dev echo "WXWIN=$WXWIN" >> $GITHUB_ENV - - name: Setup cmake uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: '3.24.x' - - name: Checkout uses: actions/checkout@v2 with: path: wex - - 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@v2 with: path: lk repository: ${{ env.GITHUB_REPOSITORY_OWNER }}/lk ref: ${{ env.LK_BRANCH }} - + - name: Checkout ssc + uses: actions/checkout@v2 + with: + path: ssc + repository: ${{ env.GITHUB_REPOSITORY_OWNER }}/ssc + ref: ${{ env.SSC_BRANCH }} - name: Build LK if: steps.cachedlk.outputs.cache-hit != 'true' run: | - echo $env:GITHUB_WORKSPACE - ls $env:GITHUB_WORKSPACE cd $env:GITHUB_WORKSPACE/lk mkdir build cd build cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_SYSTEM_VERSION=10.0 -DSAM_SKIP_TOOLS=1 .. MSBuild.exe .\lk.sln /t:Build /p:Configuration=Release echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV - echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build_linux" >>$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: Build WEX From 391fac8725b287f3ca65bbe246cbceb802a39b88 Mon Sep 17 00:00:00 2001 From: Darice Date: Wed, 15 May 2024 16:33:09 -0600 Subject: [PATCH 07/62] windows lk --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d36d393..e75cac3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,6 +166,11 @@ jobs: cd build cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_SYSTEM_VERSION=10.0 -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 From f831e2c97e1573f84d1d921b3ecc404e713c8ab0 Mon Sep 17 00:00:00 2001 From: Darice Date: Wed, 15 May 2024 16:36:54 -0600 Subject: [PATCH 08/62] debug --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e75cac3d..111f1c97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,7 +164,7 @@ jobs: cd $env:GITHUB_WORKSPACE/lk mkdir build cd build - cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_SYSTEM_VERSION=10.0 -DSAM_SKIP_TOOLS=1 .. + cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release;Debug" -DCMAKE_SYSTEM_VERSION=10.0 -DSAM_SKIP_TOOLS=1 .. MSBuild.exe .\lk.sln /t:Build /p:Configuration=Release MSBuild.exe .\lk.sln /t:Build /p:Configuration=Debug From a029e32636d0b239d0471de6fba201d40a9344a3 Mon Sep 17 00:00:00 2001 From: Darice Date: Fri, 17 May 2024 15:47:28 -0600 Subject: [PATCH 09/62] check python --- .github/workflows/ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 111f1c97..d150f354 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,10 +27,8 @@ jobs: libgtk2.0-dev \ mesa-common-dev \ unzip - - name: Get GCC version - run: gcc --version - - name: Get libc version - run: ldd --version + - name: Get Python version + run: which python - name: Install wxWidgets run: | From d60c696a569ed85d1017b34767fd33b6172d776f Mon Sep 17 00:00:00 2001 From: Darice Date: Fri, 17 May 2024 15:50:08 -0600 Subject: [PATCH 10/62] python version --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d150f354..e7132c5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,9 @@ jobs: mesa-common-dev \ unzip - name: Get Python version - run: which python + run: | + which python + python --version - name: Install wxWidgets run: | From 7e10a3ffc4a6e38618f9e230eed17e0058056d40 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 06:26:33 -0600 Subject: [PATCH 11/62] try downloading wx --- .github/workflows/ci.yml | 33 ++++++++++------- .github/workflows/download_wx.py | 61 ++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/download_wx.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7132c5c..3a116d3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,16 +27,27 @@ jobs: libgtk2.0-dev \ mesa-common-dev \ unzip - - name: Get Python version - run: | - which python - python --version - - - name: Install wxWidgets + - name: Checkout + uses: actions/checkout@v2 + with: + path: wex + - name: Download wxWidgets run: | - sudo apt-get install -y libwxgtk*-dev - sudo ln -s $(which wx-config) /usr/local/bin/wx-config-3 + python .github/workflows/download_wx.py + dir + dir wx-3.2.3 + echo "WXMSW3=$GITHUB_WORKSPACE/wx-3.2.3" >>$GITHUB_ENV + chmod +x wx-3.2.3/bin/wx-config + chmod +x wx-3.2.3/lib/wx/config/osx_cocoa-unicode-static-3.2 + sudo ln -s $GITHUB_WORKSPACE/wx-3.2.3/bin/wx-config /usr/local/bin/wx-config-3 wx-config-3 --cflags | grep I + echo ${GITHUB_WORKSPACE}/wx-3.2.3/bin >> $GITHUB_PATH + + # - 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: | @@ -60,7 +71,7 @@ jobs: run: | cd $GITHUB_WORKSPACE/lk cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug - cmake --build build_linux -- -j + cmake --build build_linux -j4 - name: Set LKDIR run: | echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV @@ -88,10 +99,6 @@ jobs: path: ssc repository: NREL/ssc - - name: Checkout - uses: actions/checkout@v2 - with: - path: wex - name: Build WEX run: | cd $GITHUB_WORKSPACE/wex diff --git a/.github/workflows/download_wx.py b/.github/workflows/download_wx.py new file mode 100644 index 00000000..436488dd --- /dev/null +++ b/.github/workflows/download_wx.py @@ -0,0 +1,61 @@ +import os +import requests +import platform +import re +from pathlib import Path +import zipfile +import sys + +if len(sys.argv) == 1: + raise RuntimeError(f"Script require argument of directory name for wxWidgets folder") +wx_dir_name = sys.argv[1] + +cwd = Path(os.getcwd()) + +github_token = os.environ.get("GITHUB_TOKEN") +headers = { + 'Accept': 'application/vnd.github+json', + 'Authorization': f'Bearer {github_token}', + 'X-GitHub-Api-Version': '2022-11-28', +} + +os_name = platform.system() + +if os_name == "Windows": + wx_name = "wxWidgets-windows" +elif os_name == "Linux": + wx_name = "wxWidgets-linux" +elif os_name == "Darwin": + os_name = platform.platform() + if 'arm' in os_name: + wx_name = 'wxWidgets-macos-latest' + else: + wx_name = 'wxWidgets-macos-[0-9][0-9]-large' +else: + raise Exception(f"{os_name} operating system not implemented") + +response = requests.get('https://api.github.com/repos/NREL/lk/actions/artifacts', headers=headers) +r = response.json() +artifacts = r['artifacts'] + +matching_artifacts = [art for art in artifacts if re.search(wx_name, art['name'])] +artifact = matching_artifacts[0] + +headers = { + 'Accept': 'application/vnd.github+json', + 'Authorization': f'Bearer {github_token}', + 'X-GitHub-Api-Version': '2022-11-28', +} + +response = requests.get( + artifact['archive_download_url'], + headers=headers, +) + +with open(cwd / 'wx.zip', 'wb') as f: + f.write(response.content) + +with zipfile.ZipFile('wx.zip', "r") as zip_ref: + zip_ref.extractall(cwd / f"{wx_dir_name}") + +print(f"Extracted to {str(cwd / f"{wx_dir_name}")}") \ No newline at end of file From b6a2f015bc5d6ab305b923b0aed1ce38bf475ab2 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 06:34:50 -0600 Subject: [PATCH 12/62] update linux --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a116d3f..a1bb02c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: path: wex - name: Download wxWidgets run: | - python .github/workflows/download_wx.py + python wex/.github/workflows/download_wx.py dir dir wx-3.2.3 echo "WXMSW3=$GITHUB_WORKSPACE/wx-3.2.3" >>$GITHUB_ENV @@ -69,6 +69,8 @@ jobs: - name: Build LK if: steps.cachedlk.outputs.cache-hit != 'true' run: | + ls + ls $WXMSW3 cd $GITHUB_WORKSPACE/lk cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug cmake --build build_linux -j4 From 861e0a9e19c2051cf71fd89039ce944fea18be05 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 06:39:07 -0600 Subject: [PATCH 13/62] linux --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1bb02c4..d03bdde4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,7 @@ jobs: path: wex - name: Download wxWidgets run: | + python --version python wex/.github/workflows/download_wx.py dir dir wx-3.2.3 From 052204abe37dc6d568c73c80838f920d96a3cb4f Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 06:42:08 -0600 Subject: [PATCH 14/62] fix syntax --- .github/workflows/ci.yml | 28 ++++++++++++++-------------- .github/workflows/download_wx.py | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d03bdde4..f0a55b97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,19 +14,7 @@ jobs: cmake-version: '3.24.x' - name: Test cmake version run: cmake --version - - 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: Checkout uses: actions/checkout@v2 with: @@ -43,7 +31,19 @@ jobs: sudo ln -s $GITHUB_WORKSPACE/wx-3.2.3/bin/wx-config /usr/local/bin/wx-config-3 wx-config-3 --cflags | grep I echo ${GITHUB_WORKSPACE}/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 diff --git a/.github/workflows/download_wx.py b/.github/workflows/download_wx.py index 436488dd..cc2571fb 100644 --- a/.github/workflows/download_wx.py +++ b/.github/workflows/download_wx.py @@ -58,4 +58,4 @@ with zipfile.ZipFile('wx.zip', "r") as zip_ref: zip_ref.extractall(cwd / f"{wx_dir_name}") -print(f"Extracted to {str(cwd / f"{wx_dir_name}")}") \ No newline at end of file +print(f"Extracted to {str(cwd / wx_dir_name)}") \ No newline at end of file From bdc6259c0b45ae56e062a5eb7eff6982ad1c31f1 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 06:43:22 -0600 Subject: [PATCH 15/62] download wx --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0a55b97..e650c3ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Download wxWidgets run: | python --version - python wex/.github/workflows/download_wx.py + python 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 From 2c6af7b52b86281e6866cf17300b61e08a86cf19 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 06:46:43 -0600 Subject: [PATCH 16/62] add secrets --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e650c3ac..5da42104 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,9 @@ on: jobs: build-on-ubuntu: runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.12 From 9a91be97aef83ac55841ccb893f8c363c1ca4f76 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 06:50:54 -0600 Subject: [PATCH 17/62] tokens --- .github/workflows/download_wx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/download_wx.py b/.github/workflows/download_wx.py index cc2571fb..4f65d85c 100644 --- a/.github/workflows/download_wx.py +++ b/.github/workflows/download_wx.py @@ -12,7 +12,7 @@ cwd = Path(os.getcwd()) -github_token = os.environ.get("GITHUB_TOKEN") +github_token = os.environ.get("TOKEN_GITHUB") headers = { 'Accept': 'application/vnd.github+json', 'Authorization': f'Bearer {github_token}', From e756be2c547a1faf3b56c217982c54c8b8b3e14a Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 06:52:57 -0600 Subject: [PATCH 18/62] download_wx --- .github/workflows/download_wx.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/download_wx.py b/.github/workflows/download_wx.py index 4f65d85c..874130b1 100644 --- a/.github/workflows/download_wx.py +++ b/.github/workflows/download_wx.py @@ -36,6 +36,7 @@ response = requests.get('https://api.github.com/repos/NREL/lk/actions/artifacts', headers=headers) r = response.json() +print(r) artifacts = r['artifacts'] matching_artifacts = [art for art in artifacts if re.search(wx_name, art['name'])] From e92072b0a008fa45a8098698b88c4657a2649a22 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 06:54:38 -0600 Subject: [PATCH 19/62] download_wx --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5da42104..933e66f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: build-on-ubuntu: runs-on: ubuntu-latest env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} steps: - name: Setup cmake From 7013dd2501a264688159791ca5aabec25cb306d6 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 06:56:44 -0600 Subject: [PATCH 20/62] token --- .github/workflows/download_wx.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/download_wx.py b/.github/workflows/download_wx.py index 874130b1..3f6e7a4c 100644 --- a/.github/workflows/download_wx.py +++ b/.github/workflows/download_wx.py @@ -12,7 +12,7 @@ cwd = Path(os.getcwd()) -github_token = os.environ.get("TOKEN_GITHUB") +github_token = os.environ.get("GITHUB_TOKEN") headers = { 'Accept': 'application/vnd.github+json', 'Authorization': f'Bearer {github_token}', @@ -36,7 +36,9 @@ response = requests.get('https://api.github.com/repos/NREL/lk/actions/artifacts', headers=headers) r = response.json() -print(r) +if 'bad' in r['message']: + raise RuntimeError(r) + artifacts = r['artifacts'] matching_artifacts = [art for art in artifacts if re.search(wx_name, art['name'])] From 800b490480dcb19322fd386a5ec8e3dadda59aa3 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 06:58:19 -0600 Subject: [PATCH 21/62] msg --- .github/workflows/download_wx.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/download_wx.py b/.github/workflows/download_wx.py index 3f6e7a4c..e5d49270 100644 --- a/.github/workflows/download_wx.py +++ b/.github/workflows/download_wx.py @@ -36,8 +36,9 @@ response = requests.get('https://api.github.com/repos/NREL/lk/actions/artifacts', headers=headers) r = response.json() -if 'bad' in r['message']: - raise RuntimeError(r) +if 'message' in r.keys(): + print(r) + raise RuntimeError(r['message']) artifacts = r['artifacts'] From d0323a9b02eed3a4e25f33888848ded6024772f5 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 07:08:26 -0600 Subject: [PATCH 22/62] fix --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 933e66f6..5f1a32de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,6 @@ jobs: dir wx-3.2.3 echo "WXMSW3=$GITHUB_WORKSPACE/wx-3.2.3" >>$GITHUB_ENV chmod +x wx-3.2.3/bin/wx-config - chmod +x wx-3.2.3/lib/wx/config/osx_cocoa-unicode-static-3.2 sudo ln -s $GITHUB_WORKSPACE/wx-3.2.3/bin/wx-config /usr/local/bin/wx-config-3 wx-config-3 --cflags | grep I echo ${GITHUB_WORKSPACE}/wx-3.2.3/bin >> $GITHUB_PATH From 73278901295f4c367999d885ad5405d708b6f39a Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 07:15:42 -0600 Subject: [PATCH 23/62] cache build off --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f1a32de..d8a1c2a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,14 +63,14 @@ jobs: path: ${{ env.GH_WORKSPACE }}/lk key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK - name: Clone sibling dependency LK - if: steps.cachedlk.outputs.cache-hit != 'true' + if: steps.cachedlk.outputs.cache-hit == 'true' uses: actions/checkout@v2 with: ref: ${{ env.ref_of_lk }} path: lk repository: NREL/lk - name: Build LK - if: steps.cachedlk.outputs.cache-hit != 'true' + if: steps.cachedlk.outputs.cache-hit == 'true' run: | ls ls $WXMSW3 From bbbeebb54ec8f8b3106f3ec89707247242d90302 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 10:49:13 -0600 Subject: [PATCH 24/62] windows --- .github/workflows/ci.yml | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8a1c2a4..23d097b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,29 +123,23 @@ jobs: steps: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v2 + - name: Checkout + uses: actions/checkout@v2 + with: + path: wex - name: Download wxWidgets shell: bash run: | - curl -L https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.3/wxMSW-3.2.3_vc14x_x64_Dev.7z -o wxMSW-3.2.3_vc14x_x64_Dev.7z - mkdir wxMSW-3.2.3_vc14x_x64_Dev - 7z x wxMSW-3.2.3_vc14x_x64_Dev.7z -o$GITHUB_WORKSPACE/wxMSW-3.2.3_vc14x_x64_Dev - curl -L https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.3/wxMSW-3.2.3_vc14x_x64_ReleaseDLL.7z -o wxMSW-3.2.3_vc14x_x64_ReleaseDLL.7z - 7z x wxMSW-3.2.3_vc14x_x64_ReleaseDLL.7z -o$GITHUB_WORKSPACE/wxMSW-3.2.3_vc14x_x64_ReleaseDLL - cp wxMSW-3.2.3_vc14x_x64_ReleaseDLL/lib/vc14x_x64_dll/* wxMSW-3.2.3_vc14x_x64_Dev/lib/vc14x_x64_dll - curl -L https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.3/wxWidgets-3.2.3-headers.7z -o wxWidgets-3.2.3-headers.7z - 7z x wxWidgets-3.2.3-headers.7z -o$GITHUB_WORKSPACE/wxMSW-3.2.3_vc14x_x64_Dev - WXMSW3=$GITHUB_WORKSPACE\\wxMSW-3.2.3_vc14x_x64_Dev - echo "WXMSW3=$WXMSW3" >> $GITHUB_ENV - WXWIN=$GITHUB_WORKSPACE\\wxMSW-3.2.3_vc14x_x64_Dev - echo "WXWIN=$WXWIN" >> $GITHUB_ENV + cd $HOME + python --version + python $GITHUB_WORKSPACE/wex/.github/workflows/download_wx.py wx-3.2.3 + dir + dir wx-3.2.3 + echo "WXMSW3=$HOME/wx-3.2.3" >>$GITHUB_ENV - name: Setup cmake uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: '3.24.x' - - name: Checkout - uses: actions/checkout@v2 - with: - path: wex - name: Get branch name shell: bash run: | @@ -171,9 +165,7 @@ jobs: repository: ${{ env.GITHUB_REPOSITORY_OWNER }}/ssc ref: ${{ env.SSC_BRANCH }} - name: Build LK - if: steps.cachedlk.outputs.cache-hit != 'true' run: | - cd $env:GITHUB_WORKSPACE/lk mkdir build cd build cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release;Debug" -DCMAKE_SYSTEM_VERSION=10.0 -DSAM_SKIP_TOOLS=1 .. From e59477d7fcb7a7654c5dc7dd14440a7d5995f89f Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 12:00:30 -0600 Subject: [PATCH 25/62] add mac build --- .github/workflows/ci.yml | 120 ++++++++++++++++++++++++++++++++++----- 1 file changed, 106 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23d097b5..10dacdd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,6 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.12 with: cmake-version: '3.24.x' - - name: Test cmake version - run: cmake --version - - name: Checkout uses: actions/checkout@v2 with: @@ -28,11 +25,11 @@ jobs: python 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 + echo "WXMSW3=$HOME/wx-3.2.3" >>$GITHUB_ENV chmod +x wx-3.2.3/bin/wx-config - sudo ln -s $GITHUB_WORKSPACE/wx-3.2.3/bin/wx-config /usr/local/bin/wx-config-3 + sudo ln -s $HOME/wx-3.2.3/bin/wx-config /usr/local/bin/wx-config-3 wx-config-3 --cflags | grep I - echo ${GITHUB_WORKSPACE}/wx-3.2.3/bin >> $GITHUB_PATH + echo ${HOME}/wx-3.2.3/bin >> $GITHUB_PATH - name: Install OS dependencies run: | sudo apt-get update --fix-missing @@ -77,15 +74,12 @@ jobs: cd $GITHUB_WORKSPACE/lk cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug cmake --build build_linux -j4 - - name: Set LKDIR + - name: Set env vars run: | echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV - - name: Set LKD_LIB - run: | echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build_linux" >>$GITHUB_ENV - - name: Set RAPIDJSONDIR - run: | echo "RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc" >>$GITHUB_ENV + - name: Get git ref of sibling dependency SSC run: | ref=$(git ls-remote --exit-code git://github.com/NREL/ssc.git refs/heads/develop | awk '{print $1}') @@ -112,7 +106,7 @@ jobs: - name: Save static lib, Dview & wexsandbox uses: actions/upload-artifact@v2 with: - name: WEX-${{ env.RUNS_ON }}-x86_64 + name: WEX-linux-x86_64 path: | ${{ env.GH_WORKSPACE }}/wex/build_linux/tools/DView* ${{ env.GH_WORKSPACE }}/wex/build_linux/tools/wexsandbox* @@ -191,9 +185,107 @@ jobs: - name: Save static lib, Dview & wexsandbox uses: actions/upload-artifact@v2 with: - name: WEX-${{ env.RUNS_ON }}-x86_64 + 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 - \ No newline at end of file + + 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 + + - name: Download wxWidgets + run: | + python --version + python wex/.github/workflows/download_wx.py wx-3.2.3 + dir + dir 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 git://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@v2 + id: cachedlk + with: + path: ${{ env.GH_WORKSPACE }}/lk + key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK + - name: Clone sibling dependency LK + if: steps.cachedlk.outputs.cache-hit == 'true' + uses: actions/checkout@v2 + with: + ref: ${{ env.ref_of_lk }} + path: lk + repository: NREL/lk + - name: Build LK + if: steps.cachedlk.outputs.cache-hit == 'true' + 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 git://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@v2 + id: cachedssc + with: + path: ${{ env.GH_WORKSPACE }}/ssc + key: ${{ env.RUNS_ON }}-${{ env.ref_of_ssc }}-SSC + - name: Clone sibling dependency SSC + if: steps.cachedssc.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + 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 $GITHUB_WORKSPACE/wex + cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug + cmake --build build_linux + + - name: Save static lib, Dview & wexsandbox + uses: actions/upload-artifact@v2 + 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 + \ No newline at end of file From 602ff8afa0ff09d5269bef86587b839af600d52b Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 12:10:29 -0600 Subject: [PATCH 26/62] fix dirs --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10dacdd8..d8bf38e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,7 @@ jobs: path: wex - name: Download wxWidgets run: | + cd $HOME python --version python wex/.github/workflows/download_wx.py wx-3.2.3 dir @@ -209,6 +210,7 @@ jobs: - name: Download wxWidgets run: | + cd $HOME python --version python wex/.github/workflows/download_wx.py wx-3.2.3 dir @@ -250,11 +252,10 @@ jobs: 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 git://github.com/NREL/ssc.git refs/heads/develop | awk '{print $1}') - echo "ref_of_ssc=$ref" | tee --append $GITHUB_ENV - + - name: Get git ref of sibling dependency SSC + run: | + ref=$(git ls-remote --exit-code git://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@v2 id: cachedssc @@ -276,7 +277,6 @@ jobs: - name: Build WEX run: | - cd $GITHUB_WORKSPACE/wex cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug cmake --build build_linux From e4dd80539a67004568f669491eae749a0e6f9c8a Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 12:19:37 -0600 Subject: [PATCH 27/62] fix mac --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8bf38e3..a2cf1af8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -212,7 +212,7 @@ jobs: run: | cd $HOME python --version - python wex/.github/workflows/download_wx.py wx-3.2.3 + python $GITHUB_WORKSPACE/.github/workflows/download_wx.py wx-3.2.3 dir dir wx-3.2.3 echo "WXMSW3=$HOME/wx-3.2.3" >>$GITHUB_ENV From 6e80b221b77b002e586ca48dfaa828fba8200462 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 13:12:44 -0600 Subject: [PATCH 28/62] pip on mac --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2cf1af8..17515c37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -212,6 +212,7 @@ jobs: run: | cd $HOME python --version + pip install requests zipfile python $GITHUB_WORKSPACE/.github/workflows/download_wx.py wx-3.2.3 dir dir wx-3.2.3 From c143994906dba5f89c16109f447fb032980fa973 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 13:19:26 -0600 Subject: [PATCH 29/62] pip --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17515c37..43f3ab3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -212,7 +212,7 @@ jobs: run: | cd $HOME python --version - pip install requests zipfile + pip install requests python $GITHUB_WORKSPACE/.github/workflows/download_wx.py wx-3.2.3 dir dir wx-3.2.3 From 49c9ff4080579a660bcac11fec095304773d9772 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 13:21:05 -0600 Subject: [PATCH 30/62] mac --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43f3ab3e..300ad819 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -214,8 +214,8 @@ jobs: python --version pip install requests python $GITHUB_WORKSPACE/.github/workflows/download_wx.py wx-3.2.3 - dir - dir 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 From 6030324db3db00f414017c377236fda556b62a82 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 13:35:16 -0600 Subject: [PATCH 31/62] fix git ls-remote --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 300ad819..ecb9da5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: - name: Get git ref of sibling dependency LK run: | - ref=$(git ls-remote --exit-code git://github.com/NREL/lk.git refs/heads/develop | awk '{print $1}') + 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@v2 @@ -83,7 +83,7 @@ jobs: - name: Get git ref of sibling dependency SSC run: | - ref=$(git ls-remote --exit-code git://github.com/NREL/ssc.git refs/heads/develop | awk '{print $1}') + 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@v2 @@ -224,7 +224,7 @@ jobs: - name: Get git ref of sibling dependency LK run: | - ref=$(git ls-remote --exit-code git://github.com/NREL/lk.git refs/heads/develop | awk '{print $1}') + 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@v2 @@ -255,7 +255,7 @@ jobs: - name: Get git ref of sibling dependency SSC run: | - ref=$(git ls-remote --exit-code git://github.com/NREL/ssc.git refs/heads/develop | awk '{print $1}') + 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@v2 From b5535f267130a9800bfec10ec3b46b27b61fed61 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 13:38:05 -0600 Subject: [PATCH 32/62] fix mac --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ecb9da5d..a6a0a926 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - 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 + echo "ref_of_lk=$ref" | tee -a $GITHUB_ENV - name: Get cached build data of sibling dependency LK uses: actions/cache@v2 id: cachedlk From 09e779a4f6b261c78053d997c8865d9d19257843 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 13:46:31 -0600 Subject: [PATCH 33/62] mac --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6a0a926..ff2a7838 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - 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 + echo "ref_of_lk=$ref" | tee --append $GITHUB_ENV - name: Get cached build data of sibling dependency LK uses: actions/cache@v2 id: cachedlk @@ -225,7 +225,7 @@ jobs: - 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 + echo "ref_of_lk=$ref" | tee -a $GITHUB_ENV - name: Get cached build data of sibling dependency LK uses: actions/cache@v2 id: cachedlk @@ -256,7 +256,7 @@ jobs: - 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 + echo "ref_of_ssc=$ref" | tee -a $GITHUB_ENV - name: Get cached build data of sibling dependency SSC uses: actions/cache@v2 id: cachedssc From c1e0539fd3920570dfbcb581ac5ed28fd38781e9 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 15:13:54 -0600 Subject: [PATCH 34/62] update all --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff2a7838..64e23560 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,9 +23,8 @@ jobs: run: | cd $HOME python --version - python wex/.github/workflows/download_wx.py wx-3.2.3 - dir - dir wx-3.2.3 + pip install requests + python $GITHUB_WORKSPACE/.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 @@ -127,6 +126,7 @@ jobs: run: | cd $HOME python --version + pip install requests python $GITHUB_WORKSPACE/wex/.github/workflows/download_wx.py wx-3.2.3 dir dir wx-3.2.3 From 6014fd52cb25031b37b61e4446e69ebd8b89a3b7 Mon Sep 17 00:00:00 2001 From: Darice Date: Mon, 20 May 2024 15:23:41 -0600 Subject: [PATCH 35/62] windows secrets --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64e23560..8a2e14fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,6 +114,8 @@ jobs: build-on-windows: runs-on: windows-latest + env: + GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} steps: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v2 From 43e22a6ac9a72a216868fc064ec924ccfc0c9d44 Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 08:52:22 -0600 Subject: [PATCH 36/62] fix paths --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a2e14fc..5f392133 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,8 +17,6 @@ jobs: cmake-version: '3.24.x' - name: Checkout uses: actions/checkout@v2 - with: - path: wex - name: Download wxWidgets run: | cd $HOME @@ -165,7 +163,7 @@ jobs: run: | mkdir build cd build - cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release;Debug" -DCMAKE_SYSTEM_VERSION=10.0 -DSAM_SKIP_TOOLS=1 .. + cmake .. -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release;Debug" -DCMAKE_SYSTEM_VERSION=10.0 -DSAM_SKIP_TOOLS=1 MSBuild.exe .\lk.sln /t:Build /p:Configuration=Release MSBuild.exe .\lk.sln /t:Build /p:Configuration=Debug From d83cf3d7ec185d1e0211ab5468a0fbb0747f2e76 Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 09:21:11 -0600 Subject: [PATCH 37/62] add error message --- .github/workflows/download_wx.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/download_wx.py b/.github/workflows/download_wx.py index e5d49270..b843f851 100644 --- a/.github/workflows/download_wx.py +++ b/.github/workflows/download_wx.py @@ -43,6 +43,11 @@ artifacts = r['artifacts'] matching_artifacts = [art for art in artifacts if re.search(wx_name, art['name'])] + +if not len(matching_artifacts): + print([art['name'] for art in artifacts]) + raise RuntimeError(f"Could not find matching artifact for os {wx_name}") + artifact = matching_artifacts[0] headers = { From 29a8ab50da83ed6f2ea360d9c016f36a18da848f Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 09:56:38 -0600 Subject: [PATCH 38/62] build lk always --- .github/workflows/ci.yml | 50 +++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f392133..135014c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,9 @@ jobs: with: cmake-version: '3.24.x' - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 + with: + path: wex - name: Download wxWidgets run: | cd $HOME @@ -52,20 +54,18 @@ jobs: 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@v2 + 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 - if: steps.cachedlk.outputs.cache-hit == 'true' - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: ${{ env.ref_of_lk }} path: lk repository: NREL/lk - name: Build LK - if: steps.cachedlk.outputs.cache-hit == 'true' run: | ls ls $WXMSW3 @@ -83,14 +83,13 @@ jobs: 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@v2 + 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 - if: steps.cachedssc.outputs.cache-hit != 'true' - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: ${{ env.ref_of_ssc }} path: ssc @@ -102,7 +101,7 @@ jobs: cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug cmake --build build_linux - name: Save static lib, Dview & wexsandbox - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: WEX-linux-x86_64 path: | @@ -116,9 +115,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} steps: - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v2 + uses: microsoft/setup-msbuild@v4 - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: wex - name: Download wxWidgets @@ -132,7 +131,7 @@ jobs: dir wx-3.2.3 echo "WXMSW3=$HOME/wx-3.2.3" >>$GITHUB_ENV - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 + uses: jwlawson/actions-setup-cmake@v4 with: cmake-version: '3.24.x' - name: Get branch name @@ -148,13 +147,13 @@ jobs: 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@v2 + uses: actions/checkout@v4 with: path: lk repository: ${{ env.GITHUB_REPOSITORY_OWNER }}/lk ref: ${{ env.LK_BRANCH }} - name: Checkout ssc - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: ssc repository: ${{ env.GITHUB_REPOSITORY_OWNER }}/ssc @@ -184,7 +183,7 @@ jobs: MSBuild.exe .\wex.sln /t:Build /p:Configuration=Release - name: Save static lib, Dview & wexsandbox - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: WEX-windows-x86_64 path: | @@ -207,13 +206,15 @@ jobs: - name: Checkout uses: actions/checkout@v4 - + with: + path: wex + - name: Download wxWidgets run: | cd $HOME python --version pip install requests - python $GITHUB_WORKSPACE/.github/workflows/download_wx.py wx-3.2.3 + 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 @@ -227,20 +228,18 @@ jobs: 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@v2 + 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 - if: steps.cachedlk.outputs.cache-hit == 'true' - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: ${{ env.ref_of_lk }} path: lk repository: NREL/lk - name: Build LK - if: steps.cachedlk.outputs.cache-hit == 'true' run: | ls ls $WXMSW3 @@ -258,21 +257,20 @@ jobs: 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@v2 + 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 - if: steps.cachedssc.outputs.cache-hit != 'true' - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: ref: ${{ env.ref_of_ssc }} path: ssc repository: NREL/ssc - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v2 + uses: jwlawson/actions-setup-cmake@v4 with: cmake-version: '3.24.x' @@ -282,7 +280,7 @@ jobs: cmake --build build_linux - name: Save static lib, Dview & wexsandbox - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: WEX-${{ matrix.os }}-x86_64 path: | From 117b10ec953b8edc003f91c9e2dac8f732c3e088 Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 09:59:52 -0600 Subject: [PATCH 39/62] fix paths --- .github/workflows/ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 135014c0..0e3ced24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v1.12 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: '3.24.x' - name: Checkout @@ -115,7 +115,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }} steps: - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v4 + uses: microsoft/setup-msbuild@v2 - name: Checkout uses: actions/checkout@v4 with: @@ -131,7 +131,7 @@ jobs: dir wx-3.2.3 echo "WXMSW3=$HOME/wx-3.2.3" >>$GITHUB_ENV - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v4 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: '3.24.x' - name: Get branch name @@ -160,6 +160,7 @@ jobs: ref: ${{ env.SSC_BRANCH }} - name: Build LK run: | + cd lk mkdir build cd build cmake .. -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release;Debug" -DCMAKE_SYSTEM_VERSION=10.0 -DSAM_SKIP_TOOLS=1 @@ -176,7 +177,7 @@ jobs: - name: Build WEX run: | - cd $env:GITHUB_WORKSPACE/wex + cd wex mkdir build cd build cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_SYSTEM_VERSION=10.0 .. @@ -270,7 +271,7 @@ jobs: repository: NREL/ssc - name: Setup cmake - uses: jwlawson/actions-setup-cmake@v4 + uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: '3.24.x' From a4662ec3ab2c577dd2f5546e78b2adbdab9c8c28 Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 10:01:25 -0600 Subject: [PATCH 40/62] fix paths --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e3ced24..36709f4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: cd $HOME python --version pip install requests - python $GITHUB_WORKSPACE/.github/workflows/download_wx.py wx-3.2.3 + 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 From 8f77c5cafaa927a1c591d2a427f46917fdd63505 Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 10:03:07 -0600 Subject: [PATCH 41/62] fix paths --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36709f4c..ae918c8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -277,6 +277,7 @@ jobs: - name: Build WEX run: | + cd wex cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug cmake --build build_linux From bbf0b67929b187065a55c613cfdaba69bd5f9f59 Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 10:54:44 -0600 Subject: [PATCH 42/62] windows --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae918c8b..a61dd5bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -163,7 +163,8 @@ jobs: cd lk mkdir build cd build - cmake .. -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release;Debug" -DCMAKE_SYSTEM_VERSION=10.0 -DSAM_SKIP_TOOLS=1 + dir $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 @@ -180,7 +181,7 @@ jobs: cd wex mkdir build cd build - cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_SYSTEM_VERSION=10.0 .. + 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 From 5fbda4f45727bed9a2bd8c994ffc900c4d09733e Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 11:00:05 -0600 Subject: [PATCH 43/62] move windows download --- .github/workflows/ci.yml | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a61dd5bf..f420fecd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,16 +120,6 @@ jobs: uses: actions/checkout@v4 with: path: wex - - name: Download wxWidgets - shell: bash - run: | - cd $HOME - 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=$HOME/wx-3.2.3" >>$GITHUB_ENV - name: Setup cmake uses: jwlawson/actions-setup-cmake@v2 with: @@ -152,22 +142,24 @@ jobs: path: lk repository: ${{ env.GITHUB_REPOSITORY_OWNER }}/lk ref: ${{ env.LK_BRANCH }} - - name: Checkout ssc - uses: actions/checkout@v4 - with: - path: ssc - repository: ${{ env.GITHUB_REPOSITORY_OWNER }}/ssc - ref: ${{ env.SSC_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 $WXMSW3 + 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: | @@ -176,6 +168,12 @@ jobs: 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 From 14d78f06ea16e88ee854afae3ef17723c66c445c Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 15:30:31 -0600 Subject: [PATCH 44/62] clean up and fix artifacts --- .github/workflows/ci.yml | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f420fecd..4faa751e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,11 +43,6 @@ jobs: 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: | @@ -57,7 +52,7 @@ jobs: uses: actions/cache@v4 id: cachedlk with: - path: ${{ env.GH_WORKSPACE }}/lk + path: ${{ env.GITHUB_WORKSPACE }}/lk key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK - name: Clone sibling dependency LK uses: actions/checkout@v4 @@ -67,8 +62,6 @@ jobs: 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 @@ -86,7 +79,7 @@ jobs: uses: actions/cache@v4 id: cachedssc with: - path: ${{ env.GH_WORKSPACE }}/ssc + path: ${{ env.GITHUB_WORKSPACE }}/ssc key: ${{ env.RUNS_ON }}-${{ env.ref_of_ssc }}-SSC - name: Clone sibling dependency SSC uses: actions/checkout@v4 @@ -105,9 +98,9 @@ jobs: 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 + ${{ env.GITHUB_WORKSPACE }}/wex/build_linux/tools/DView* + ${{ env.GITHUB_WORKSPACE }}/wex/build_linux/tools/wexsandbox* + ${{ env.GITHUB_WORKSPACE }}/wex/build_linux/wex*.a build-on-windows: runs-on: windows-latest @@ -156,7 +149,6 @@ jobs: 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 @@ -187,9 +179,9 @@ jobs: 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 + ${{ env.GITHUB_WORKSPACE }}/wex/build/tools/Release/tools/DView.exe + ${{ env.GITHUB_WORKSPACE }}/wex/build/tools/Release/tools/wexsandbox.exe + ${{ env.GITHUB_WORKSPACE }}/wex/build/Release/wex.lib build-on-mac: runs-on: ${{ matrix.os }} @@ -215,8 +207,6 @@ jobs: 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 @@ -231,7 +221,7 @@ jobs: uses: actions/cache@v4 id: cachedlk with: - path: ${{ env.GH_WORKSPACE }}/lk + path: ${{ env.GITHUB_WORKSPACE }}/lk key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK - name: Clone sibling dependency LK uses: actions/checkout@v4 @@ -241,8 +231,6 @@ jobs: 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 @@ -260,7 +248,7 @@ jobs: uses: actions/cache@v4 id: cachedssc with: - path: ${{ env.GH_WORKSPACE }}/ssc + path: ${{ env.GITHUB_WORKSPACE }}/ssc key: ${{ env.RUNS_ON }}-${{ env.ref_of_ssc }}-SSC - name: Clone sibling dependency SSC uses: actions/checkout@v4 @@ -285,7 +273,7 @@ jobs: 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 + ${{ env.GITHUB_WORKSPACE }}/wex/build_linux/tools/DView* + ${{ env.GITHUB_WORKSPACE }}/wex/build_linux/tools/wexsandbox* + ${{ env.GITHUB_WORKSPACE }}/wex/build_linux/wex*.a \ No newline at end of file From a03f2821e566aa06047d6cca0b27ec62b1d00ba5 Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 15:39:10 -0600 Subject: [PATCH 45/62] use caches --- .github/workflows/ci.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4faa751e..ed10a3c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,12 +55,14 @@ jobs: path: ${{ env.GITHUB_WORKSPACE }}/lk key: ${{ env.RUNS_ON }}-${{ 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: Build LK + if: steps.cachedlk.outputs.cache-hit != 'true' run: | cd $GITHUB_WORKSPACE/lk cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug @@ -82,6 +84,7 @@ jobs: path: ${{ env.GITHUB_WORKSPACE }}/ssc key: ${{ env.RUNS_ON }}-${{ 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 }} @@ -129,7 +132,18 @@ jobs: 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 + - 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.GITHUB_WORKSPACE }}/lk + key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK + - name: Checkout lk + if: steps.cachedlk.outputs.cache-hit != 'true' uses: actions/checkout@v4 with: path: lk @@ -145,6 +159,7 @@ jobs: dir wx-3.2.3 echo "WXMSW3=$GITHUB_WORKSPACE/wx-3.2.3" >>$GITHUB_ENV - name: Build LK + if: steps.cachedlk.outputs.cache-hit != 'true' run: | cd lk mkdir build @@ -159,8 +174,14 @@ jobs: 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 + - name: Get cached build data of sibling dependency SSC + uses: actions/cache@v4 + id: cachedssc + with: + path: ${{ env.GITHUB_WORKSPACE }}/ssc + key: ${{ env.RUNS_ON }}-${{ env.ref_of_ssc }}-SSC + - name: Checkout ssc + if: steps.cachedssc.outputs.cache-hit != 'true' uses: actions/checkout@v4 with: path: ssc @@ -224,12 +245,14 @@ jobs: path: ${{ env.GITHUB_WORKSPACE }}/lk key: ${{ env.RUNS_ON }}-${{ 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: Build LK + if: steps.cachedlk.outputs.cache-hit != 'true' run: | cd $GITHUB_WORKSPACE/lk cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug @@ -251,6 +274,7 @@ jobs: path: ${{ env.GITHUB_WORKSPACE }}/ssc key: ${{ env.RUNS_ON }}-${{ 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 }} From d8c7cab3a05b6d7ab5c38090bf85b3054e95f654 Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 15:42:36 -0600 Subject: [PATCH 46/62] windows cache --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed10a3c7..30b1d400 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,6 +133,7 @@ jobs: 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: Get git ref of sibling dependency LK + shell: bash 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 From aeee722d24f4060da515f8c770be52e079f83851 Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 15:45:31 -0600 Subject: [PATCH 47/62] fix caching --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30b1d400..532ebfd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: id: cachedlk with: path: ${{ env.GITHUB_WORKSPACE }}/lk - key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK + key: linux-${{ env.ref_of_lk }}-LK - name: Clone sibling dependency LK if: steps.cachedlk.outputs.cache-hit != 'true' uses: actions/checkout@v4 @@ -82,7 +82,7 @@ jobs: id: cachedssc with: path: ${{ env.GITHUB_WORKSPACE }}/ssc - key: ${{ env.RUNS_ON }}-${{ env.ref_of_ssc }}-SSC + key: windows-${{ env.ref_of_ssc }}-SSC - name: Clone sibling dependency SSC if: steps.cachedssc.outputs.cache-hit != 'true' uses: actions/checkout@v4 @@ -142,7 +142,7 @@ jobs: id: cachedlk with: path: ${{ env.GITHUB_WORKSPACE }}/lk - key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK + key: windows-${{ env.ref_of_lk }}-LK - name: Checkout lk if: steps.cachedlk.outputs.cache-hit != 'true' uses: actions/checkout@v4 @@ -180,7 +180,7 @@ jobs: id: cachedssc with: path: ${{ env.GITHUB_WORKSPACE }}/ssc - key: ${{ env.RUNS_ON }}-${{ env.ref_of_ssc }}-SSC + key: windows-${{ env.ref_of_ssc }}-SSC - name: Checkout ssc if: steps.cachedssc.outputs.cache-hit != 'true' uses: actions/checkout@v4 @@ -244,7 +244,7 @@ jobs: id: cachedlk with: path: ${{ env.GITHUB_WORKSPACE }}/lk - key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK + key: ${{ env.matrix.os }}-${{ env.ref_of_lk }}-LK - name: Clone sibling dependency LK if: steps.cachedlk.outputs.cache-hit != 'true' uses: actions/checkout@v4 @@ -273,7 +273,7 @@ jobs: id: cachedssc with: path: ${{ env.GITHUB_WORKSPACE }}/ssc - key: ${{ env.RUNS_ON }}-${{ env.ref_of_ssc }}-SSC + key: ${{ env.matrix.os }}-${{ env.ref_of_ssc }}-SSC - name: Clone sibling dependency SSC if: steps.cachedssc.outputs.cache-hit != 'true' uses: actions/checkout@v4 From 3e50ebd281ad1a5c80923cae66ccee9ec6007f9a Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 15:56:43 -0600 Subject: [PATCH 48/62] fix paths for artifacts --- .github/workflows/ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 532ebfd7..ab1e5b4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,9 +101,9 @@ jobs: with: name: WEX-linux-x86_64 path: | - ${{ env.GITHUB_WORKSPACE }}/wex/build_linux/tools/DView* - ${{ env.GITHUB_WORKSPACE }}/wex/build_linux/tools/wexsandbox* - ${{ env.GITHUB_WORKSPACE }}/wex/build_linux/wex*.a + wex/build_linux/tools/DView* + wex/build_linux/tools/wexsandbox* + wex/build_linux/wex*.a build-on-windows: runs-on: windows-latest @@ -201,9 +201,9 @@ jobs: with: name: WEX-windows-x86_64 path: | - ${{ env.GITHUB_WORKSPACE }}/wex/build/tools/Release/tools/DView.exe - ${{ env.GITHUB_WORKSPACE }}/wex/build/tools/Release/tools/wexsandbox.exe - ${{ env.GITHUB_WORKSPACE }}/wex/build/Release/wex.lib + wex/build/tools/Release/tools/DView.exe + wex/build/tools/Release/tools/wexsandbox.exe + wex/build/Release/wex.lib build-on-mac: runs-on: ${{ matrix.os }} @@ -298,7 +298,7 @@ jobs: with: name: WEX-${{ matrix.os }}-x86_64 path: | - ${{ env.GITHUB_WORKSPACE }}/wex/build_linux/tools/DView* - ${{ env.GITHUB_WORKSPACE }}/wex/build_linux/tools/wexsandbox* - ${{ env.GITHUB_WORKSPACE }}/wex/build_linux/wex*.a + wex/build_linux/tools/DView* + wex/build_linux/tools/wexsandbox* + wex/build_linux/wex*.a \ No newline at end of file From a0b67aa86554c8561db82504ffc52e7b2c456522 Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 15:58:23 -0600 Subject: [PATCH 49/62] fix caching path --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab1e5b4b..d9488f64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: uses: actions/cache@v4 id: cachedlk with: - path: ${{ env.GITHUB_WORKSPACE }}/lk + path: lk key: linux-${{ env.ref_of_lk }}-LK - name: Clone sibling dependency LK if: steps.cachedlk.outputs.cache-hit != 'true' @@ -81,7 +81,7 @@ jobs: uses: actions/cache@v4 id: cachedssc with: - path: ${{ env.GITHUB_WORKSPACE }}/ssc + path: ssc key: windows-${{ env.ref_of_ssc }}-SSC - name: Clone sibling dependency SSC if: steps.cachedssc.outputs.cache-hit != 'true' From 632559ff8795a9fd3a7e639b26f315d1a4a5f5ab Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 16:04:04 -0600 Subject: [PATCH 50/62] fix caching --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9488f64..1382cfe9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -141,7 +141,7 @@ jobs: uses: actions/cache@v4 id: cachedlk with: - path: ${{ env.GITHUB_WORKSPACE }}/lk + path: lk key: windows-${{ env.ref_of_lk }}-LK - name: Checkout lk if: steps.cachedlk.outputs.cache-hit != 'true' @@ -179,7 +179,7 @@ jobs: uses: actions/cache@v4 id: cachedssc with: - path: ${{ env.GITHUB_WORKSPACE }}/ssc + path: ssc key: windows-${{ env.ref_of_ssc }}-SSC - name: Checkout ssc if: steps.cachedssc.outputs.cache-hit != 'true' @@ -243,7 +243,7 @@ jobs: uses: actions/cache@v4 id: cachedlk with: - path: ${{ env.GITHUB_WORKSPACE }}/lk + path: lk key: ${{ env.matrix.os }}-${{ env.ref_of_lk }}-LK - name: Clone sibling dependency LK if: steps.cachedlk.outputs.cache-hit != 'true' @@ -272,7 +272,7 @@ jobs: uses: actions/cache@v4 id: cachedssc with: - path: ${{ env.GITHUB_WORKSPACE }}/ssc + path: ssc key: ${{ env.matrix.os }}-${{ env.ref_of_ssc }}-SSC - name: Clone sibling dependency SSC if: steps.cachedssc.outputs.cache-hit != 'true' From cb63a70fa8e4fff328dcaeb88d51a898ff63e3fe Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 16:05:57 -0600 Subject: [PATCH 51/62] get branch name --- .github/workflows/ci.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1382cfe9..88eb42ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,10 +43,14 @@ jobs: libgtk2.0-dev \ mesa-common-dev \ unzip - + - name: Get branch name + 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: 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}') + ref=$(git ls-remote --exit-code https://github.com/NREL/lk.git refs/heads/$GIT_BRANCH | 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 @@ -75,7 +79,7 @@ jobs: - 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}') + ref=$(git ls-remote --exit-code https://github.com/NREL/ssc.git refs/heads/$GIT_BRANCH | 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 @@ -135,7 +139,7 @@ jobs: - name: Get git ref of sibling dependency LK shell: bash run: | - ref=$(git ls-remote --exit-code https://github.com/NREL/lk.git refs/heads/develop | awk '{print $1}') + ref=$(git ls-remote --exit-code https://github.com/NREL/lk.git refs/heads/$GIT_BRANCH | 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 @@ -234,10 +238,14 @@ jobs: 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 branch name + 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: 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}') + ref=$(git ls-remote --exit-code https://github.com/NREL/lk.git refs/heads/$GIT_BRANCH | 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 @@ -266,7 +274,7 @@ jobs: - 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}') + ref=$(git ls-remote --exit-code https://github.com/NREL/ssc.git refs/heads/$GIT_BRANCH | 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 From de9873529984b4c8b33cc8ed5be95e949239e11f Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 16:14:38 -0600 Subject: [PATCH 52/62] cleanup --- .github/workflows/ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88eb42ac..4ea99b42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,9 +45,9 @@ jobs: unzip - name: Get branch name 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 + # 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: Get git ref of sibling dependency LK run: | ref=$(git ls-remote --exit-code https://github.com/NREL/lk.git refs/heads/$GIT_BRANCH | awk '{print $1}') @@ -127,9 +127,9 @@ jobs: - 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 + # 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: | @@ -240,9 +240,9 @@ jobs: echo ${HOME}/wx-3.2.3/bin >> $GITHUB_PATH - name: Get branch name 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 + # 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: Get git ref of sibling dependency LK run: | ref=$(git ls-remote --exit-code https://github.com/NREL/lk.git refs/heads/$GIT_BRANCH | awk '{print $1}') @@ -252,7 +252,7 @@ jobs: id: cachedlk with: path: lk - key: ${{ env.matrix.os }}-${{ env.ref_of_lk }}-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 @@ -281,7 +281,7 @@ jobs: id: cachedssc with: path: ssc - key: ${{ env.matrix.os }}-${{ env.ref_of_ssc }}-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 From 11d729bc090a971fdd0e4894b620a705915977ef Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 16:26:24 -0600 Subject: [PATCH 53/62] fix ssc cache --- .github/workflows/ci.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ea99b42..497fb1b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,10 +76,9 @@ jobs: 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/$GIT_BRANCH | awk '{print $1}') + 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 @@ -94,7 +93,6 @@ jobs: ref: ${{ env.ref_of_ssc }} path: ssc repository: NREL/ssc - - name: Build WEX run: | cd $GITHUB_WORKSPACE/wex @@ -179,6 +177,10 @@ jobs: 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: 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 @@ -199,7 +201,6 @@ jobs: 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: @@ -221,12 +222,10 @@ jobs: 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 @@ -271,10 +270,9 @@ jobs: 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/$GIT_BRANCH | awk '{print $1}') + 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 @@ -289,18 +287,15 @@ jobs: 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: From 37d9a7cd1b5089b3001af726ff336e67d81fa5d1 Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 21 May 2024 17:02:25 -0600 Subject: [PATCH 54/62] fix windows --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 497fb1b5..8c70fc79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -178,6 +178,7 @@ jobs: echo "LK_LIB=$GITHUB_WORKSPACE/lk/build/Release" >>$GITHUB_ENV echo "RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc" >>$GITHUB_ENV - name: Get git ref of sibling dependency SSC + shell: bash 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 From 4dbb1b5d3f943454ad5ac804ca5149d8eac5d1e8 Mon Sep 17 00:00:00 2001 From: Darice Date: Wed, 22 May 2024 14:29:22 -0600 Subject: [PATCH 55/62] use caching for wx 3.2.4 --- .github/workflows/ci.yml | 109 ++++++++++++++++++++++++++++----------- 1 file changed, 78 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c70fc79..a13bd86d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,9 @@ on: push: pull_request: +env: + WX_VERSION: '3.2.4' + jobs: build-on-ubuntu: runs-on: ubuntu-latest @@ -19,17 +22,12 @@ jobs: 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: Set relative paths + run: | + WXMSW3=$HOME/wx-$WX_VERSION + echo "WXMSW3=$WXMSW3" >> $GITHUB_ENV + - name: Install OS dependencies run: | sudo apt-get update --fix-missing @@ -43,6 +41,35 @@ jobs: 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: Save wxWidgets build + if: steps.cachedwx.outputs.cache-hit != 'true' + uses: actions/upload-artifact@v4 + with: + name: wxWidgets-${{ env.WX_VERSION }}-linux + path: | + ${{ env.WXMSW3 }} + - name: Get branch name run: | # Short name for current branch. base ref is set on push builds, head ref is for pull request builds @@ -118,10 +145,32 @@ jobs: uses: actions/checkout@v4 with: path: wex + - name: Set relative paths + shell: bash + run: | + WXMSW3=$GITHUB_WORKSPACE/wx-$WX_VERSION + echo "WXMSW3=$WXMSW3" >> $GITHUB_ENV - name: Setup cmake uses: jwlawson/actions-setup-cmake@v2 with: cmake-version: '3.24.x' + - 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 - name: Get branch name shell: bash run: | @@ -152,15 +201,6 @@ jobs: 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 if: steps.cachedlk.outputs.cache-hit != 'true' run: | @@ -221,23 +261,30 @@ jobs: steps: - name: Set relative paths run: | - WXMSW3=$HOME/wx-3.2.3 + WXMSW3=$HOME/wx-$WX_VERSION echo "WXMSW3=$WXMSW3" >> $GITHUB_ENV - name: Checkout uses: actions/checkout@v4 with: path: wex - - name: Download wxWidgets + - 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: | - 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 + 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 run: | # Short name for current branch. base ref is set on push builds, head ref is for pull request builds From 01bb928392bcdf4d3517434b38167af32edf3ce9 Mon Sep 17 00:00:00 2001 From: Darice Date: Wed, 22 May 2024 14:50:55 -0600 Subject: [PATCH 56/62] release mode --- .github/workflows/ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a13bd86d..da36627c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,7 +96,7 @@ jobs: if: steps.cachedlk.outputs.cache-hit != 'true' run: | cd $GITHUB_WORKSPACE/lk - cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug + cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Release cmake --build build_linux -j4 - name: Set env vars run: | @@ -123,7 +123,7 @@ jobs: - name: Build WEX run: | cd $GITHUB_WORKSPACE/wex - cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug + cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Release cmake --build build_linux - name: Save static lib, Dview & wexsandbox uses: actions/upload-artifact@v4 @@ -171,6 +171,9 @@ jobs: 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 wxWidgets-$WX_VERSION/include $env:WXMSW3 + cp -r wxWidgets-$WX_VERSION/lib $env:WXMSW3 - name: Get branch name shell: bash run: | @@ -311,7 +314,7 @@ jobs: if: steps.cachedlk.outputs.cache-hit != 'true' run: | cd $GITHUB_WORKSPACE/lk - cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug + cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Release cmake --build build_linux -j4 - name: Set env vars run: | @@ -342,7 +345,7 @@ jobs: - name: Build WEX run: | cd wex - cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug + cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Release cmake --build build_linux - name: Save static lib, Dview & wexsandbox uses: actions/upload-artifact@v4 From 1ddbe879c7c11db29474dfb17fc84455c732cfb2 Mon Sep 17 00:00:00 2001 From: Darice Date: Wed, 22 May 2024 14:55:30 -0600 Subject: [PATCH 57/62] release ver --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da36627c..b8d316bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,7 +101,7 @@ jobs: - name: Set env vars run: | echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV - echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build_linux" >>$GITHUB_ENV + echo "LK_LIB=$GITHUB_WORKSPACE/lk/build_linux" >>$GITHUB_ENV echo "RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc" >>$GITHUB_ENV - name: Get git ref of sibling dependency SSC run: | @@ -217,7 +217,7 @@ jobs: shell: bash run: | echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV - echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build/Release" >>$GITHUB_ENV + echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build/Debug" >>$GITHUB_ENV echo "LK_LIB=$GITHUB_WORKSPACE/lk/build/Release" >>$GITHUB_ENV echo "RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc" >>$GITHUB_ENV - name: Get git ref of sibling dependency SSC @@ -319,7 +319,7 @@ jobs: - name: Set env vars run: | echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV - echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build_linux" >>$GITHUB_ENV + echo "LK_LIB=$GITHUB_WORKSPACE/lk/build_linux" >>$GITHUB_ENV echo "RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc" >>$GITHUB_ENV - name: Get git ref of sibling dependency SSC run: | From 7c09402e8345ea653f94e4e5a7a84042b4bebe7a Mon Sep 17 00:00:00 2001 From: Darice Date: Wed, 22 May 2024 15:02:06 -0600 Subject: [PATCH 58/62] fix windows path --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8d316bc..9f326ab7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,8 +172,8 @@ jobs: cd wxWidgets-$env:WX_VERSION msbuild build/msw/wx_vc17.sln /t:Build /p:Configuration=Release /p:Platform=x64 mkdir $env:WXMSW3 - cp -r wxWidgets-$WX_VERSION/include $env:WXMSW3 - cp -r wxWidgets-$WX_VERSION/lib $env:WXMSW3 + cp -r include $env:WXMSW3 + cp -r lib $env:WXMSW3 - name: Get branch name shell: bash run: | From 16d26c47904e1bb5a3d4f4c8862bf544adf20d68 Mon Sep 17 00:00:00 2001 From: Darice Date: Thu, 23 May 2024 10:04:22 -0600 Subject: [PATCH 59/62] remove download_wx.py --- .github/workflows/ci.yml | 1 + .github/workflows/download_wx.py | 70 -------------------------------- 2 files changed, 1 insertion(+), 70 deletions(-) delete mode 100644 .github/workflows/download_wx.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f326ab7..b9c38a82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,6 +181,7 @@ jobs: 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 + continue-on-error: true shell: bash run: | echo "GITHUB_REPOSITORY_OWNER=${GITHUB_REPOSITORY_OWNER}" >> $GITHUB_ENV diff --git a/.github/workflows/download_wx.py b/.github/workflows/download_wx.py deleted file mode 100644 index b843f851..00000000 --- a/.github/workflows/download_wx.py +++ /dev/null @@ -1,70 +0,0 @@ -import os -import requests -import platform -import re -from pathlib import Path -import zipfile -import sys - -if len(sys.argv) == 1: - raise RuntimeError(f"Script require argument of directory name for wxWidgets folder") -wx_dir_name = sys.argv[1] - -cwd = Path(os.getcwd()) - -github_token = os.environ.get("GITHUB_TOKEN") -headers = { - 'Accept': 'application/vnd.github+json', - 'Authorization': f'Bearer {github_token}', - 'X-GitHub-Api-Version': '2022-11-28', -} - -os_name = platform.system() - -if os_name == "Windows": - wx_name = "wxWidgets-windows" -elif os_name == "Linux": - wx_name = "wxWidgets-linux" -elif os_name == "Darwin": - os_name = platform.platform() - if 'arm' in os_name: - wx_name = 'wxWidgets-macos-latest' - else: - wx_name = 'wxWidgets-macos-[0-9][0-9]-large' -else: - raise Exception(f"{os_name} operating system not implemented") - -response = requests.get('https://api.github.com/repos/NREL/lk/actions/artifacts', headers=headers) -r = response.json() -if 'message' in r.keys(): - print(r) - raise RuntimeError(r['message']) - -artifacts = r['artifacts'] - -matching_artifacts = [art for art in artifacts if re.search(wx_name, art['name'])] - -if not len(matching_artifacts): - print([art['name'] for art in artifacts]) - raise RuntimeError(f"Could not find matching artifact for os {wx_name}") - -artifact = matching_artifacts[0] - -headers = { - 'Accept': 'application/vnd.github+json', - 'Authorization': f'Bearer {github_token}', - 'X-GitHub-Api-Version': '2022-11-28', -} - -response = requests.get( - artifact['archive_download_url'], - headers=headers, -) - -with open(cwd / 'wx.zip', 'wb') as f: - f.write(response.content) - -with zipfile.ZipFile('wx.zip', "r") as zip_ref: - zip_ref.extractall(cwd / f"{wx_dir_name}") - -print(f"Extracted to {str(cwd / wx_dir_name)}") \ No newline at end of file From 4382f3657c68b6c28d12c1e6741fa38e698fd855 Mon Sep 17 00:00:00 2001 From: Darice Date: Thu, 23 May 2024 15:20:59 -0600 Subject: [PATCH 60/62] add default branch --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9c38a82..acfc1e6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,7 @@ on: env: WX_VERSION: '3.2.4' + DEFAULT_BRANCH: patch jobs: build-on-ubuntu: @@ -105,7 +106,7 @@ jobs: 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}') + ref=$(git ls-remote --exit-code https://github.com/NREL/ssc.git refs/heads/$DEFAULT_BRANCH | 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 @@ -186,7 +187,7 @@ jobs: 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 + if [[ $? != "0" ]]; then echo "LK_BRANCH=$DEFAULT_BRANCH" >> $GITHUB_ENV; else echo "LK_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV; fi - name: Get git ref of sibling dependency LK shell: bash run: | @@ -224,7 +225,7 @@ jobs: - name: Get git ref of sibling dependency SSC shell: bash run: | - ref=$(git ls-remote --exit-code https://github.com/NREL/ssc.git refs/heads/develop | awk '{print $1}') + ref=$(git ls-remote --exit-code https://github.com/NREL/ssc.git refs/heads/$DEFAULT_BRANCH | 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 @@ -324,7 +325,7 @@ jobs: 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}') + ref=$(git ls-remote --exit-code https://github.com/NREL/ssc.git refs/heads/$DEFAULT_BRANCH | 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 From db71c0aeaae97f05a81666a6543a9114327c8d93 Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 28 May 2024 16:12:29 -0600 Subject: [PATCH 61/62] debug vs rel for MSVC --- tools/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 9246c13c..51816fba 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -75,14 +75,14 @@ endif () if (${CMAKE_PROJECT_NAME} STREQUAL system_advisor_model) target_link_libraries(wexsandbox lk) else () - if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR MSVC) + if (CMAKE_BUILD_TYPE STREQUAL "Debug" OR "Debug" IN_LIST CMAKE_CONFIGURATION_TYPES) unset(LKD_LIB CACHE) find_library(LKD_LIB NAMES lkd.a lkd.lib PATHS $ENV{LKD_LIB} $ENV{LKDIR}/build $ENV{LKDIR}/build/Debug) target_link_libraries(wexsandbox debug ${LKD_LIB}) endif () - if (CMAKE_BUILD_TYPE STREQUAL "Release" OR MSVC) + if (CMAKE_BUILD_TYPE STREQUAL "Release" OR "Release" IN_LIST CMAKE_CONFIGURATION_TYPES) unset(LK_LIB CACHE) find_library(LK_LIB NAMES lk.a lk.lib From 65021532935e51659813dbd0916976cec65f095e Mon Sep 17 00:00:00 2001 From: Darice Date: Tue, 18 Jun 2024 16:27:15 -0600 Subject: [PATCH 62/62] select branch based on push or pull_request --- .github/workflows/ci.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acfc1e6e..da66702a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,15 +71,23 @@ jobs: path: | ${{ env.WXMSW3 }} - - name: Get branch name + - name: Get branch name for pull request + if: ${{ github.event_name == 'pull_request' }} 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 + echo "GIT_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: Get git ref of sibling dependency LK run: | - ref=$(git ls-remote --exit-code https://github.com/NREL/lk.git refs/heads/$GIT_BRANCH | awk '{print $1}') + git ls-remote --heads --exit-code https://github.com/NREL/lk.git $GIT_BRANCH + if [[ $? != "0" ]]; then echo "LK_BRANCH=$DEFAULT_BRANCH" >> $GITHUB_ENV; else echo "LK_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV; fi + 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 + - name: Get cached build data of sibling dependency LK uses: actions/cache@v4 id: cachedlk @@ -106,7 +114,9 @@ jobs: 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/$DEFAULT_BRANCH | awk '{print $1}') + git ls-remote --heads --exit-code https://github.com/NREL/ssc.git $GIT_BRANCH + if [[ $? != "0" ]]; then echo "SSC_BRANCH=$DEFAULT_BRANCH" >> $GITHUB_ENV; else echo "SSC_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV; fi + 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 SSC uses: actions/cache@v4