Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Continuous Integration for Linux with GitHub Actions #33

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
228 changes: 228 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
name: CI

on:
push:
pull_request:

jobs:
build-on-ubuntu1804:
runs-on: ubuntu-18.04
env:
RUNS_ON: ubuntu1804
GH_WORKSPACE: /home/runner/work/SolTrace/SolTrace #= $GITHUB_WORKSPACE
steps:
- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
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 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
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug
cmake --build build_linux -- -j
- name: Set LKDIR and LKD_LIB envs
run: |
echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV
echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build_linux" >>$GITHUB_ENV # iff CMAKE_BUILD_TYPE=Debug

- name: Get git ref of sibling dependency WEX
run: |
ref=$(git ls-remote --exit-code git://github.com/NREL/wex.git refs/heads/develop | awk '{print $1}')
echo "ref_of_wex=$ref" | tee --append $GITHUB_ENV
- name: Get cached build data of sibling dependency WEX
uses: actions/cache@v2
id: cachedwex
with:
path: ${{ env.GH_WORKSPACE }}/wex
key: ${{ env.RUNS_ON }}-${{ env.ref_of_wex }}-WEX
- name: Clone sibling dependency WEX
if: steps.cachedwex.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
ref: ${{ env.ref_of_wex }}
path: wex
repository: NREL/wex
- name: Build WEX
if: steps.cachedwex.outputs.cache-hit != 'true'
run: |
cd $GITHUB_WORKSPACE/wex
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug
cmake --build build_linux
- name: Set WEXDIR env
run: echo "WEXDIR=$GITHUB_WORKSPACE/wex/build_linux" >>$GITHUB_ENV

- name: Checkout
uses: actions/checkout@v2
with:
path: SolTrace

- name: Build coretrace
run: |
cd $GITHUB_WORKSPACE/SolTrace/coretrace/build_linux
make -j

- name: Set app-specific envs
run: |
echo "WEXDIR=$GITHUB_WORKSPACE/wex" >>$GITHUB_ENV
echo "WEXLIB=$GITHUB_WORKSPACE/wex/build_linux/wexd.a" >>$GITHUB_ENV # iff CMAKE_BUILD_TYPE=Debug
echo "LKLIB=$GITHUB_WORKSPACE/lk/build_linux/lkd.a" >>$GITHUB_ENV # iff CMAKE_BUILD_TYPE=Debug
- name: Build desktop app
run: |
cd $GITHUB_WORKSPACE/SolTrace/app/build_linux
make -j

- name: Save soltrace
uses: actions/upload-artifact@v2
with:
name: soltrace-${{ env.RUNS_ON }}-x86_64
path: ${{ env.GH_WORKSPACE }}/SolTrace/app/deploy/linux_64/soltrace

build-on-ubuntu2004:
runs-on: ubuntu-20.04
env:
RUNS_ON: ubuntu2004
GH_WORKSPACE: /home/runner/work/SolTrace/SolTrace #= $GITHUB_WORKSPACE
steps:
- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
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 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
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug
cmake --build build_linux -- -j
- name: Set LKDIR and LKD_LIB envs
run: |
echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV
echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build_linux" >>$GITHUB_ENV # iff CMAKE_BUILD_TYPE=Debug

- name: Get git ref of sibling dependency WEX
run: |
ref=$(git ls-remote --exit-code git://github.com/NREL/wex.git refs/heads/develop | awk '{print $1}')
echo "ref_of_wex=$ref" | tee --append $GITHUB_ENV
- name: Get cached build data of sibling dependency WEX
uses: actions/cache@v2
id: cachedwex
with:
path: ${{ env.GH_WORKSPACE }}/wex
key: ${{ env.RUNS_ON }}-${{ env.ref_of_wex }}-WEX
- name: Clone sibling dependency WEX
if: steps.cachedwex.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
ref: ${{ env.ref_of_wex }}
path: wex
repository: NREL/wex
- name: Build WEX
if: steps.cachedwex.outputs.cache-hit != 'true'
run: |
cd $GITHUB_WORKSPACE/wex
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug
cmake --build build_linux
- name: Set WEXDIR env
run: echo "WEXDIR=$GITHUB_WORKSPACE/wex/build_linux" >>$GITHUB_ENV

- name: Checkout
uses: actions/checkout@v2
with:
path: SolTrace

- name: Build coretrace
run: |
cd $GITHUB_WORKSPACE/SolTrace/coretrace/build_linux
make -j

- name: Set app-specific envs
run: |
echo "WEXDIR=$GITHUB_WORKSPACE/wex" >>$GITHUB_ENV
echo "WEXLIB=$GITHUB_WORKSPACE/wex/build_linux/wexd.a" >>$GITHUB_ENV # iff CMAKE_BUILD_TYPE=Debug
echo "LKLIB=$GITHUB_WORKSPACE/lk/build_linux/lkd.a" >>$GITHUB_ENV # iff CMAKE_BUILD_TYPE=Debug
- name: Build desktop app
run: |
cd $GITHUB_WORKSPACE/SolTrace/app/build_linux
make -j

- name: Save soltrace
uses: actions/upload-artifact@v2
with:
name: soltrace-${{ env.RUNS_ON }}-x86_64
path: ${{ env.GH_WORKSPACE }}/SolTrace/app/deploy/linux_64/soltrace
10 changes: 5 additions & 5 deletions app/build_linux/Makefile-ui
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
VPATH = ../src/


WEXDIR = ../../../wex
WEXLIB = $(WEXDIR)/build/wex.a
LKDIR = ../../../lk
LKLIB = $(LKDIR)/build/lk.a
WEXDIR ?= ../../../wex
WEXLIB ?= $(WEXDIR)/build/wex.a
LKDIR ?= ../../../lk
LKLIB ?= $(LKDIR)/build/lk.a
CORETRACEDIR = ../../coretrace
CORETRACELIB = $(CORETRACEDIR)/build_linux/coretrace.a

Expand All @@ -14,7 +14,7 @@ CXX = g++
CFLAGS = -g -O2 -std=c++11 -I. -I$(LKDIR)/include -I$(WEXDIR)/include -I$(CORETRACEDIR) -DLK_USE_WXWIDGETS `wx-config-3 --cflags`

CXXFLAGS = $(CFLAGS)
LDFLAGS = $(WEXLIB) $(LKLIB) $(CORETRACELIB) `wx-config-3 --libs stc` `wx-config-3 --libs aui` `wx-config-3 --libs gl` `wx-config-3 --libs` -lm -lcurl -lfontconfig -ldl
LDFLAGS = $(WEXLIB) $(LKLIB) $(CORETRACELIB) `wx-config-3 --libs stc` `wx-config-3 --libs aui` `wx-config-3 --libs gl` -lGL `wx-config-3 --libs` -lm -lcurl -lfontconfig -ldl


OBJECTS = \
Expand Down