Skip to content

Commit cf987e4

Browse files
committed
workflow: Add minimal Zephyr unit tests workflow for SOF CI
This commit introduces a basic GitHub Actions workflow to establish the foundation for running SOF unit tests that have been ported from cmocka to Zephyr ztest framework. The workflow currently includes: - Basic checkout step with proper fetch depth and tree filtering - West initialization and workspace setup - Environment verification step for debugging This is the first iteration of the workflow, designed to validate the basic environment setup before implementing the full test execution pipeline. The workflow will be expanded in subsequent commits to include: - Zephyr SDK installation - Complete environment configuration - Unit test compilation and execution using west twister - Test result collection and reporting Testing approach: - Triggers only on pull requests for safe testing - Minimal resource usage during initial validation - Debug output to verify workspace structure The workflow follows SOF CI patterns and prepares the groundwork for integrating ztest unit tests into the continuous integration pipeline. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent f7724e4 commit cf987e4

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
name: "Unit tests (Zephyr ztest)"
3+
on:
4+
pull_request:
5+
branches:
6+
- 'main'
7+
8+
permissions:
9+
contents: read
10+
11+
# Specifies group name that stops previous workflows if the name matches
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
zephyr-utests:
18+
name: SOF CI Unit Tests
19+
runs-on: ubuntu-22.04
20+
timeout-minutes: 10
21+
22+
steps:
23+
- name: Checkout SOF repository
24+
uses: actions/checkout@v4
25+
with:
26+
path: ./workspace/sof
27+
fetch-depth: 2
28+
filter: 'tree:0'
29+
30+
- name: West update
31+
run: |
32+
cd workspace/sof
33+
pip3 install west
34+
west init -l
35+
west update --narrow --fetch-opt=--filter=tree:0
36+
37+
- name: Install Python dependencies
38+
run: |
39+
cd workspace
40+
pip3 install --user -r zephyr/scripts/requirements.txt
41+
42+
- name: Install Zephyr SDK
43+
run: |
44+
cd workspace/zephyr
45+
west sdk install --version 0.16.9 -t x86_64
46+
47+
- name: Build and run unit tests
48+
run: |
49+
cd workspace
50+
echo "pwd: $(pwd)"
51+
echo "ls -l:"
52+
ls -l
53+
west twister --testsuite-root sof/test/ztest/unit/ --platform native_sim --verbose \
54+
--inline-logs
55+
echo "End"

0 commit comments

Comments
 (0)