Check rialto branch (for rialto headers) in github action - fix for m… #30
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
# | |
# If not stated otherwise in this file or this component's LICENSE file the | |
# following copyright and licenses apply: | |
# | |
# Copyright 2024 Sky UK | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
name: Native Build | |
on: | |
pull_request: | |
branches: [ "master", "rdkcentral:master" ] | |
push: | |
branches: [ "master", "rdkcentral:master" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
path: rialto-ocdm | |
- name: Check out rialto | |
uses: actions/checkout@v3 | |
with: | |
repository: rdkcentral/rialto | |
path: ./rialto | |
fetch-depth: 0 | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install build-essential | |
sudo apt-get install cmake | |
sudo apt-get install libunwind-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev libgstreamer1.0-dev | |
- name: Install protobuf | |
run: | | |
sudo apt-get install protobuf-compiler | |
- name: Switch branch | |
continue-on-error: true | |
run: | | |
BRANCH=${GITHUB_HEAD_REF##*/} | |
cd rialto | |
# This will fail if there's no corresponding branch in rialto | |
# ...but that's ok since we set continue-on-error | |
git checkout $BRANCH | |
- name: Native build Rialto | |
run: | | |
BASE_DIR=$(pwd) | |
NATIVE_DIR=$BASE_DIR/native | |
echo "NATIVE_DIR=$NATIVE_DIR" &> $BASE_DIR/output_file.txt | |
ls &>> $BASE_DIR/output_file.txt | |
cd rialto | |
cmake . -B build -DCMAKE_INSTALL_PREFIX=$NATIVE_DIR -DNATIVE_BUILD=ON -DRIALTO_BUILD_TYPE="Debug" &>> $BASE_DIR/output_file.txt | |
make -C build install &>> $BASE_DIR/output_file.txt | |
- name: Native build OCDM | |
run: | | |
BASE_DIR=$(pwd) | |
NATIVE_DIR=$BASE_DIR/native | |
cd rialto-ocdm | |
echo "@@@ OCDM BUILD" &>> $BASE_DIR/output_file.txt | |
cmake . -B build -DCMAKE_INCLUDE_PATH="${NATIVE_DIR}/include" -DCMAKE_LIBRARY_PATH="${NATIVE_DIR}/lib" -DNATIVE_BUILD=ON -DRIALTO_BUILD_TYPE="Debug" &>> $BASE_DIR/output_file.txt | |
make -C build &>> $BASE_DIR/output_file.txt | |
- name: Report Build Status Success | |
if: success() | |
run: | | |
echo "Build Succeeded!" | |
exit 0 | |
- name: Upload Logs on Failure | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: Output Logs | |
path: | | |
output_file.txt |