Skip to content

Commit

Permalink
workflow: Create basic build of rust samples
Browse files Browse the repository at this point in the history
Build the rust code samples to make sure that Rust support is working on
all supported targets.  This adds toolchain support and rust target
support for the supported Cortex-M, and RISC-V targets.

The workflow runs on every pull request and on every push.

Signed-off-by: David Brown <[email protected]>
  • Loading branch information
d3zd3z committed Sep 12, 2024
1 parent 07c6e41 commit 013c5dd
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright (c) 2024 Linaro LTD
# SPDX-License-Identifier: Apache-2.0

name: Build

# Build the rust samples and tests using the current Zephyr.

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: zephyr-rust-lang

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Setup Zephyr project
uses: zephyrproject-rtos/action-zephyr-setup@v1
with:
app-path: zephyr-rust-lang
manifest-file-name: ci-manifest.yml
toolchains: arm-zephyr-eabi:riscv64-zephyr-elf

- name: Install Rust Targets
shell: bash
run: |
rustup target add riscv32i-unknown-none-elf
rustup target add riscv64imac-unknown-none-elf
rustup target add thumbv6m-none-eabi
rustup target add thumbv7em-none-eabi
rustup target add thumbv7m-none-eabi
rustup target add thumbv8m.main-none-eabi
- name: Build firmware
working-directory: zephyr-rust-lang
shell: bash
run: |
cargo --version
west twister -T samples -v --inline-logs --integration
22 changes: 22 additions & 0 deletions ci-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2021 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

# Although this normally lives as a module, the local CI uses action-zephyr-setup which wants the
# application to have a manifest.

manifest:
remotes:
- name: zephyrproject-rtos
url-base: https://github.com/zephyrproject-rtos

projects:
- name: zephyr
remote: zephyrproject-rtos
revision: main
import:
# By using name-allowlist we can clone only the modules that are
# strictly needed by the application.
name-allowlist:
- cmsis # required by the ARM port
- hal_nordic # required by the custom_plank board (Nordic based)
- hal_stm32 # required by the nucleo_f302r8 board (STM32 based)

0 comments on commit 013c5dd

Please sign in to comment.