Skip to content

Commit 35cb52c

Browse files
committed
Add raspberry pi checks to the CI
1 parent 7acf272 commit 35cb52c

File tree

1 file changed

+87
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)