forked from project-ocre/ocre-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (104 loc) · 3.42 KB
/
Copy pathzephyr.yml
File metadata and controls
118 lines (104 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# @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: Zephyr
on:
workflow_call:
inputs:
devcontainer-tag:
description: The container tag to be used
default: latest
required: false
type: string
jobs:
build-zephyr:
name: Build
runs-on: ubuntu-24.04
container:
image: ghcr.io/${{ github.repository }}/devcontainer-zephyr:${{ inputs.devcontainer-tag }}
strategy:
matrix:
board:
- pico_plus2/rp2350b/m33
- native_sim/native/64
- b_u585i_iot02a
app:
- mini
- demo
- supervisor
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
path: ocre-runtime
submodules: true
- name: Configure git safe directory
run: git config --global --add safe.directory "$GITHUB_WORKSPACE/ocre-runtime"
- name: West init
run: |
. /opt/zephyr-venv/bin/activate
west init -l ocre-runtime
- name: West update
run: |
. /opt/zephyr-venv/bin/activate
west update
- name: West build
run: |
. /opt/zephyr-venv/bin/activate
west build -p always -b ${{ matrix.board }} ocre-runtime/src/samples/${{ matrix.app }}/zephyr
- name: Set sane board name
run: |
BOARD=${{ matrix.board }}
echo "BOARD_NAME=$(printf "%s\n" "$BOARD" | tr / _)" >> $GITHUB_ENV
- name: Upload build artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ocre-zephyr-${{ env.BOARD_NAME }}-${{ matrix.app }}
include-hidden-files: true
path: |
build/zephyr/zephyr.elf
build/zephyr/zephyr.exe
build/zephyr/zephyr.bin
build/zephyr/zephyr.dts
build/zephyr/.config
build/flash.bin
run-zephyr:
name: Run
needs: build-zephyr
runs-on: ubuntu-24.04
container:
image: ghcr.io/${{ github.repository }}/devcontainer-zephyr:${{ inputs.devcontainer-tag }}
strategy:
matrix:
board:
- native_sim/native/64
app:
- mini
- demo
steps:
- name: Set sane board name
run: |
BOARD=${{ matrix.board }}
echo "BOARD_NAME=$(printf "%s\n" "$BOARD" | tr / _)" >> $GITHUB_ENV
- name: Download build artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8
with:
name: ocre-zephyr-${{ env.BOARD_NAME }}-${{ matrix.app }}
- 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