Skip to content

Commit 8b04724

Browse files
committed
tests_hw: GHA introduce Raspberry PI runner
Adds additional tests utilizing the Raspberry PI 5 runner. Currently tests run are mostly a copy of current Linux and native_sim tests but these will be expanded upon in future commits. Signed-off-by: Matthew Gee <mgee@iol.unh.edu>
1 parent 370dc77 commit 8b04724

2 files changed

Lines changed: 141 additions & 0 deletions

File tree

.github/workflows/hardware-rp5.yml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# @copyright Copyright (c) contributors to Project Ocre,
2+
# which has been established as Project Ocre a Series of LF Projects, LLC
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
name: Hardware Checks (Raspberry Pi 5)
7+
8+
concurrency:
9+
group: pr-workflows
10+
cancel-in-progress: false
11+
12+
on:
13+
workflow_call:
14+
15+
16+
jobs:
17+
setup-local-runner:
18+
name: Setup local runner
19+
runs-on: "ocre-raspberrypi"
20+
21+
steps:
22+
- name: Clean other workspace
23+
run: rm -rf ../.west
24+
25+
- name: Clean workspace
26+
run: find . -name . -o -prune -exec rm -rf -- {} +
27+
28+
- name: Install Dependencies
29+
run: |
30+
sudo apt update
31+
sudo apt upgrade
32+
sudo apt install --no-install-recommends git cmake ninja-build gperf \
33+
ccache dfu-util device-tree-compiler wget python3-dev python3-venv python3-tk \
34+
xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 curl
35+
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
with:
39+
path: ocre-runtime
40+
submodules: true
41+
42+
- name: Setup Zephyr project
43+
uses: zephyrproject-rtos/action-zephyr-setup@v1
44+
with:
45+
app-path: ocre-runtime
46+
sdk-version: 0.16.8
47+
48+
- name: West Setup
49+
run: |
50+
ls -lah
51+
ls -lah *
52+
west init -l ocre-runtime
53+
west update
54+
west packages pip --install
55+
56+
build-and-run-linux:
57+
name: Build and Run
58+
runs-on: "ocre-raspberrypi"
59+
steps:
60+
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
with:
64+
submodules: true
65+
66+
- name: Delete build directory
67+
run: rm -rf build
68+
69+
- name: Configure
70+
run: mkdir build && cd build && cmake ..
71+
72+
- name: Build
73+
working-directory: build
74+
run: make
75+
76+
- name: Run mini
77+
working-directory: build
78+
run: |
79+
EXPECTED_LOG="powered by Ocre"
80+
echo "Running application..."
81+
stdbuf -oL -eL timeout 20s ./src/samples/mini/posix/ocre_mini | tee linux_run.log
82+
echo "===== Checking for expected log ====="
83+
if grep -q "$EXPECTED_LOG" linux_run.log; then
84+
echo "[OK] Found expected log: $EXPECTED_LOG"
85+
else
86+
echo "[ERROR] Expected log not found: $EXPECTED_LOG"
87+
exit 1
88+
fi
89+
90+
- name: Run demo
91+
working-directory: build
92+
run: |
93+
EXPECTED_LOG="Demo completed successfully"
94+
echo "Running application..."
95+
stdbuf -oL -eL timeout 40s ./src/samples/demo/posix/ocre_demo | tee linux_run.log
96+
echo "===== Checking for expected log ====="
97+
if grep -q "$EXPECTED_LOG" linux_run.log; then
98+
echo "[OK] Found expected log: $EXPECTED_LOG"
99+
else
100+
echo "[ERROR] Expected log not found: $EXPECTED_LOG"
101+
exit 1
102+
fi
103+
104+
105+
zephyr-native-sim-build-and-run:
106+
name: Build
107+
runs-on: "ocre-raspberrypi"
108+
strategy:
109+
matrix:
110+
app:
111+
- mini
112+
- demo
113+
114+
steps:
115+
- name: West build
116+
run: |
117+
source .venv/bin/activate
118+
west build -p always -b native_sim/native/64 ocre-runtime/src/samples/${{ matrix.app }}/zephyr
119+
120+
- name: Run ${{ matrix.app }} on ${{ matrix.board }}
121+
run: |
122+
EXPECTED_LOG="powered by Ocre"
123+
echo "Running application..."
124+
chmod +x zephyr/zephyr.exe
125+
stdbuf -oL -eL timeout 20s ./zephyr/zephyr.exe | tee zephyr_run.log
126+
echo "===== Checking for expected log ====="
127+
if grep -q "$EXPECTED_LOG" zephyr_run.log; then
128+
echo "[OK] Found expected log: $EXPECTED_LOG"
129+
else
130+
echo "[ERROR] Expected log not found: $EXPECTED_LOG"
131+
exit 1
132+
fi
133+

.github/workflows/main.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,11 @@ jobs:
8181
secrets: inherit
8282
with:
8383
devcontainer-tag: ${{ needs.zephyr-devcontainer.outputs.devcontainer-tag }}
84+
85+
hardware-raspberry_pi:
86+
name: Hardware Raspberry Pi 5
87+
needs:
88+
- linux
89+
uses: ./.github/workflows/hardware-rp5.yml
90+
secrets: inherit
91+

0 commit comments

Comments
 (0)