Skip to content

Zephyr E2E

Zephyr E2E #9

Workflow file for this run

# End-to-end: west build (native_sim) → gdbserver → rsgdb → GDB batch.
# Heavy (west update + first build); runs on path changes, main/develop pushes, schedule, and manual dispatch.
name: Zephyr E2E
on:
workflow_dispatch:
schedule:
- cron: "0 7 * * 1"
push:
branches: [main, develop]
paths:
- ".github/workflows/zephyr-e2e.yml"
- "scripts/e2e_zephyr_native_sim.sh"
- "scripts/zephyr_multi_printf_app/**"
pull_request:
branches: [main, develop]
paths:
- ".github/workflows/zephyr-e2e.yml"
- "scripts/e2e_zephyr_native_sim.sh"
- "scripts/zephyr_multi_printf_app/**"
concurrency:
group: zephyr-e2e-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
ZEPHYR_REF: v4.2.0
ZEPHYR_WORKSPACE: ${{ github.workspace }}/.zephyr-workspace
jobs:
native-sim:
name: native_sim (gdbserver → rsgdb → gdb)
runs-on: ubuntu-latest
timeout-minutes: 90
env:
# Required by Zephyr CMake (host tools + toolchain metadata); matches Zephyr 4.x expectations.
ZEPHYR_SDK_INSTALL_DIR: /home/runner/zephyr-sdk-0.17.4
steps:
- uses: actions/checkout@v4
# Runners are ~14GB; Zephyr west tree + SDK + release+LTO can exhaust disk.
- name: Free disk space (remove unused CI images)
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /usr/local/share/boost
df -h
- name: Install host packages (Zephyr host + gdb stack)
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gcc g++ gcc-multilib g++-multilib \
gdb gdbserver \
git cmake ninja-build gperf ccache \
python3-dev python3-pip python3-setuptools python3-wheel \
wget xz-utils file make \
device-tree-compiler \
libsdl2-dev
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install west (venv)
run: |
python3 -m venv .venv-west
./.venv-west/bin/pip install -U pip
# pyelftools: required by Zephyr build scripts (gen_kobject_list.py imports elftools).
./.venv-west/bin/pip install west pyelftools
echo "${{ github.workspace }}/.venv-west/bin" >> "$GITHUB_PATH"
- uses: dtolnay/rust-toolchain@stable
# Debug build only: release profile uses LTO + huge rmeta intermediates and fills the disk.
- name: Build rsgdb (debug)
env:
CARGO_INCREMENTAL: "0"
run: cargo build --verbose
- name: Cache Zephyr SDK
id: zephyr-sdk-cache
uses: actions/cache@v4
with:
path: /home/runner/zephyr-sdk-0.17.4
key: zephyr-sdk-0.17.4-linux-x64-v1
- name: Install Zephyr SDK
if: steps.zephyr-sdk-cache.outputs.cache-hit != 'true'
run: |
set -euo pipefail
cd /tmp
wget -qO zephyr-sdk.tar.xz \
https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.4/zephyr-sdk-0.17.4_linux-x86_64.tar.xz
tar xf zephyr-sdk.tar.xz -C /home/runner
# CMake finds Zephyr-sdk via ZEPHYR_SDK_INSTALL_DIR (see Zephyr SDK install docs).
- name: Cache Zephyr west workspace
uses: actions/cache@v4
id: zephyr-cache
with:
path: .zephyr-workspace
key: zephyr-ws-${{ env.ZEPHYR_REF }}-${{ runner.os }}-v1
- name: West init and update
run: |
set -euo pipefail
west --version
WS="${{ env.ZEPHYR_WORKSPACE }}"
mkdir -p "$WS"
if [ ! -f "$WS/.west/config" ]; then
cd "$WS"
west init -m https://github.com/zephyrproject-rtos/zephyr --mr "${{ env.ZEPHYR_REF }}" .
else
cd "$WS"
fi
west update
- name: Run Zephyr native_sim E2E
env:
RSGDB: ${{ github.workspace }}/target/debug/rsgdb
run: ./scripts/e2e_zephyr_native_sim.sh