Added raspberry pi CI

This commit is contained in:
AlexandreRouma 2021-11-24 20:02:16 +01:00
parent e394b64ad3
commit 2261b0fc2b
4 changed files with 88 additions and 1 deletions

View File

@ -297,9 +297,31 @@ jobs:
with:
name: sdrpp_ubuntu_impish_amd64
path: ${{runner.workspace}}/sdrpp_debian_amd64.deb
build_raspios_bullseye:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create Docker Image
run: cd $GITHUB_WORKSPACE/docker_builds/raspios_bullseye && docker build . --tag sdrpp_build
- name: Run Container
run: docker run --name build -v $GITHUB_WORKSPACE:/root/SDRPlusPlus --env BUILD_NO="-$GITHUB_RUN_NUMBER" sdrpp_build /root/do_build.sh
- name: Recover Deb Archive
working-directory: ${{runner.workspace}}
run: docker cp build:/root/SDRPlusPlus/sdrpp_raspios_arm32.deb ./
- name: Save Deb Archive
uses: actions/upload-artifact@v2
with:
name: sdrpp_raspios_bullseye_arm32
path: ${{runner.workspace}}/sdrpp_raspios_arm32.deb
create_full_archive:
needs: ['build_windows', 'build_macos', 'build_debian_buster', 'build_debian_bullseye', 'build_debian_sid', 'build_ubuntu_bionic', 'build_ubuntu_focal', 'build_ubuntu_groovy', 'build_ubuntu_hirsute', 'build_ubuntu_impish']
needs: ['build_windows', 'build_macos', 'build_debian_buster', 'build_debian_bullseye', 'build_debian_sid', 'build_ubuntu_bionic', 'build_ubuntu_focal', 'build_ubuntu_groovy', 'build_ubuntu_hirsute', 'build_ubuntu_impish', 'build_raspios_bullseye']
runs-on: ubuntu-latest
steps:
@ -319,6 +341,7 @@ jobs:
mv sdrpp_ubuntu_groovy_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_ubuntu_groovy_amd64.deb &&
mv sdrpp_ubuntu_hirsute_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_ubuntu_hirsute_amd64.deb &&
mv sdrpp_ubuntu_impish_amd64/sdrpp_debian_amd64.deb sdrpp_all/sdrpp_ubuntu_impish_amd64.deb
mv sdrpp_raspios_bullseye_arm32/sdrpp_raspios_arm32.deb sdrpp_all/sdrpp_raspios_bullseye_arm32.deb
- uses: actions/upload-artifact@v2
with:

View File

@ -0,0 +1,4 @@
FROM ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
COPY do_build.sh /root
RUN chmod +x /root/do_build.sh

View File

@ -0,0 +1,48 @@
#!/bin/bash
set -e
cd /root
# Install tools
apt update
apt install -y wget p7zip-full qemu-user-static gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf build-essential cmake pkg-config
# Download and extract raspberry pi image
wget https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-11-08/2021-10-30-raspios-bullseye-armhf-lite.zip
7z x 2021-10-30-raspios-bullseye-armhf-lite.zip
7z x 2021-10-30-raspios-bullseye-armhf-lite.img
# Expand and mount rootfs image
dd if=/dev/zero bs=1G count=1 >> 1.img
e2fsck -f 1.img
resize2fs 1.img
mount 1.img /mnt
# Copy qemu to the rootfs
cp /usr/bin/qemu-arm-static /mnt/bin/
# Inject script to install dependencies
echo 'export DEBIAN_FRONTEND=noninteractive' >> /mnt/root/prepare.sh
echo 'apt update --allow-releaseinfo-change' >> /mnt/root/prepare.sh
echo 'apt install -y build-essential cmake git libfftw3-dev libglfw3-dev libglew-dev libvolk2-dev libsoapysdr-dev libairspyhf-dev libairspy-dev \' >> /mnt/root/prepare.sh
echo ' libiio-dev libad9361-dev librtaudio-dev libhackrf-dev librtlsdr-dev libbladerf-dev liblimesuite-dev p7zip-full wget portaudio19-dev \' >> /mnt/root/prepare.sh
echo ' libcodec2-dev' >> /mnt/root/prepare.sh
# Run prepare.sh script
chroot /mnt /bin/qemu-arm-static /bin/bash /root/prepare.sh
# Setup environment variables
export PKG_CONFIG_PATH=''
export PKG_CONFIG_LIBDIR='/mnt/usr/lib/arm-linux-gnueabihf/pkgconfig:/mnt/usr/lib/pkgconfig:/mnt/usr/share/pkgconfig'
export PKG_CONFIG_SYSROOT_DIR='/mnt'
# Build SDR++
cd SDRPlusPlus
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../docker_builds/raspios_bullseye/rpi_toolchain.cmake -DOPT_BUILD_BLADERF_SOURCE=ON -DOPT_BUILD_LIMESDR_SOURCE=ON -DOPT_BUILD_NEW_PORTAUDIO_SINK=ON -DOPT_BUILD_M17_DECODER=ON
make VERBOSE=1 -j2
# Create deb
cd ..
sh make_debian_package.sh ./build 'libfftw3-dev, libglfw3-dev, libglew-dev, libvolk2-dev, librtaudio-dev'
mv sdrpp_debian_amd64.deb sdrpp_raspios_arm32.deb

View File

@ -0,0 +1,12 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_SYSROOT /mnt)
set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)