From 8b0472491c3f2d3f6bf2fd1279efc352e92f1946 Mon Sep 17 00:00:00 2001 From: Matthew Gee Date: Fri, 27 Mar 2026 16:01:49 -0400 Subject: [PATCH 1/3] 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 --- .github/workflows/hardware-rp5.yml | 133 +++++++++++++++++++++++++++++ .github/workflows/main.yml | 8 ++ 2 files changed, 141 insertions(+) create mode 100644 .github/workflows/hardware-rp5.yml diff --git a/.github/workflows/hardware-rp5.yml b/.github/workflows/hardware-rp5.yml new file mode 100644 index 00000000..1d7168aa --- /dev/null +++ b/.github/workflows/hardware-rp5.yml @@ -0,0 +1,133 @@ +# @copyright Copyright (c) contributors to Project Ocre, +# which has been established as Project Ocre a Series of LF Projects, LLC +# +# SPDX-License-Identifier: Apache-2.0 + +name: Hardware Checks (Raspberry Pi 5) + +concurrency: + group: pr-workflows + cancel-in-progress: false + +on: + workflow_call: + + +jobs: + setup-local-runner: + name: Setup local runner + runs-on: "ocre-raspberrypi" + + steps: + - name: Clean other workspace + run: rm -rf ../.west + + - name: Clean workspace + run: find . -name . -o -prune -exec rm -rf -- {} + + + - name: Install Dependencies + run: | + sudo apt update + sudo apt upgrade + sudo apt install --no-install-recommends git cmake ninja-build gperf \ + ccache dfu-util device-tree-compiler wget python3-dev python3-venv python3-tk \ + xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 curl + + - name: Checkout + uses: actions/checkout@v4 + with: + path: ocre-runtime + submodules: true + + - name: Setup Zephyr project + uses: zephyrproject-rtos/action-zephyr-setup@v1 + with: + app-path: ocre-runtime + sdk-version: 0.16.8 + + - name: West Setup + run: | + ls -lah + ls -lah * + west init -l ocre-runtime + west update + west packages pip --install + + build-and-run-linux: + name: Build and Run + runs-on: "ocre-raspberrypi" + steps: + + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + + - name: Delete build directory + run: rm -rf build + + - name: Configure + run: mkdir build && cd build && cmake .. + + - name: Build + working-directory: build + run: make + + - name: Run mini + working-directory: build + run: | + EXPECTED_LOG="powered by Ocre" + echo "Running application..." + stdbuf -oL -eL timeout 20s ./src/samples/mini/posix/ocre_mini | tee linux_run.log + echo "===== Checking for expected log =====" + if grep -q "$EXPECTED_LOG" linux_run.log; then + echo "[OK] Found expected log: $EXPECTED_LOG" + else + echo "[ERROR] Expected log not found: $EXPECTED_LOG" + exit 1 + fi + + - name: Run demo + working-directory: build + run: | + EXPECTED_LOG="Demo completed successfully" + echo "Running application..." + stdbuf -oL -eL timeout 40s ./src/samples/demo/posix/ocre_demo | tee linux_run.log + echo "===== Checking for expected log =====" + if grep -q "$EXPECTED_LOG" linux_run.log; then + echo "[OK] Found expected log: $EXPECTED_LOG" + else + echo "[ERROR] Expected log not found: $EXPECTED_LOG" + exit 1 + fi + + + zephyr-native-sim-build-and-run: + name: Build + runs-on: "ocre-raspberrypi" + strategy: + matrix: + app: + - mini + - demo + + steps: + - name: West build + run: | + source .venv/bin/activate + west build -p always -b native_sim/native/64 ocre-runtime/src/samples/${{ matrix.app }}/zephyr + + - name: Run ${{ matrix.app }} on ${{ matrix.board }} + run: | + EXPECTED_LOG="powered by Ocre" + echo "Running application..." + chmod +x zephyr/zephyr.exe + stdbuf -oL -eL timeout 20s ./zephyr/zephyr.exe | tee zephyr_run.log + echo "===== Checking for expected log =====" + if grep -q "$EXPECTED_LOG" zephyr_run.log; then + echo "[OK] Found expected log: $EXPECTED_LOG" + else + echo "[ERROR] Expected log not found: $EXPECTED_LOG" + exit 1 + fi + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f4ec3196..dda71bad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -81,3 +81,11 @@ jobs: secrets: inherit with: devcontainer-tag: ${{ needs.zephyr-devcontainer.outputs.devcontainer-tag }} + + hardware-raspberry_pi: + name: Hardware Raspberry Pi 5 + needs: + - linux + uses: ./.github/workflows/hardware-rp5.yml + secrets: inherit + \ No newline at end of file From 237ea394053ff592f7077fdf8e7d2e97709f3f29 Mon Sep 17 00:00:00 2001 From: Matthew Gee Date: Tue, 31 Mar 2026 15:37:30 -0400 Subject: [PATCH 2/3] tests_hw: Remove native_sim tests, merge files Removes zephyr native_sim tests as they are redundent in the overall CI pipeline. At this point the Raspberry Pi test file is redundant so removed references to it and added the runner to the linux tests file. Also seperated the test-coverage job from the rest of the Linux tests to prevent this step from being run more than once. Signed-off-by: Matthew Gee --- .github/workflows/hardware-rp5.yml | 71 ----------------------------- .github/workflows/linux.yml | 73 ++++++++++++++++++++---------- .github/workflows/main.yml | 13 +++--- 3 files changed, 55 insertions(+), 102 deletions(-) diff --git a/.github/workflows/hardware-rp5.yml b/.github/workflows/hardware-rp5.yml index 1d7168aa..23129c6b 100644 --- a/.github/workflows/hardware-rp5.yml +++ b/.github/workflows/hardware-rp5.yml @@ -12,47 +12,7 @@ concurrency: on: workflow_call: - jobs: - setup-local-runner: - name: Setup local runner - runs-on: "ocre-raspberrypi" - - steps: - - name: Clean other workspace - run: rm -rf ../.west - - - name: Clean workspace - run: find . -name . -o -prune -exec rm -rf -- {} + - - - name: Install Dependencies - run: | - sudo apt update - sudo apt upgrade - sudo apt install --no-install-recommends git cmake ninja-build gperf \ - ccache dfu-util device-tree-compiler wget python3-dev python3-venv python3-tk \ - xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 curl - - - name: Checkout - uses: actions/checkout@v4 - with: - path: ocre-runtime - submodules: true - - - name: Setup Zephyr project - uses: zephyrproject-rtos/action-zephyr-setup@v1 - with: - app-path: ocre-runtime - sdk-version: 0.16.8 - - - name: West Setup - run: | - ls -lah - ls -lah * - west init -l ocre-runtime - west update - west packages pip --install - build-and-run-linux: name: Build and Run runs-on: "ocre-raspberrypi" @@ -100,34 +60,3 @@ jobs: echo "[ERROR] Expected log not found: $EXPECTED_LOG" exit 1 fi - - - zephyr-native-sim-build-and-run: - name: Build - runs-on: "ocre-raspberrypi" - strategy: - matrix: - app: - - mini - - demo - - steps: - - name: West build - run: | - source .venv/bin/activate - west build -p always -b native_sim/native/64 ocre-runtime/src/samples/${{ matrix.app }}/zephyr - - - name: Run ${{ matrix.app }} on ${{ matrix.board }} - run: | - EXPECTED_LOG="powered by Ocre" - echo "Running application..." - chmod +x zephyr/zephyr.exe - stdbuf -oL -eL timeout 20s ./zephyr/zephyr.exe | tee zephyr_run.log - echo "===== Checking for expected log =====" - if grep -q "$EXPECTED_LOG" zephyr_run.log; then - echo "[OK] Found expected log: $EXPECTED_LOG" - else - echo "[ERROR] Expected log not found: $EXPECTED_LOG" - exit 1 - fi - diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 169c7c82..b90f9b9c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -5,6 +5,10 @@ name: Linux +concurrency: + group: pr-workflows + cancel-in-progress: false + on: workflow_call: inputs: @@ -17,10 +21,13 @@ on: jobs: build-and-run-linux: name: Build and Run - runs-on: ["self-hosted", "build-server"] + runs-on: ${{ matrix.run-target }} container: image: ghcr.io/${{ github.repository }}/devcontainer-linux:${{ inputs.devcontainer-tag }} options: --user 1000:1000 + strategy: + matrix: + run-target: [["self-hosted", "build-server"], ocre-raspberrypi] steps: - name: Clean other workspace run: rm -rf ../.west @@ -57,29 +64,6 @@ jobs: - name: Delete build directory run: rm -rf build - - name: Configure (test coverage) - run: mkdir build && cd build && cmake ../tests/coverage - - - name: Build and run (test coverage) - working-directory: build - run: make coverage report.md - - - name: Upload coverage report - uses: actions/upload-artifact@v4 - with: - name: ocre-coverage - include-hidden-files: true - path: build/coverage - - - name: Report code coverage - uses: marocchino/sticky-pull-request-comment@v3 - with: - GITHUB_TOKEN: ${{ secrets.TOKEN_WRITE_PR }} - path: build/report.md - - - name: Delete build directory - run: rm -rf build - - name: Configure run: mkdir build && cd build && cmake .. @@ -114,3 +98,44 @@ jobs: echo "[ERROR] Expected log not found: $EXPECTED_LOG" exit 1 fi + + post-code-coverage: + name: Post Code Test Coverage + runs-on: ["self-hosted", "build-server"] + container: + image: ghcr.io/${{ github.repository }}/devcontainer-linux:${{ inputs.devcontainer-tag }} + options: --user 1000:1000 + steps: + - name: Clean other workspace + run: rm -rf ../.west + + - name: Clean workspace + run: find . -name . -o -prune -exec rm -rf -- {} + + + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + + - name: Delete build directory + run: rm -rf build + + - name: Configure (test coverage) + run: mkdir build && cd build && cmake ../tests/coverage + + - name: Build and run (test coverage) + working-directory: build + run: make coverage report.md + + - name: Upload coverage report + uses: actions/upload-artifact@v4 + with: + name: ocre-coverage + include-hidden-files: true + path: build/coverage + + - name: Report code coverage + uses: marocchino/sticky-pull-request-comment@v3 + with: + GITHUB_TOKEN: ${{ secrets.TOKEN_WRITE_PR }} + path: build/report.md diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dda71bad..47d67197 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,10 +82,9 @@ jobs: with: devcontainer-tag: ${{ needs.zephyr-devcontainer.outputs.devcontainer-tag }} - hardware-raspberry_pi: - name: Hardware Raspberry Pi 5 - needs: - - linux - uses: ./.github/workflows/hardware-rp5.yml - secrets: inherit - \ No newline at end of file + # hardware-raspberry_pi: + # name: Hardware Raspberry Pi 5 + # # needs: + # # - linux + # uses: ./.github/workflows/hardware-rp5.yml + # secrets: inherit From 60e377497f841024ea488572706339b3c6a7d773 Mon Sep 17 00:00:00 2001 From: Matthew Gee Date: Fri, 1 May 2026 13:49:31 -0400 Subject: [PATCH 3/3] Introduce RaspberryPi runner into linux tests Re-introduced the raspberry pi runner into the linux tests after merging the changes from main. Signed-off-by: Matthew Gee --- .github/workflows/hardware-rp5.yml | 62 ------------------------------ .github/workflows/linux.yml | 52 +++---------------------- .github/workflows/main.yml | 7 ---- 3 files changed, 5 insertions(+), 116 deletions(-) delete mode 100644 .github/workflows/hardware-rp5.yml diff --git a/.github/workflows/hardware-rp5.yml b/.github/workflows/hardware-rp5.yml deleted file mode 100644 index 23129c6b..00000000 --- a/.github/workflows/hardware-rp5.yml +++ /dev/null @@ -1,62 +0,0 @@ -# @copyright Copyright (c) contributors to Project Ocre, -# which has been established as Project Ocre a Series of LF Projects, LLC -# -# SPDX-License-Identifier: Apache-2.0 - -name: Hardware Checks (Raspberry Pi 5) - -concurrency: - group: pr-workflows - cancel-in-progress: false - -on: - workflow_call: - -jobs: - build-and-run-linux: - name: Build and Run - runs-on: "ocre-raspberrypi" - steps: - - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - - - name: Delete build directory - run: rm -rf build - - - name: Configure - run: mkdir build && cd build && cmake .. - - - name: Build - working-directory: build - run: make - - - name: Run mini - working-directory: build - run: | - EXPECTED_LOG="powered by Ocre" - echo "Running application..." - stdbuf -oL -eL timeout 20s ./src/samples/mini/posix/ocre_mini | tee linux_run.log - echo "===== Checking for expected log =====" - if grep -q "$EXPECTED_LOG" linux_run.log; then - echo "[OK] Found expected log: $EXPECTED_LOG" - else - echo "[ERROR] Expected log not found: $EXPECTED_LOG" - exit 1 - fi - - - name: Run demo - working-directory: build - run: | - EXPECTED_LOG="Demo completed successfully" - echo "Running application..." - stdbuf -oL -eL timeout 40s ./src/samples/demo/posix/ocre_demo | tee linux_run.log - echo "===== Checking for expected log =====" - if grep -q "$EXPECTED_LOG" linux_run.log; then - echo "[OK] Found expected log: $EXPECTED_LOG" - else - echo "[ERROR] Expected log not found: $EXPECTED_LOG" - exit 1 - fi diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 7b0ba02d..b63301a2 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -5,10 +5,6 @@ name: Linux -concurrency: - group: pr-workflows - cancel-in-progress: false - on: workflow_call: inputs: @@ -17,13 +13,16 @@ on: default: latest required: false type: string - jobs: build-and-run-linux: + strategy: + matrix: + runner: [ubuntu-24.04, raspberrypi-runner] name: Build and Run - runs-on: ubuntu-24.04 + runs-on: ${{matrix.runner}} container: image: ghcr.io/${{ github.repository }}/devcontainer-linux:${{ inputs.devcontainer-tag }} + options: ${{matrix.options}} steps: - name: Clean other workspace run: rm -rf ../.west @@ -121,44 +120,3 @@ jobs: echo "[ERROR] Expected log not found: $EXPECTED_LOG" exit 1 fi - - post-code-coverage: - name: Post Code Test Coverage - runs-on: ["self-hosted", "build-server"] - container: - image: ghcr.io/${{ github.repository }}/devcontainer-linux:${{ inputs.devcontainer-tag }} - options: --user 1000:1000 - steps: - - name: Clean other workspace - run: rm -rf ../.west - - - name: Clean workspace - run: find . -name . -o -prune -exec rm -rf -- {} + - - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - - - name: Delete build directory - run: rm -rf build - - - name: Configure (test coverage) - run: mkdir build && cd build && cmake ../tests/coverage - - - name: Build and run (test coverage) - working-directory: build - run: make coverage report.md - - - name: Upload coverage report - uses: actions/upload-artifact@v4 - with: - name: ocre-coverage - include-hidden-files: true - path: build/coverage - - - name: Report code coverage - uses: marocchino/sticky-pull-request-comment@v3 - with: - GITHUB_TOKEN: ${{ secrets.TOKEN_WRITE_PR }} - path: build/report.md diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 073f78f7..8a17f4a3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -83,10 +83,3 @@ jobs: secrets: inherit with: devcontainer-tag: ${{ needs.zephyr-devcontainer.outputs.devcontainer-tag }} - - # hardware-raspberry_pi: - # name: Hardware Raspberry Pi 5 - # # needs: - # # - linux - # uses: ./.github/workflows/hardware-rp5.yml - # secrets: inherit