forked from project-ocre/ocre-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (90 loc) · 3.08 KB
/
linux.yml
File metadata and controls
110 lines (90 loc) · 3.08 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
# @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
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: ["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: 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 (source coverage)
run: mkdir build && cd build && cmake ../tests/coverage
- name: Build and run (source coverage)
working-directory: build
run: make
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: ocre-coverage
include-hidden-files: true
path: build/report
- 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