Skip to content

Build test by workflow_dispatch #30

Build test by workflow_dispatch

Build test by workflow_dispatch #30

Workflow file for this run

name: Build test
run-name: Build test by ${{github.event_name}}
on:
pull_request:
workflow_dispatch:
inputs:
machine:
description: "Specifies the target device for which the image is built."
required: true
default: 'qcs6490-rb3gen2-vision-kit'
type: choice
options:
- qcs6490-rb3gen2-vision-kit
- qcs9100-ride-sx
- qcm6490-idp
- qcs6490-rb3gen2-core-kit
- sa8775p-ride-sx
distro:
description: "The short name of the distribution."
required: true
default: 'qcom-robotics-ros2-humble'
type: choice
options:
- qcom-robotics-ros2-humble
- qcom-robotics-ros2-jazzy
- qcom-wayland
build_override:
description: "QCOM build override"
required: true
default: 'custom'
type: choice
options:
- custom
- base
custom_build_cmd:
description: "Manually setting build commands"
required: false
type: string
default: ''
deploy_sdk:
description: "Deploy generated SDK to persistent directory"
required: false
type: boolean
default: false
env:
PERSIST_DIR: /srv/gh-runners/quic-qrb-ros
DL_DIR: /srv/gh-runners/quic-qrb-ros/downloads
MACHINE: ${{inputs.machine || 'qcs6490-rb3gen2-vision-kit'}}
DISTRO: ${{inputs.distro || 'qcom-robotics-ros2-humble'}}
QCOM_SELECTED_BSP: ${{inputs.build_override || 'custom'}}
DEPLOY_SDK: ${{github.event.inputs.deploy_sdk || 'false'}}
jobs:
build-pr:
runs-on: [self-hosted, x86]
timeout-minutes: 720
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
path: ${{github.event.repository.name}}
- name: Check and create work directories
run: |
if [ -e ${PERSIST_DIR} ] && [ -r ${PERSIST_DIR} ] && [ -w ${PERSIST_DIR} ];then
if [ ! -d ${DL_DIR} ];then
echo "Creating ${DL_DIR}!"
mkdir -p ${DL_DIR}
fi
if [ ! -d ${PERSIST_DIR}/sstate-cache-$DISTRO ];then
echo "Creating ${PERSIST_DIR}/sstate-cache-$DISTRO !"
mkdir -p ${PERSIST_DIR}/sstate-cache-$DISTRO
fi
echo "ls ${PERSIST_DIR}:"
ls ${PERSIST_DIR}/ -al
else
echo "DEPLOY_SDK=false" >> $GITHUB_ENV
fi
- name: Sync source tree
run: |
repo init -u https://github.com/quic-yocto/qcom-manifest -b qcom-linux-kirkstone -m qcom-6.6.38-QLI.1.2-Ver.1.1_robotics-product-sdk-1.1.xml
repo sync -c -j8
- name: Custom build
if: ${{github.event.inputs.custom_build_cmd != ''}}
run: |
if [ -e ${DL_DIR} ];then
ln -s ${DL_DIR} ./downloads
fi
source setup-robotics-environment
${{github.event.inputs.custom_build_cmd}}
- name: Full compilation
if: ${{github.event.inputs.custom_build_cmd == ''}}
run: |
set -x
if [ -e ${DL_DIR} ];then
ln -s ${DL_DIR} ./downloads
fi
source setup-robotics-environment
pwd
ls -al ../
../qirp-build qcom-robotics-full-image
- name: Deploy SDK
if: env.DEPLOY_SDK
run: |
if [ ! -d ${PERSIST_DIR}/qirp-sdk-$DISTRO ];then
echo "Creating ${PERSIST_DIR}/qirp-sdk-$DISTRO"
mkdir -p ${PERSIST_DIR}/qirp-sdk-$DISTRO"
mkdir -p ${PERSIST_DIR}/qirp-sdk-$DISTRO/.backup"
fi
mv ${PERSIST_DIR}/qirp-sdk-$DISTRO/* ${PERSIST_DIR}/qirp-sdk-$DISTRO/.backup/
cp ${{ github.workspace }}/build-$DISTRO/tmp-glibc/deploy/qirpsdk_artifacts/* ${PERSIST_DIR}/qirp-sdk-$DISTRO/
if [ $? == 0 ];then
rm ${PERSIST_DIR}/qirp-sdk-$DISTRO/.backup/* -fr
else
mv ${PERSIST_DIR}/qirp-sdk-$DISTRO/.backup/* ${PERSIST_DIR}/qirp-sdk-$DISTRO/
fi