Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/hardware-rp5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# @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
73 changes: 49 additions & 24 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

name: Linux

concurrency:
group: pr-workflows
cancel-in-progress: false

on:
workflow_call:
inputs:
Expand All @@ -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
Expand Down Expand Up @@ -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 ..

Expand Down Expand Up @@ -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
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,10 @@ 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
Loading