Merge pull request #164 from NREL/hybrids #227
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
pull_request: | |
jobs: | |
build-on-ubuntu: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup cmake | |
uses: jwlawson/[email protected] | |
with: | |
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: Get GCC version | |
run: gcc --version | |
- name: Get libc version | |
run: ldd --version | |
- name: Install wxWidgets | |
run: | | |
sudo apt-get install -y libwxgtk*-dev | |
sudo ln -s $(which wx-config) /usr/local/bin/wx-config-3 | |
wx-config-3 --cflags | grep I | |
- name: Get git ref of sibling dependency LK | |
run: | | |
ref=$(git ls-remote --exit-code https://github.com/NREL/lk.git refs/heads/develop | awk '{print $1}') | |
echo "ref_of_lk=$ref" | tee --append $GITHUB_ENV | |
- name: Get cached build data of sibling dependency LK | |
uses: actions/cache@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 | |
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug | |
cmake --build build_linux -- -j | |
- name: Set LKDIR | |
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 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 | |
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: Checkout | |
uses: actions/checkout@v2 | |
with: | |
path: wex | |
- 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-${{ 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 |