-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add raspberry pi checks to the CI #1222
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Build and test on Virtualized Raspberry Pi OS | ||
|
||
on: | ||
push: | ||
branches: [ master, develop ] | ||
pull_request: | ||
branches: [ master, develop ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
permissions: | ||
id-token: write | ||
contents: read | ||
strategy: | ||
matrix: | ||
include: | ||
# Debian 11 | ||
- os: bullseye | ||
image: ghcr.io/dtcooper/raspberrypi-os:python3.12-bullseye | ||
# Debian 12 | ||
- os: bookworm | ||
image: ghcr.io/dtcooper/raspberrypi-os:python3.12-bookworm | ||
fail-fast: false | ||
|
||
name: Build on ${{ matrix.os }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | ||
role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }} | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
role-duration-seconds: 10800 | ||
|
||
- name: Build and Test | ||
env: | ||
AWS_KVS_LOG_LEVEL: 2 | ||
run: | | ||
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace \ | ||
-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY \ | ||
-e AWS_SESSION_TOKEN -e AWS_REGION -e AWS_KVS_LOG_LEVEL \ | ||
--platform linux/arm64 \ | ||
${{ matrix.image }} \ | ||
/bin/bash -c ' | ||
set -ex | ||
apt-get update | ||
apt-get install -y automake build-essential cmake git \ | ||
gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad \ | ||
gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly \ | ||
gstreamer1.0-tools gstreamer1.0-omx-generic \ | ||
libcurl4-openssl-dev libgstreamer1.0-dev \ | ||
libgstreamer-plugins-base1.0-dev liblog4cplus-dev \ | ||
libssl-dev pkg-config | ||
|
||
mkdir -p build | ||
cd build | ||
|
||
cmake .. -DBUILD_GSTREAMER_PLUGIN=ON -DBUILD_DEPENDENCIES=OFF -DALIGNED_MEMORY_MODEL=ON | ||
make -j$(nproc) | ||
|
||
export GST_PLUGIN_PATH=$(pwd) | ||
|
||
set +e # Disable exit on error for the timeout command | ||
timeout --preserve-status --signal=SIGINT --kill-after=15s 30s \ | ||
gst-launch-1.0 -v videotestsrc is-live=true \ | ||
! video/x-raw,framerate=10/1,width=640,height=480 \ | ||
! clockoverlay time-format="%a %B %d, %Y %I:%M:%S %p" \ | ||
! x264enc bframes=0 key-int-max=10 tune=zerolatency \ | ||
! h264parse \ | ||
! kvssink stream-name="cpp-producer-rpi-${{ matrix.os }}" | ||
EXIT_CODE=$? | ||
set -e # Re-enable exit on error | ||
|
||
# 0: Process exited after interrupt with code 0 | ||
# 1: Process exited with error code 1 | ||
# 137: Process killed by SIGKILL (if the --kill-after timeout is reached) | ||
echo "Command exited with code: $EXIT_CODE" | ||
if [ $EXIT_CODE -ne 0 ]; then | ||
echo "Command did not exit gracefully after interrupt." | ||
exit 1 | ||
fi | ||
' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not immediately required for this CR but is something to consider for the future: It would be worth checking if we remove the toolchain after the build has completed successfully.