forked from thesofproject/sof
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (57 loc) · 2.54 KB
/
sparse-zephyr.yml
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
---
name: Sparse Zephyr
# 'workflow_dispatch' allows running this workflow manually from the
# 'Actions' tab
# yamllint disable-line rule:truthy
on: [push, pull_request, workflow_dispatch, workflow_call]
jobs:
# 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
warnings-subset:
# We're sharing the sparse binary with the zephyr-build container so keep
# this in sync with it.
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
platform: [tgl, mtl, lnl]
steps:
- name: git clone sparse analyzer
uses: actions/checkout@v3
with:
fetch-depth: 10
# TODO: switch to thesofproject/sparse
repository: marc-hb/sparse
path: workspace/sparse
- name: build sparse analyzer
run: cd workspace/sparse && make -j4
- name: git clone sof
uses: actions/checkout@v3
# 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
# Not strictly necessary but saves a lot of scrolling in the next step
# Caching a 12G image is unfortunately not possible:
# https://github.com/ScribeMD/docker-cache/issues/304
# For faster builds we would have to pay for some persistent runners.
- name: Download docker image && ls /opt/toolchains/
run: cd workspace && ./sof/zephyr/docker-run.sh ls -l /opt/toolchains/
# --pristine is important to reproduce _warnings_. It makes no
# difference for github but it's useful for anyone trying to
# reproduce and copying the command from the logs.
- name: analyze zephyr
working-directory: ./workspace
run: |
./sof/zephyr/docker-run.sh \
./sof/zephyr/docker-build.sh ${{ matrix.platform }} \
--cmake-args=-DZEPHYR_SCA_VARIANT=sparse --cmake-args=-DCONFIG_LOG_USE_VLA=n \
--pristine 2>&1 | tee _.log
printf '\n\n\t\t\t ---- Messages below are treated as sparse errors --- \n\n\n'
(set -x; ./sof/scripts/parse_sparse_output.sh ${{ matrix.platforms.platform }} <_.log)