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: Do Zephyr build tests on known good and latest versions #307

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
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
16 changes: 13 additions & 3 deletions .github/actions/build_ci/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

readonly TARGET="$1"

# Known good version for PR testing
ZEPHYR_SDK_VERSION=v0.16.8
ZEPHYR_VERSION=v3.7.0

ZEPHYR_TOOLCHAIN_VARIANT=zephyr
ZEPHYR_SDK_API_FOLDER=https://api.github.com/repos/zephyrproject-rtos/sdk-ng/releases/latest
ZEPHYR_SDK_API_FOLDER=https://api.github.com/repos/zephyrproject-rtos/sdk-ng/releases
ZEPHYR_SDK_VER_SELECT="tags/$ZEPHYR_SDK_VERSION"
ZEPHYR_SDK_SETUP_TAR=zephyr-sdk-.*linux-x86_64.tar.xz

FREERTOS_ZIP_URL=https://sourceforge.net/projects/freertos/files/FreeRTOS/V10.0.1/FreeRTOSv10.0.1.zip
Expand Down Expand Up @@ -61,7 +66,7 @@ build_freertos(){
}

build_zephyr(){
ZEPHYR_SDK_DOWNLOAD_URL=`curl -s ${ZEPHYR_SDK_API_FOLDER} | \
ZEPHYR_SDK_DOWNLOAD_URL=`curl -s ${ZEPHYR_SDK_API_FOLDER}/${ZEPHYR_SDK_VER_SELECT} | \
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`
Expand All @@ -82,7 +87,7 @@ build_zephyr(){
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
west init --mr $ZEPHYR_VERSION ./zephyrproject || exit 1
cd ./zephyrproject || exit 1
west update --narrow || exit 1
west zephyr-export || exit 1
Expand Down Expand Up @@ -144,6 +149,11 @@ main(){
if [[ "$TARGET" == "zephyr" ]]; then
build_zephyr
fi
if [[ "$TARGET" == "zephyr-latest" ]]; then
ZEPHYR_SDK_VER_SELECT=latest
ZEPHYR_VERSION=main
build_zephyr
fi
}

main
15 changes: 12 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
name: check builds on different platforms
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: build for Linux
id: build_linux
uses: ./.github/actions/build_ci
Expand All @@ -38,7 +38,16 @@ jobs:
uses: ./.github/actions/build_ci
with:
target: freertos
- name: build for Zephyr

# Break the zephyr builds into their own job as the common runner was
# running out of space when runs were together
# Also, as the longest running jobs, this allows them to run in ||
zephyr_build_known_good_version:
name: Zephyr build with a version that is known to work
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: build for Zephyr (Known Good)
id: build_Zephyr
uses: ./.github/actions/build_ci
with:
Expand All @@ -48,7 +57,7 @@ jobs:
name: nonreg tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: configure
run: |
sudo apt-get update && sudo apt-get install libsysfs-dev
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/heathcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2024 Linaro Limited.

# The focus of this flow is to check for external changes that will effect
# the project. Even if no code changes are happening, changes in external
# distros or projects can invalidate our work and this flow lets us know

name: libmetal Heath Check

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
paths-ignore:
- docs/**

# Allows you to run this workflow manually from the Actions tab or gh API
workflow_dispatch:

# run weekly on Sunday at 5:10 AM UTC (9:10 PM US western)
schedule:
- cron: '10 5 * * 0'
Copy link
Contributor

Choose a reason for hiding this comment

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

question: what happen if it fails. A message is sent on the mailing list, or do we have to check action result each week?


jobs:
zephyr_build_main:
name: 'Zephyr build from latest on main'
runs-on: ubuntu-latest
arnopo marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v4
- name: Zephyr Latest
id: build_Zephyr_latest
uses: ./.github/actions/build_ci
with:
target: zephyr-latest
Loading