Skip to content

Commit 99912a4

Browse files
committed
Refactor CI job to decompose test steps into reusable script functions
1 parent 71a1983 commit 99912a4

File tree

2 files changed

+38
-14
lines changed

2 files changed

+38
-14
lines changed

.ci/scripts/zephyr-utils.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
download_arm_zephyr_sdk () {
9+
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.0/zephyr-sdk-0.16.0_linux-x86_64.tar.xz
10+
tar -xf zephyr-sdk-0.16.0_linux-x86_64.tar.xz
11+
rm -f zephyr-sdk-0.16.0_linux-x86_64.tar.xz
12+
}
13+
14+
setup_zephyr_et_module () {
15+
git clone --branch executorch-module-integration https://github.com/BujSet/zephyr.git
16+
west init -l zephyr
17+
west config manifest.project-filter -- +executorch
18+
west -v update
19+
}

.github/workflows/trunk.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,31 +74,36 @@ jobs:
7474
conda activate "${CONDA_ENV}"
7575
7676
source .ci/scripts/utils.sh
77+
source .ci/scripts/zephyr-utils.sh
7778
mkdir -p zephyr_scratch/
7879
cd zephyr_scratch
7980
export ZEPHYR_PROJ_ROOT=$(realpath $(pwd))
8081
81-
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.0/zephyr-sdk-0.16.0_linux-x86_64.tar.xz
82-
tar -xf zephyr-sdk-0.16.0_linux-x86_64.tar.xz
83-
rm -f zephyr-sdk-0.16.0_linux-x86_64.tar.xz
84-
cd zephyr-sdk-0.16.0/
85-
./setup.sh -c -t arm-zephyr-eabi
82+
download_arm_zephyr_sdk
83+
./zephyr-sdk-0.16.0/setup.sh -c -t arm-zephyr-eabi
84+
85+
#wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.0/zephyr-sdk-0.16.0_linux-x86_64.tar.xz
86+
#tar -xf zephyr-sdk-0.16.0_linux-x86_64.tar.xz
87+
#rm -f zephyr-sdk-0.16.0_linux-x86_64.tar.xz
88+
#cd zephyr-sdk-0.16.0/
89+
#./setup.sh -c -t arm-zephyr-eabi
8690
8791
cd $ZEPHYR_PROJ_ROOT
88-
git clone https://github.com/BujSet/zephyr.git
89-
cd zephyr/
90-
git switch -c executorch-module-integration origin/executorch-module-integration
91-
cd $ZEPHYR_PROJ_ROOT
92-
west init -l zephyr
93-
west config manifest.project-filter -- +executorch
94-
west -v update
92+
setup_zephyr_et_module
93+
#git clone https://github.com/BujSet/zephyr.git
94+
#cd zephyr/
95+
#git switch -c executorch-module-integration origin/executorch-module-integration
96+
#cd $ZEPHYR_PROJ_ROOT
97+
#west init -l zephyr
98+
#west config manifest.project-filter -- +executorch
99+
#west -v update
95100
96101
cd $ZEPHYR_PROJ_ROOT/modules/lib/executorch
97102
install_executorch "--use-pt-pinned-commit"
98103
.ci/scripts/setup-arm-baremetal-tools.sh --target-toolchain zephyr
99104
source examples/arm/ethos-u-scratch/setup_path.sh
100-
cd $ZEPHYR_PROJ_ROOT
101-
source zephyr/zephyr-env.sh
105+
#cd $ZEPHYR_PROJ_ROOT
106+
source $ZEPHYR_PROJ_ROOT/zephyr/zephyr-env.sh
102107
cd $ZEPHYR_PROJ_ROOT/zephyr/samples/modules/executorch/arm/hello_world
103108
west build -p always -b mps3/corstone300/fvp
104109
FVP_Corstone_SSE-300_Ethos-U55 -a build/zephyr/zephyr.elf -C mps3_board.visualisation.disable-visualisation=1 -C mps3_board.telnetterminal0.start_telnet=0 -C mps3_board.uart0.out_file='sim.out' -C cpu0.CFGITCMSZ=15 -C cpu0.CFGDTCMSZ=15 --simlimit 60

0 commit comments

Comments
 (0)