Skip to content

Commit

Permalink
add mac build
Browse files Browse the repository at this point in the history
  • Loading branch information
dguittet committed May 20, 2024
1 parent bbbeebb commit e59477d
Showing 1 changed file with 106 additions and 14 deletions.
120 changes: 106 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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}')
Expand All @@ -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*
Expand Down Expand Up @@ -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
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

0 comments on commit e59477d

Please sign in to comment.