diff --git a/.github/workflows/hardware-rp5.yml b/.github/workflows/hardware-rp5.yml new file mode 100644 index 00000000..23129c6b --- /dev/null +++ b/.github/workflows/hardware-rp5.yml @@ -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 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 f4ec3196..47d67197 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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