Test Zephyr sample on 3.4.0 and 4.4.0

- add a v4.4.0 matrix leg alongside v3.4.0
- run each leg in the Zephyr CI image with the matching SDK
  (ci:v0.26.4/SDK 0.16.1, ci:v0.29.0/SDK 1.0.0); drops the manual
  deps, west, pip and SDK install steps
- scope twister by --testsuite-root and drop --test: the scenario
  id is path-prefixed on 3.4.0 but bare on 4.x
- replace zip with tar caf logs.tar.xz for the failure-log artifact
pull/1051/head
John Safranek 2026-06-26 13:58:37 -07:00 committed by Aidan Garske
parent 8d97ee9250
commit 7d7bf93e06
1 changed files with 23 additions and 43 deletions

View File

@ -11,36 +11,25 @@ jobs:
run_test:
name: Build and run
strategy:
fail-fast: false
matrix:
config:
# Each leg runs in the Zephyr Project CI image whose bundled SDK
# matches the Zephyr release under test: v0.26.4 ships SDK 0.16.1
# (for Zephyr 3.4.0), v0.29.0 ships SDK 1.0.0 (for Zephyr 4.4.0).
- zephyr-ref: v3.4.0
zephyr-sdk: 0.16.1
docker-image: v0.26.4
- zephyr-ref: v4.4.0
docker-image: v0.29.0
runs-on: ubuntu-22.04
container:
image: ghcr.io/zephyrproject-rtos/ci:${{ matrix.config.docker-image }}
env:
# The Zephyr SDK is preinstalled under /opt/toolchains in the CI image.
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains
# This should be a safe limit for the tests to run.
timeout-minutes: 20
steps:
- name: Install dependencies
run: |
# Don't prompt for anything
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
# most of the ci-base zephyr docker image packages
sudo apt-get install -y zip bridge-utils uml-utilities \
git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget \
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 \
autoconf automake bison build-essential ca-certificates cargo ccache chrpath cmake \
cpio device-tree-compiler dfu-util diffstat dos2unix doxygen file flex g++ gawk gcc \
gcovr git git-core gnupg gperf gtk-sharp2 help2man iproute2 lcov libcairo2-dev \
libglib2.0-dev libgtk2.0-0 liblocale-gettext-perl libncurses5-dev libpcap-dev \
libpopt0 libsdl1.2-dev libsdl2-dev libssl-dev libtool libtool-bin locales make \
net-tools ninja-build openssh-client parallel pkg-config python3-dev python3-pip \
python3-ply python3-setuptools python-is-python3 qemu rsync socat srecord sudo \
texinfo unzip wget ovmf xz-utils
- name: Install west
run: sudo pip install west
- name: Init west workspace
run: west init --mr ${{ matrix.config.zephyr-ref }} zephyr
@ -61,35 +50,26 @@ jobs:
working-directory: zephyr
run: west zephyr-export
- name: Install pip dependencies
working-directory: zephyr
run: sudo pip install -r zephyr/scripts/requirements.txt
- name: Install zephyr SDK
run: |
wget -q https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${{ matrix.config.zephyr-sdk }}/zephyr-sdk-${{ matrix.config.zephyr-sdk }}_linux-x86_64_minimal.tar.xz
tar xf zephyr-sdk-${{ matrix.config.zephyr-sdk }}_linux-x86_64_minimal.tar.xz
cd zephyr-sdk-${{ matrix.config.zephyr-sdk }}
./setup.sh -h -c -t x86_64-zephyr-elf
- name: Run wolfssh tests
id: wolfssh-test
working-directory: zephyr
run: |
./zephyr/scripts/twister --testsuite-root modules/lib/wolfssh --test zephyr/samples/tests/sample.lib.wolfssh_tests -vvv
rm -rf zephyr/twister-out
./zephyr/scripts/twister --testsuite-root modules/lib/wolfssh --test zephyr/samples/tests/sample.lib.wolfssh_nofs_tests -vvv
rm -rf zephyr/twister-out
# Run every scenario discovered under the wolfssh testsuite root.
# Selecting by scenario name with --test is avoided on purpose: the
# scenario id is path-prefixed on older twister (v3.4.0) but bare on
# newer twister (v4.x), so a fixed --test value works on only one of
# the matrix legs. The wolfssh tree defines a single sample.yaml, so
# scoping by --testsuite-root runs exactly our scenarios on both.
./zephyr/scripts/twister --testsuite-root modules/lib/wolfssh -vvv
- name: Zip failure logs
- name: Archive failure logs
if: ${{ failure() && steps.wolfssh-test.outcome == 'failure' }}
run: |
zip -9 -r logs.zip zephyr/twister-out
run: tar caf logs.tar.xz zephyr/twister-out
- name: Upload failure logs
if: ${{ failure() && steps.wolfssh-test.outcome == 'failure' }}
uses: actions/upload-artifact@v7
with:
name: zephyr-client-test-logs
path: logs.zip
name: zephyr-client-test-logs-${{ matrix.config.zephyr-ref }}
path: logs.tar.xz
retention-days: 5