-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci/kuiper: workflow that build Scopy for Kuiper
Signed-off-by: Bindea Cristian <[email protected]>
- Loading branch information
1 parent
373d69e
commit 4fcd6e7
Showing
14 changed files
with
259 additions
and
34 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Kuiper Scopy Build | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
BUILD_HOST: ubuntu-22.04 | ||
USERNAME: github-actions | ||
|
||
jobs: | ||
|
||
build_scopy_on_ubuntu22: | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: cristianbindea/scopy2-kuiper:latest | ||
options: --user root | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: fix dubious ownership | ||
shell: bash | ||
run: git config --global --add safe.directory $GITHUB_WORKSPACE | ||
|
||
- name: fix HOME variable | ||
shell: bash | ||
run: echo HOME=/home/runner | sudo tee -a $GITHUB_ENV | ||
|
||
- name: Build Scopy | ||
shell: bash | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
./ci/kuiper/kuiper_build_process.sh install_packages download_cmake download_crosscompiler move_sysroot build_scopy build_iio-emu create_appdir create_appimage move_appimage | ||
- name: Set short git commit SHA | ||
shell: bash | ||
run: echo "commit_sha=$(git rev-parse --short ${{ github.sha }})" >> "$GITHUB_ENV" | ||
|
||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ${{ github.workspace }}\Scopy.AppImage | ||
asset_name: scopy-linux-armhf-${{ env.commit_sha }} | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
body: "Scopy armhf" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
SELF=$(readlink -f "$0") | ||
HERE=${SELF%/*} | ||
|
||
export QT_PLUGIN_PATH=$HERE/usr/plugins | ||
export QT_QPA_PLATFORM_PLUGIN_PATH=$HERE/usr/plugins/platforms | ||
export LD_LIBRARY_PATH=$HERE/usr/lib | ||
|
||
exec $HERE/usr/bin/scopy |
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
SRC_DIR=$(git rev-parse --show-toplevel) | ||
source $SRC_DIR/ci/kuiper/kuiper_build_config.sh | ||
|
||
BINARY=$1 | ||
LOCATION=$2 | ||
|
||
|
||
if [ ! -f "${SRC_DIR}"/ci/kuiper/ldd-mod ]; then | ||
sed 's|.*RTLDLIST=.*|RTLDLIST="/usr/arm-linux-gnueabihf/lib/ld-2.31.so /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3"|' /usr/bin/ldd | tee "${SRC_DIR}"/ci/kuiper/ldd-mod | ||
chmod +x "${SRC_DIR}"/ci/kuiper/ldd-mod | ||
fi | ||
|
||
export LD_LIBRARY_PATH="${APP_DIR}/usr/lib:${SYSROOT}/lib:${SYSROOT}/lib/arm-linux-gnueabihf:${SYSROOT}/usr/arm-linux-gnueabihf/lib:${SYSROOT}/usr/local/qt5.15/lib:${SYSROOT}/usr/local/lib:${SRC_DIR}/build" | ||
LIBS_ARRAY=() | ||
run_ldd(){ | ||
|
||
if [ ! -z "$(${SRC_DIR}/ci/kuiper/ldd-mod $1 | grep "not found")" ]; then | ||
echo "--- LIB NOT FOUND" | ||
${SRC_DIR}/ci/kuiper/ldd-mod $1 | ||
exit 1 | ||
fi | ||
|
||
for library in $("${SRC_DIR}"/ci/kuiper/ldd-mod "$1" | cut -d '>' -f 2 | awk '{print $1}') | ||
do | ||
# check if the library exists at that path and if it was processed already | ||
if [ -f "${library}" ] && ! [[ "${LIBS_ARRAY[*]}" =~ "${library}" ]]; then | ||
LIBS_ARRAY+=("${library}") | ||
echo "---NEW: ${library}" | ||
if [ ! -f "${LOCATION}"/"${library##*/}" ]; then | ||
cp --verbose "${library}" "${LOCATION}" | ||
[ -L "${library}" ] && cp --verbose "$(realpath "${library}")" "${LOCATION}" | ||
fi | ||
run_ldd "${library}" | ||
fi | ||
done | ||
} | ||
|
||
for arg in $BINARY; do | ||
run_ldd "${arg}" | ||
done |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
SRC_DIR=$(git rev-parse --show-toplevel) | ||
source $SRC_DIR/ci/kuiper/kuiper_build_config.sh | ||
|
||
install_packages(){ | ||
sudo apt-get update | ||
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | ||
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | ||
sudo apt-get update | ||
sudo apt-get -y install containerd.io docker-ce docker-ce-cli docker-buildx-plugin | ||
} | ||
|
||
create_sysroot(){ | ||
$SRC_DIR/ci/kuiper/create_sysroot.sh \ | ||
install_packages \ | ||
download_kuiper \ | ||
install_qemu \ | ||
extract_sysroot \ | ||
configure_sysroot | ||
} | ||
|
||
tar_and_move_sysroot(){ | ||
pushd $STAGING_AREA | ||
sudo tar -czvf "${SYSROOT_TAR##*/}" sysroot | ||
|
||
# move the sysroot next to Dockerfile in order to use copy the tar in the docker image | ||
sudo mv $SYSROOT_TAR $SYSROOT_DOCKER | ||
popd | ||
} | ||
|
||
create_image(){ | ||
pushd ${SRC_DIR}/ci/kuiper/docker | ||
sudo DOCKER_BUILDKIT=0 docker build --tag cristianbindea/scopy2-kuiper . | ||
# sudo docker build --load --tag cristianbindea/scopy2-kuiper . | ||
popd | ||
} | ||
|
||
install_packages | ||
create_sysroot | ||
tar_and_move_sysroot | ||
create_image |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
FROM --platform=linux/amd64 ubuntu:20.04 AS start | ||
SHELL ["/bin/bash", "-c"] | ||
ARG USER=runner | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV TZ=Europe/Bucharest | ||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | ||
RUN apt-get update && \ | ||
apt-get -y upgrade && \ | ||
apt-get install -y apt-utils sudo git wget flex bison pkg-config make python3 pip vim | ||
RUN groupadd -g 1000 -r $USER && \ | ||
useradd -u 1000 -g 1000 --create-home -r $USER | ||
|
||
#Change password | ||
RUN echo "$USER:$USER" | chpasswd | ||
|
||
#Make sudo passwordless | ||
RUN echo "${USER} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-$USER && \ | ||
usermod -aG sudo $USER && \ | ||
usermod -aG plugdev $USER | ||
|
||
USER $USER | ||
WORKDIR /home/${USER} | ||
|
||
|
||
|
||
FROM start AS sysroot_builder | ||
ARG USER=runner | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
COPY sysroot.tar.gz /home/${USER} | ||
RUN git clone https://github.com/analogdevicesinc/scopy -b kuiper-worflow | ||
WORKDIR /home/${USER}/scopy | ||
RUN ./ci/kuiper/create_sysroot.sh \ | ||
install_packages \ | ||
move_and_extract_sysroot \ | ||
fix_relativelinks | ||
RUN ./ci/kuiper/build_qt.sh \ | ||
install_packages \ | ||
download_qt \ | ||
download_crosscompiler \ | ||
build_qt5.15.2 | ||
RUN ./ci/kuiper/kuiper_build_process.sh \ | ||
install_packages \ | ||
download_cmake \ | ||
download_crosscompiler \ | ||
clone \ | ||
build_deps | ||
|
||
|
||
|
||
FROM start | ||
ARG USER=runner | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
RUN mkdir -p /home/${USER}/sysroot | ||
COPY --from=sysroot_builder /home/${USER}/scopy/ci/kuiper/staging/sysroot/usr /home/${USER}/sysroot/usr | ||
COPY --from=sysroot_builder /home/${USER}/scopy/ci/kuiper/staging/sysroot/share /home/${USER}/sysroot/share | ||
COPY --from=sysroot_builder /home/${USER}/scopy/ci/kuiper/staging/sysroot/include /home/${USER}/sysroot/include | ||
WORKDIR /home/${USER}/sysroot | ||
RUN ln -s usr/bin bin && ln -s usr/lib lib && ln -s usr/sbin sbin | ||
WORKDIR /home/${USER} |
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
Oops, something went wrong.