ci(zephyr): run the Zephyr tests with twister

Build the Zephyr port and run its tests in QEMU on every pull request. The Zephyr setup action creates the west workspace and installs the Zephyr SDK, in the version required by the Zephyr release PX4 is pinned to, so that updating Zephyr only takes a change to platforms/zephyr/west.yml. Ninja, which the runner image lacks, is installed from apt. The port builds most of the platform and uORB code, so changes outside platforms/zephyr can break it too.

Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This commit is contained in:
Benjamin Cabé authored and Ramon Roche committed 2026-11-30 11:57:50 -08:00
1 parent 7f30b83084
commit 250b9b7e28
1 file changed
+59
+59
View File
@@ -0,0 +1,59 @@
name: Zephyr
permissions:
contents: read
on:
push:
branches:
- 'main'
paths-ignore:
- 'docs/**'
pull_request:
branches:
- '**'
paths-ignore:
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
twister:
name: Twister
runs-on: [runs-on,runner=4cpu-linux-x64,image=ubuntu24-full-x64,"run-id=${{ github.run_id }}",spot=false]
steps:
- uses: runs-on/action@v2
- uses: actions/checkout@v6
with:
path: PX4-Autopilot
fetch-depth: 1
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install Ninja
run: sudo apt-get update && sudo apt-get install -y ninja-build
- name: Set up the west workspace and the Zephyr SDK
uses: zephyrproject-rtos/action-zephyr-setup@v1
with:
app-path: PX4-Autopilot
manifest-file-name: platforms/zephyr/west.yml
toolchains: arm-zephyr-eabi
- name: Run twister
run: west twister -T PX4-Autopilot/platforms/zephyr -p mps2/an386 --inline-logs
- name: Upload twister results
if: failure()
uses: actions/upload-artifact@v7
with:
name: twister-out
path: |
twister-out/twister.json
twister-out/**/build.log
twister-out/**/handler.log
retention-days: 7