Skip to content

Commit 94283b4

Browse files
committed
Add raspberry pi checks to the CI
1 parent 7acf272 commit 94283b4

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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+
strategy:
14+
matrix:
15+
include:
16+
# Debian 11
17+
- os: bullseye
18+
image: ghcr.io/dtcooper/raspberrypi-os:python3.12-bullseye
19+
# Debian 12
20+
- os: bookworm
21+
image: ghcr.io/dtcooper/raspberrypi-os:python3.12-bookworm
22+
fail-fast: false
23+
24+
name: Build on ${{ matrix.os }}
25+
container:
26+
image: ${{ matrix.image }}
27+
env:
28+
AWS_KVS_LOG_LEVEL: 2
29+
permissions:
30+
id-token: write
31+
contents: read
32+
steps:
33+
- name: Install dependencies
34+
run: |
35+
apt-get update
36+
apt-get install -y \
37+
automake \
38+
build-essential \
39+
cmake \
40+
git \
41+
gstreamer1.0-plugins-base-apps \
42+
gstreamer1.0-plugins-bad \
43+
gstreamer1.0-plugins-good \
44+
gstreamer1.0-plugins-ugly \
45+
gstreamer1.0-tools \
46+
gstreamer1.0-omx-generic \
47+
libcurl4-openssl-dev \
48+
libgstreamer1.0-dev \
49+
libgstreamer-plugins-base1.0-dev \
50+
liblog4cplus-dev \
51+
libssl-dev \
52+
pkg-config
53+
54+
- name: Checkout repository
55+
uses: actions/checkout@v4
56+
57+
- name: Create build directory
58+
run: mkdir build
59+
60+
- name: Run CMake
61+
working-directory: ./build
62+
run: cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_DEPENDENCIES=OFF -DALIGNED_MEMORY_MODEL=ON
63+
64+
- name: Build
65+
working-directory: ./build
66+
run: make -j$(nproc)
67+
68+
- name: Configure AWS Credentials
69+
uses: aws-actions/configure-aws-credentials@v4
70+
with:
71+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
72+
role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
73+
aws-region: ${{ secrets.AWS_REGION }}
74+
role-duration-seconds: 10800
75+
76+
- name: Run kvssink
77+
working-directory: ./build
78+
run: |
79+
export GST_PLUGIN_PATH=`pwd`
80+
81+
timeout --kill-after=15s 30s \
82+
gst-launch-1.0 -v videotestsrc is-live=true \
83+
! video/x-raw,framerate=10/1,width=640,height=480 \
84+
! clockoverlay time-format="%a %B %d, %Y %I:%M:%S %p" \
85+
! x264enc bframes=0 key-int-max=10 \
86+
! h264parse \
87+
! kvssink stream-name="cpp-producer-rpi-${{ matrix.os }}"
88+
89+
EXIT_CODE=$?
90+
echo "Command exited with code: $EXIT_CODE"
91+
92+
# 0: Process exited by itself before the timeout with code 0
93+
# 1: Process exited by itself before the timeout with code 1
94+
# 143: Process terminated by SIGTERM (expected)
95+
# 137: Process killed by SIGKILL (if the --kill-after timeout is reached)
96+
if [ $EXIT_CODE -ne 143 ]; then
97+
echo "Command did not exit gracefully after interrupt."
98+
exit 1
99+
fi

0 commit comments

Comments
 (0)