Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Zephyr: Get latest version of the zephyr sdk #274

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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://api.github.com/repos/zephyrproject-rtos/sdk-ng/releases/latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will latest ever point to an -rcN release? If so is that a good thing or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will latest ever point to an -rcN release? If so is that a good thing or not?
Yes it could I suppose. The risk is regression. I propose to test it in this way and come back to a hardcoded version in case of issue.

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
Loading