test: build in qemu #11
Workflow file for this run
This file contains hidden or 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
| name: Build Raspberry Pi OS App in Docker | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04-arm | |
| strategy: | |
| matrix: | |
| signaling: [MQTT, HTTP] | |
| build_type: [Debug, Release] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Pull Raspberry Pi OS Docker Image | |
| run: | | |
| docker pull arm64v8/debian:bookworm-backports | |
| - name: Download and Prepare Raspberry Pi OS Image | |
| run: | | |
| wget -q https://downloads.raspberrypi.org/raspios_lite_arm64_latest -O rpi-os.img.xz | |
| xz -d rpi-os.img.xz | |
| fdisk -l rpi-os.img | |
| sudo mkdir boot | |
| sudo mount -o loop,offset=541065216 rpi-os.img boot | |
| sudo tar -C boot -cf rpi-rootfs.tar . | |
| docker import rpi-rootfs.tar rpi-docker-image | |
| sudo umount boot | |
| - name: Build inside Docker | |
| run: | | |
| docker run --rm -v ${{ github.workspace }}:/app rpi-docker-image /usr/bin/bash -c " | |
| apt update --fix-missing && | |
| apt install -y \ | |
| wget \ | |
| curl \ | |
| cmake \ | |
| clang \ | |
| build-essential \ | |
| mosquitto-dev \ | |
| libboost-program-options-dev \ | |
| libavformat-dev \ | |
| libavcodec-dev \ | |
| libavutil-dev \ | |
| libswscale-dev \ | |
| libpulse-dev \ | |
| libasound2-dev \ | |
| libjpeg-dev \ | |
| libcamera-dev \ | |
| libmosquitto-dev && | |
| cd /app && | |
| wget -q https://github.com/TzuHuanTai/Native-WebRTC-Build/releases/download/5790/libwebrtc-arm64.tar.gz && | |
| tar -xzf libwebrtc-arm64.tar.gz && | |
| mkdir -p /usr/local/include/webrtc && | |
| cp -r include/* /usr/local/include/webrtc && | |
| cp -r lib/* /usr/local/lib && | |
| mkdir -p /usr/local/include/nlohmann && | |
| curl -L https://raw.githubusercontent.com/nlohmann/json/develop/single_include/nlohmann/json.hpp -o /usr/local/include/nlohmann/json.hpp && | |
| mkdir -p build && | |
| cd build && | |
| cmake .. -DCMAKE_CXX_COMPILER=clang++ -DUSE_${{ matrix.signaling }}_SIGNALING=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} && | |
| make -j$(nproc) | |
| tar -czvf pi_webrtc-${{ github.ref_name }}_${{ matrix.signaling }}_${{ matrix.build_type }}.tar.gz pi_webrtc | |
| " | |
| - name: Upload to GitHub | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: build/pi_webrtc-${{ github.ref_name }}_${{ matrix.signaling }}_${{ matrix.build_type }}.tar.gz |