1---
2# Tools that can save round-trips to github and a lot of time:
3#
4# yamllint -f parsable pull_request.yml
5# pip3 install ruamel.yaml.cmd
6# yaml merge-expand pull_request.yml exp.yml &&
7#    diff -w -u pull_request.yml exp.yml
8#
9# github.com also has a powerful web editor that can be used without
10# committing.
11
12# This is the name of this workflow and should technically be called
13# something like "Main Workflow" but the place where most people see
14# this name is the Checks window next to other, non-github checks.
15name: GitHub Actions
16
17# yamllint disable-line rule:truthy
18on:
19  push:
20    branches:
21      - 'main'
22      - 'stable-**'
23      - '**-stable'
24  pull_request:
25    branches:
26      - 'main'
27      - 'stable-**'
28      - '**-stable'
29
30  # Allows you to run this workflow manually from the Actions tab
31  workflow_dispatch:
32
33# Some jobs may not need submodules but for now our CMakeLists.txt
34# systemically downloads them anyway when missing at build time. Easier
35# and cleaner to clone everything at once.
36
37jobs:
38
39  doxygen:
40    runs-on: ubuntu-20.04
41
42    steps:
43      - uses: actions/checkout@v2
44
45      - name: apt get doxygen graphviz
46        run: sudo apt-get -y install ninja-build doxygen graphviz
47
48      - name: list all warnings, warnings are not failures
49        run: cmake -GNinja -S doc -B docbuild && ninja -C docbuild -v doc
50
51      # Build again (it's very quick) so warnings don't go unnoticed
52      - name: fail and stop on first warning
53        run: printf 'WARN_AS_ERROR = YES\n' >> doc/sof.doxygen.in &&
54          ninja -C docbuild -v doc
55
56
57  testbench:
58    runs-on: ubuntu-20.04
59
60    steps:
61      - uses: actions/checkout@v2
62        with: {fetch-depth: 0, submodules: recursive}
63
64      - name: docker
65        run: docker pull thesofproject/sof && docker tag thesofproject/sof sof
66
67      # testbench needs some topologies
68      - name: build topologies
69        run: ./scripts/docker-run.sh ./scripts/build-tools.sh -t
70      - name: build testbench
71        run: ./scripts/docker-run.sh ./scripts/rebuild-testbench.sh
72      - name: test
73        run: ./scripts/host-testbench.sh
74
75
76  gcc-build-only:
77    runs-on: ubuntu-20.04
78
79    strategy:
80      matrix:
81        platform: [sue jsl tgl]
82
83    steps:
84
85      - uses: actions/checkout@v2
86        with: {fetch-depth: 0, submodules: recursive}
87
88      - name: docker
89        run: docker pull thesofproject/sof && docker tag thesofproject/sof sof
90
91      - name: xtensa-build-all
92        env:
93          PLATFORM: ${{ matrix.platform }}
94        run: ./scripts/docker-run.sh
95          ./scripts/xtensa-build-all.sh -r ${PLATFORM}
96
97  # Warning: there is a fair amount of duplication between 'build-only'
98  # and 'qemu-boot' because github does not support YAML anchors as of Jan
99  # 2021.  Defining our new actions would be overkill. Another popular
100  # option is to generate this file from a source with YAML anchors
101  # before committing it; also deemed overkill for the current amount of
102  # duplication.
103
104  qemu-boot-test:
105    runs-on: ubuntu-20.04
106
107    strategy:
108      matrix:
109        # Compiler-based grouping, see HOST= in xtensa-build-all.sh The
110        # only reason for grouping is to avoid the matrix swarming the
111        # user interface and burying other checks.
112        platform: [imx8 imx8x imx8m,
113                   byt cht, bdw hsw, apl skl kbl, cnl icl]
114
115    steps:
116
117      - uses: actions/checkout@v2
118        with: {fetch-depth: 0, submodules: recursive}
119
120      - name: turn off HAVE_AGENT
121        run: echo CONFIG_HAVE_AGENT=n >
122          src/arch/xtensa/configs/override/no-agent.config
123
124      - name: docker SOF
125        run: docker pull thesofproject/sof && docker tag thesofproject/sof sof
126
127      - name: xtensa-build-all -o no-agent
128        env:
129          PLATFORM: ${{ matrix.platform }}
130        run: ./scripts/docker-run.sh
131          ./scripts/xtensa-build-all.sh -o no-agent -r ${PLATFORM}
132
133      - name: docker QEMU
134        run: docker pull thesofproject/sofqemu &&
135          docker tag thesofproject/sofqemu sofqemu
136
137      - name: qemu-check
138        env:
139          PLATFORM: ${{ matrix.platform }}
140        run: ./scripts/docker-qemu.sh
141          ../sof.git/scripts/qemu-check.sh ${PLATFORM}
142