Skip to content

Commit 1ba1872

Browse files
authored
Add raspberry pi checks to the CI (#1222)
* Add raspberry pi checks to the CI * Add zerolatency tuning option * Add comment containing the debian version * Remove env section
1 parent e09903d commit 1ba1872

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Build and test on Virtualized Raspberry Pi OS
2+
3+
on:
4+
push:
5+
branches: [ master, develop ]
6+
pull_request:
7+
branches: [ master, develop ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 30
13+
permissions:
14+
id-token: write
15+
contents: read
16+
strategy:
17+
matrix:
18+
include:
19+
# Debian 11
20+
- os: bullseye
21+
image: ghcr.io/dtcooper/raspberrypi-os:python3.12-bullseye
22+
# Debian 12
23+
- os: bookworm
24+
image: ghcr.io/dtcooper/raspberrypi-os:python3.12-bookworm
25+
fail-fast: false
26+
27+
name: Build on ${{ matrix.os }}
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v3
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Configure AWS Credentials
39+
uses: aws-actions/configure-aws-credentials@v4
40+
with:
41+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
42+
role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
43+
aws-region: ${{ secrets.AWS_REGION }}
44+
role-duration-seconds: 10800
45+
46+
- name: Build and Test
47+
env:
48+
AWS_KVS_LOG_LEVEL: 2
49+
run: |
50+
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace \
51+
-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY \
52+
-e AWS_SESSION_TOKEN -e AWS_REGION -e AWS_KVS_LOG_LEVEL \
53+
--platform linux/arm64 \
54+
${{ matrix.image }} \
55+
/bin/bash -c '
56+
set -ex
57+
apt-get update
58+
apt-get install -y automake build-essential cmake git \
59+
gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad \
60+
gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly \
61+
gstreamer1.0-tools gstreamer1.0-omx-generic \
62+
libcurl4-openssl-dev libgstreamer1.0-dev \
63+
libgstreamer-plugins-base1.0-dev liblog4cplus-dev \
64+
libssl-dev pkg-config
65+
66+
mkdir -p build
67+
cd build
68+
69+
cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_DEPENDENCIES=OFF -DALIGNED_MEMORY_MODEL=ON
70+
make -j$(nproc)
71+
72+
export GST_PLUGIN_PATH=$(pwd)
73+
74+
set +e # Disable exit on error for the timeout command
75+
timeout --preserve-status --signal=SIGINT --kill-after=15s 30s \
76+
gst-launch-1.0 -v videotestsrc is-live=true \
77+
! video/x-raw,framerate=10/1,width=640,height=480 \
78+
! clockoverlay time-format="%a %B %d, %Y %I:%M:%S %p" \
79+
! x264enc bframes=0 key-int-max=10 tune=zerolatency \
80+
! h264parse \
81+
! kvssink stream-name="cpp-producer-rpi-${{ matrix.os }}"
82+
EXIT_CODE=$?
83+
set -e # Re-enable exit on error
84+
85+
# 0: Process exited after interrupt with code 0
86+
# 1: Process exited with error code 1
87+
# 137: Process killed by SIGKILL (if the --kill-after timeout is reached)
88+
echo "Command exited with code: $EXIT_CODE"
89+
if [ $EXIT_CODE -ne 0 ]; then
90+
echo "Command did not exit gracefully after interrupt."
91+
exit 1
92+
fi
93+
'

0 commit comments

Comments
 (0)