mirror of https://github.com/thesofproject/sof.git
113 lines
4.1 KiB
YAML
113 lines
4.1 KiB
YAML
---
|
|
|
|
name: Zephyr
|
|
|
|
# 'workflow_dispatch' allows running this workflow manually from the
|
|
# 'Actions' tab
|
|
# yamllint disable-line rule:truthy
|
|
on: [push, pull_request, workflow_dispatch]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# Using groups to avoid spamming the small results box with too
|
|
# many lines. Pay attention to COMMAS.
|
|
IPC_platforms: [
|
|
# - IPC3 default
|
|
apl cnl,
|
|
icl jsl,
|
|
tgl tgl-h,
|
|
imx8 imx8x imx8m,
|
|
# - IPC4 default
|
|
mtl,
|
|
# Very few IPC3 platforms support IPC4 too.
|
|
-i IPC4 tgl,
|
|
]
|
|
zephyr_revision: [
|
|
manifest_revision,
|
|
"https://github.com/zephyrproject-rtos/zephyr main",
|
|
]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
# From time to time this will catch a git tag and change SOF_VERSION
|
|
with:
|
|
fetch-depth: 10
|
|
path: ./workspace/sof
|
|
|
|
- name: west clones
|
|
run: pip3 install west && cd workspace/sof/ && west init -l &&
|
|
west update --narrow --fetch-opt=--depth=5
|
|
|
|
- name: select zephyr revision
|
|
run: cd workspace/zephyr/ &&
|
|
if [ 'manifest_revision' != '${{ matrix.zephyr_revision }}' ]; then
|
|
git fetch --depth 5 ${{ matrix.zephyr_revision }} &&
|
|
git checkout FETCH_HEAD;
|
|
fi &&
|
|
git log --oneline -n 5 --decorate --graph --no-abbrev-commit
|
|
|
|
# https://github.com/zephyrproject-rtos/docker-image
|
|
# Note: env variables can be passed to the container with
|
|
# -e https_proxy=...
|
|
- name: build
|
|
run: cd workspace && ./sof/zephyr/docker-run.sh
|
|
./sof/zephyr/docker-build.sh --cmake-args=-DEXTRA_CFLAGS=-Werror
|
|
--cmake-args=--warn-uninitialized ${{ matrix.IPC_platforms }}
|
|
|
|
|
|
# As of sparse commit ce1a6720f69e / Sept 2022, the exit status of
|
|
# sparse.c is an unusable mess and always zero in practice. Moreover
|
|
# SOF has hundreds of sparse warnings right now. So fail only on a
|
|
# small subset of specific warnings defined in
|
|
# sof/scripts/parse_sparse_output.sh
|
|
sparse-subset:
|
|
runs-on: ubuntu-22.04
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platforms: [
|
|
{platform: tgl,
|
|
real_cc: xtensa-intel_s1000_zephyr-elf/bin/xtensa-intel_s1000_zephyr-elf-gcc},
|
|
# This is the WRONG compiler for MTL but for now this is the
|
|
# one and only one expected by the Zephyr build system so it
|
|
# must be set to this value to sparse MTL.
|
|
# Sparse needs a REAL_CC but it does not matter which one, it
|
|
# does not affect sparse results.
|
|
# As soon as sof/west.yml is updated to a fixed Zephyr version
|
|
# this will fail with an error message that will show the
|
|
# exact value that must replace this one.
|
|
{platform: mtl,
|
|
real_cc: xtensa-intel_s1000_zephyr-elf/bin/xtensa-intel_s1000_zephyr-elf-gcc},
|
|
]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
# From time to time this will catch a git tag and change SOF_VERSION
|
|
with:
|
|
fetch-depth: 10
|
|
path: ./workspace/sof
|
|
|
|
- name: west clones
|
|
run: pip3 install west && cd workspace/sof/ && west init -l &&
|
|
west update --narrow --fetch-opt=--depth=5
|
|
|
|
# We have to painfully extract REAL_CC from the docker image to
|
|
# tell the Zephyr build what it... already knows and wants!! Zephyr
|
|
# commit 3ebb18b8826 explains this sparse problem.
|
|
- name: build
|
|
working-directory: ./workspace
|
|
run: |
|
|
./sof/zephyr/docker-run.sh /bin/sh -c \
|
|
'cmake -P ./sof/zephyr/FindZephyr-sdk.cmake > zsdk_location'
|
|
cat zsdk_location
|
|
ZSDK=$(cat zsdk_location); _RCC=${{ matrix.platforms.real_cc }}
|
|
REAL_CC="$ZSDK/$_RCC" ./sof/zephyr/docker-run.sh \
|
|
./sof/zephyr/docker-build.sh ${{ matrix.platforms.platform }} \
|
|
--cmake-args=-DSPARSE=y | ./sof/scripts/parse_sparse_output.sh
|