Skip to content

Commit

Permalink
fixup! feat(core): CI pipeline to build and test CPP SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaKasar committed Oct 10, 2024
1 parent ad5df08 commit b4e8379
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 53 deletions.
102 changes: 67 additions & 35 deletions .github/workflows/cxx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,84 @@ on:
env:
HUSKY: 0
jobs:
release:
name: Release
install_thunder:
name: Build and install Thunder Library
runs-on: ubuntu-latest
container:
image: kevinshahfws/node-c:3.0
steps:
# Checkout/install project
- name: Checkout
uses: actions/checkout@v2

- name: Install Gcovr
run: |
apt remove --purge gcovr -y
pip install --upgrade gcovr
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 'lts/*'

- name: Install dependencies
run: npm ci

- name: Clone and Install Thunder
id: install_thunder
run: |
.github/workflows/utils.sh cloneAndInstallThunder
- name: Upload the library artifact
uses: actions/upload-artifact@v2
with:
name: Thunder
path: /home/aditya-v/work/keaton-sdk/install/usr/lib

- name: Build Artifacts
run: |
npm run dist
# build_cxx_sdks:
# name: Build and test CXX SDKs
# needs: install_thunder
# runs-on: ubuntu-latest
# container:
# image: kevinshahfws/node-c:3.0
# steps:
# # Checkout/install project
# - name: Checkout
# uses: actions/checkout@v2

- name: Build CXX
run: |
cd src/sdks/core/
ls
npm run cpp
# - name: Install Gcovr
# run: |
# apt remove --purge gcovr -y
# pip install --upgrade gcovr

# - name: Setup Node.js
# uses: actions/setup-node@v2
# with:
# node-version: 'lts/*'

- name: Build SDK
run: |
tar -zxvf src/sdks/core/build/cpp/src/firebolt-core-native-sdk-1.3.0-next.1.tgz -C ../
cd ../firebolt-core-native-sdk-1.3.0-next.1
cp -f ../firebolt-apis/external/CMakeLists.txt ./
cp -f ../firebolt-apis/external/include/json_engine.h ./include/
cp -f ../firebolt-apis/external/src/CMakeLists.txt ./src/
cp -f ../firebolt-apis/external/src/Transport.h ./src/
./build.sh -s ${pwd}/../install
ls build/test/
ctest --test-dir build/
# - name: Install dependencies
# run: npm ci

# - name: Clone and Install Thunder
# id: install_thunder
# run: |
# .github/workflows/utils.sh cloneAndInstallThunder

# - name: Build Artifacts
# run: |
# npm run dist

# - name: Build CXX Core SDK
# run: |
# .github/workflows/utils.sh buildCoreCPPSDK

# - name: Build CXX Manage SDK
# run: |
# .github/workflows/utils.sh buildManageCPPSDK
# cd src/sdks/core/
# npm run cpp
# tar -zxvf src/sdks/core/build/cpp/src/firebolt-core-native-sdk-1.3.0-next.1.tgz -C ../
# cd ../firebolt-core-native-sdk-1.3.0-next.1
# cp -f ../firebolt-apis/external/CMakeLists.txt ./
# cp -f ../firebolt-apis/external/include/json_engine.h ./include/
# cp -f ../firebolt-apis/external/src/CMakeLists.txt ./src/
# cp -f ../firebolt-apis/external/src/Transport.h ./src/
# ./build.sh -s ${pwd}/../install

# - name: Build SDK
# run: |


# cp -f ../firebolt-apis/external/CMakeLists.txt ./
# cp -f ../firebolt-apis/external/include/json_engine.h ./include/
# cp -f ../firebolt-apis/external/src/CMakeLists.txt ./src/
# cp -f ../firebolt-apis/external/src/Transport.h ./src/
# ./build.sh -s ${pwd}/../install
# ls build/test/
# ctest --test-dir build/
29 changes: 11 additions & 18 deletions .github/workflows/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ function cloneAndInstallThunder() {
-DVOLATILE_PATH="tmp" && echo "Thunder configure succeeded" || exit 9999

cmake --build build/Thunder --target install && echo "Thunder Build succeeded" || exit 9999

}

function buildCoreCPPSDK() {
Expand All @@ -279,17 +280,12 @@ function buildCoreCPPSDK() {
echo "The version from package.json is $FIREBOLT_VERSION"

cd src/sdks/core
ls -la build/cpp/src
cp build/cpp/src/firebolt-core-native-sdk-${FIREBOLT_VERSION}.tgz $current_dir/data
cd $current_dir/data
tar -zxvf firebolt-core-native-sdk-${FIREBOLT_VERSION}.tgz
cd firebolt-core-native-sdk-${FIREBOLT_VERSION}/
npm run cpp
FIREBOLT_VERSION=1.3.0-next.1
tar -zxvf build/cpp/src/firebolt-core-native-sdk-${FIREBOLT_VERSION}.tgz -C $current_dir/data
cd $current_dir/data/firebolt-core-native-sdk-${FIREBOLT_VERSION}/
chmod +x ./build.sh
sed -i -e 's/prefix=/prefix /g' build.sh
cat ./build.sh

echo "***************** firebolt.h *****************"
cat include/firebolt.h

./build.sh -s "$current_dir/install" || exit 9999
./build.sh -f "$current_dir/data/firebolt-core-native-sdk-${FIREBOLT_VERSION}/build/Firebolt" -s "$current_dir/install"
Expand All @@ -304,20 +300,17 @@ function buildManageCPPSDK() {

cd $current_apis_dir
cd src/sdks/manage
ls -la build/cpp/src
cp build/cpp/src/firebolt-manage-native-sdk-${FIREBOLT_VERSION}.tgz $current_dir/data
cd $current_dir/data
tar -zxvf firebolt-manage-native-sdk-${FIREBOLT_VERSION}.tgz
cd firebolt-manage-native-sdk-${FIREBOLT_VERSION}/
npm run cpp
FIREBOLT_VERSION=1.3.0-next.1
tar -zxvf build/cpp/src/firebolt-manage-native-sdk-${FIREBOLT_VERSION}.tgz -C $current_dir/data
cd $current_dir/data/firebolt-manage-native-sdk-${FIREBOLT_VERSION}/
chmod +x ./build.sh
sed -i -e 's/prefix=/prefix /g' build.sh
cat ./build.sh

echo "***************** firebolt.h *****************"
cat include/firebolt.h

./build.sh -s "$current_dir/install" || exit 9999
./build.sh -f "$current_dir/data/firebolt-manage-native-sdk-${FIREBOLT_VERSION}/build/Firebolt" -s "$current_dir/install"

cd $current_apis_dir
}

function buildDiscoveryCPPSDK() {
Expand Down

0 comments on commit b4e8379

Please sign in to comment.