Skip to content

Commit 196b343

Browse files
committed
zephyr: rework zephyr workflow
Drop usage of docker-run.sh in favor of using runs-on: container: image: which is the correct approach for github workflows. Signed-off-by: Mateusz Redzynia <mateuszx.redzynia@intel.com>
1 parent 1abbfc6 commit 196b343

1 file changed

Lines changed: 44 additions & 57 deletions

File tree

.github/workflows/zephyr.yml

Lines changed: 44 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ name: Zephyr
77
# yamllint disable-line rule:truthy
88
on: [push, pull_request, workflow_dispatch, workflow_call]
99

10+
defaults:
11+
run:
12+
shell: bash
13+
1014
# Specifies group name that stops previous wokrflows if the name matches
1115
concurrency:
1216
# eg. "Zephyr-pull_request-my_fork_branch_to_merge"
@@ -15,18 +19,19 @@ concurrency:
1519
cancel-in-progress: true
1620

1721
jobs:
18-
1922
manifest-check:
2023
runs-on: ubuntu-latest
24+
container:
25+
image: thesofproject/zephyr-lite:v0.28.4-rc3
2126
steps:
2227
- uses: actions/checkout@v4
2328
with:
24-
path: ./workspace/sof
29+
path: sof
2530
filter: 'tree:0'
2631

2732
- name: plain west update
33+
working-directory: sof
2834
run: |
29-
3035
: This plain 'west update' does not provide 100% certainty that
3136
: all the manifest revisions make sense but it is quick and
3237
: will catch many revision problems. Other jobs typically
@@ -35,8 +40,6 @@ jobs:
3540
: is useful for testing unmerged Zephyr commits but risks
3641
: accepting "invalid" ones, this will not.
3742
38-
pip3 install west
39-
cd workspace/sof/
4043
west init -l
4144
west update --fetch-opt=--filter=tree:0
4245
@@ -45,9 +48,8 @@ jobs:
4548
# XTOS submodules and... temporarily break every CI, which is why
4649
# it hasn't been done yet.
4750
- name: git submodules consistency
51+
working-directory: sof
4852
run: |
49-
50-
cd workspace/sof
5153
git submodule update --init --recursive
5254
5355
west update
@@ -66,40 +68,36 @@ jobs:
6668
# job will be disappear, folded back in the regular build-* jobs below.
6769
LP64-WIP:
6870
runs-on: ubuntu-22.04
71+
container:
72+
image: thesofproject/zephyr-lite:v0.28.4-rc3
6973

7074
steps:
7175
- uses: actions/checkout@v4
7276
with:
73-
path: ./workspace/sof
77+
path: sof
7478
filter: 'tree:0'
7579

76-
- name: free space
80+
- name: west update
81+
working-directory: sof
7782
run: |
78-
sudo rm -rf /usr/share/dotnet
79-
sudo rm -rf /opt/ghc
80-
81-
- name: west clones
82-
run: pip3 install west && cd workspace/sof/ && west init -l &&
83-
west update --narrow --fetch-opt=--filter=tree:0
83+
west init -l
84+
west update --narrow --fetch-opt=--filter=tree:0
8485
85-
# Not strictly necessary but saves a lot of scrolling in the next step
86-
# Caching a 12G image is unfortunately not possible:
87-
# https://github.com/ScribeMD/docker-cache/issues/304
88-
# For faster builds we would have to pay for some persistent runners.
89-
- name: Download docker image && ls /opt/toolchains/
90-
run: cd workspace && ./sof/zephyr/docker-run.sh ls -l /opt/toolchains/
86+
- name: print all available sdks in /opt/toolchains/
87+
run: |
88+
ls -l /opt/toolchains/
9189
9290
- name: 64 bits build
9391
run: |
94-
cd workspace && ./sof/zephyr/docker-run.sh /bin/sh -c \
95-
'ln -s /opt/toolchains/zephyr-sdk-* ~/;
96-
west build --board imx93_evk/mimx9352/a55 sof/app \
97-
-- -DEXTRA_CFLAGS=-Werror -DEXTRA_CXXFLAGS=-Werror \
98-
-DEXTRA_AFLAGS=-Werror'
99-
92+
ln -s /opt/toolchains/zephyr-sdk-* ~/
93+
west build --board imx93_evk/mimx9352/a55 sof/app \
94+
-- -DEXTRA_CFLAGS=-Werror -DEXTRA_CXXFLAGS=-Werror \
95+
-DEXTRA_AFLAGS=-Werror
10096
10197
build-linux:
10298
runs-on: ubuntu-22.04
99+
container:
100+
image: thesofproject/zephyr-lite:v0.28.4-rc3
103101
strategy:
104102
fail-fast: false
105103
matrix:
@@ -143,20 +141,15 @@ jobs:
143141
with:
144142
fetch-depth: 0
145143
filter: 'tree:0'
146-
path: ./workspace/sof
144+
path: sof
147145

148-
- name: free space
146+
- name: west update
147+
working-directory: sof
149148
run: |
150-
sudo rm -rf /usr/share/dotnet
151-
sudo rm -rf /opt/ghc
152-
153-
- name: west clones
154-
155-
run: pip3 install west && cd workspace/sof/ && west init -l &&
156-
time west update --narrow --fetch-opt=--filter=tree:0
149+
west init -l
150+
west update --narrow --fetch-opt=--filter=tree:0
157151
158152
- name: select zephyr revision
159-
working-directory: ${{ github.workspace }}/workspace
160153
run: |
161154
if [ 'mnfst' = '${{ matrix.zephyr_revision }}' ]; then
162155
rem_rev=$(git -C zephyr rev-parse HEAD)
@@ -175,7 +168,7 @@ jobs:
175168
# Get some tags to fix `git describe` hence BUILD_VERSION, etc.
176169
# Keep in sync with build-windows below
177170
- name: Fetch tags for git describe
178-
working-directory: ${{ github.workspace }}/workspace/zephyr
171+
working-directory: zephyr
179172
run: |
180173
# Because we used git tricks to speed things up, we now have two git
181174
# problems:
@@ -205,25 +198,19 @@ jobs:
205198
git describe --long --always --dirty
206199
git describe --long --always --dirty --tags
207200
208-
# Not strictly necessary but saves a lot of scrolling in the next step
209-
# Caching a 12G image is unfortunately not possible:
210-
# https://github.com/ScribeMD/docker-cache/issues/304
211-
# For faster builds we would have to pay for some persistent runners.
212-
- name: Download docker image && ls /opt/toolchains/
213-
run: cd workspace && ./sof/zephyr/docker-run.sh ls -l /opt/toolchains/
201+
- name: print all available sdks in /opt/toolchains/
202+
run: |
203+
ls -l /opt/toolchains/
214204
215-
# https://github.com/zephyrproject-rtos/docker-image
216-
# Note: env variables can be passed to the container with
217-
# -e https_proxy=...
218205
- name: build
219-
run: cd workspace && ./sof/zephyr/docker-run.sh
220-
./sof/zephyr/docker-build.sh --cmake-args=-DEXTRA_CFLAGS=-Werror
221-
--cmake-args=-DEXTRA_CXXFLAGS=-Werror
222-
--cmake-args=-DEXTRA_AFLAGS='-Werror -Wa,--fatal-warnings'
223-
--cmake-args=--warn-uninitialized
224-
--overlay=sof/app/configs/repro-build.conf
225-
--no-tarball
226-
${{ matrix.build_opts }} ${{ matrix.IPC_platforms }}
206+
run: |
207+
./sof/zephyr/docker-build.sh --cmake-args=-DEXTRA_CFLAGS=-Werror \
208+
--cmake-args=-DEXTRA_CXXFLAGS=-Werror \
209+
--cmake-args=-DEXTRA_AFLAGS='-Werror -Wa,--fatal-warnings' \
210+
--cmake-args=--warn-uninitialized \
211+
--overlay=sof/app/configs/repro-build.conf \
212+
--no-tarball \
213+
${{ matrix.build_opts }} ${{ matrix.IPC_platforms }}
227214
228215
- name: Upload build artifacts
229216
uses: actions/upload-artifact@v4
@@ -232,8 +219,8 @@ jobs:
232219
name: linux-build ${{ matrix.build_opts }} ${{ matrix.IPC_platforms }}
233220
if-no-files-found: error
234221
path: |
235-
${{ github.workspace }}/workspace/build-sof-staging
236-
${{ github.workspace }}/workspace/**/compile_commands.json
222+
build-sof-staging
223+
./**/compile_commands.json
237224
238225
build-windows:
239226
runs-on: windows-latest

0 commit comments

Comments
 (0)