From 250b9b7e289239ed98507762c8efc4e1056e54e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Sat, 10 Oct 2026 05:38:16 +0000 Subject: [PATCH] ci(zephyr): run the Zephyr tests with twister MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é --- .github/workflows/zephyr.yml | 59 ++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/zephyr.yml diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml new file mode 100644 index 00000000000..e3a5adce693 --- /dev/null +++ b/.github/workflows/zephyr.yml @@ -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