-
Notifications
You must be signed in to change notification settings - Fork 19
141 lines (116 loc) · 3.93 KB
/
linux.yml
File metadata and controls
141 lines (116 loc) · 3.93 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# @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: Linux
concurrency:
group: pr-workflows
cancel-in-progress: false
on:
workflow_call:
inputs:
devcontainer-tag:
description: The container tag to be used
default: latest
required: false
type: string
jobs:
build-and-run-linux:
name: Build and Run
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
- name: Clean workspace
run: find . -name . -o -prune -exec rm -rf -- {} +
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Configure (system tests)
run: mkdir build && cd build && cmake ../tests/system/posix
- name: Build (system tests)
working-directory: build
run: make
- name: Run (system tests)
working-directory: build
run: make run-systests
- name: Delete build directory
run: rm -rf build
- name: Configure (leak checks)
run: mkdir build && cd build && cmake ../tests/leaks
- name: Build and run (leak checks)
working-directory: build
run: make
- 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
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