Skip to content

Commit

Permalink
CI: Zephyr: Get latest version of the zephyr sdk
Browse files Browse the repository at this point in the history
To avoid having any misalignment between Zephyr and the SDK during
CI tests, consider getting the latest version of the Zephyr SDK
automatically instead of hardcoding it.
This approach should ensure that the latest version of sdk is always used.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
  • Loading branch information
arnopo committed Oct 27, 2023
1 parent 6b8f773 commit bc7d382
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/actions/build_ci/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
readonly TARGET="$1"

ZEPHYR_TOOLCHAIN_VARIANT=zephyr
ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk
ZEPHYR_SDK_VERSION=0.16.1
ZEPHYR_SDK_DOWNLOAD_FOLDER=https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v$ZEPHYR_SDK_VERSION
ZEPHYR_SDK_SETUP_DIR=zephyr-sdk-$ZEPHYR_SDK_VERSION
ZEPHYR_SDK_SETUP_TAR=${ZEPHYR_SDK_SETUP_DIR}_linux-x86_64.tar.xz
ZEPHYR_SDK_DOWNLOAD_URL=$ZEPHYR_SDK_DOWNLOAD_FOLDER/$ZEPHYR_SDK_SETUP_TAR
ZEPHYR_SDK_API_FOLDER=https://github.com/gitapi/repos/zephyrproject-rtos/sdk-ng/releases/latest
ZEPHYR_SDK_SETUP_TAR=zephyr-sdk-.*linux-x86_64.tar.xz

FREERTOS_ZIP_URL=https://cfhcable.dl.sourceforge.net/project/freertos/FreeRTOS/V10.0.1/FreeRTOSv10.0.1.zip

Expand All @@ -17,7 +13,7 @@ pre_build(){
echo 'Etc/UTC' > /etc/timezone &&
ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime &&
apt update &&
apt-get install -y make || exit 1
apt-get install -y make curl || exit 1
sudo pip3 install cmake || exit 1
}

Expand Down Expand Up @@ -57,6 +53,10 @@ build_freertos(){
}

build_zephyr(){
ZEPHYR_SDK_DOWNLOAD_URL=`curl -s ${ZEPHYR_SDK_API_FOLDER} | \
grep -e "browser_download_url.*${ZEPHYR_SDK_SETUP_TAR}"| cut -d : -f 2,3 | tr -d \"`
ZEPHYR_SDK_TAR=`basename $ZEPHYR_SDK_DOWNLOAD_URL`
ZEPHYR_SDK_SETUP_DIR=`echo $ZEPHYR_SDK_TAR | cut -d_ -f1`
echo " Build for Zephyr OS "
sudo apt-get install -y git cmake ninja-build gperf || exit 1
sudo apt-get install -y ccache dfu-util device-tree-compiler wget pv || exit 1
Expand All @@ -71,9 +71,9 @@ build_zephyr(){
source ~/.bashrc

wget $ZEPHYR_SDK_DOWNLOAD_URL --dot-style=giga || exit 1
echo "Extracting $ZEPHYR_SDK_SETUP_TAR"
pv $ZEPHYR_SDK_SETUP_TAR -i 3 -ptebr -f | tar xJ || exit 1
rm -rf $ZEPHYR_SDK_INSTALL_DIR || exit 1
echo "Extracting $ZEPHYR_SDK_TAR"
pv $ZEPHYR_SDK_TAR -i 3 -ptebr -f | tar xJ || exit 1
rm -rf $ZEPHYR_SDK_TAR || exit 1
yes | ./$ZEPHYR_SDK_SETUP_DIR/setup.sh || exit 1
west init ./zephyrproject || exit 1
cd ./zephyrproject || exit 1
Expand Down

0 comments on commit bc7d382

Please sign in to comment.