GitHub Action
Zephyr West
A GitHub Action to allow performing actions using the west build tool.
The action includes the necessary SDK and dependencies to perform builds of Zephyr RTOS applications as well.
In order to properly have the full West workspace be contained within the GitHub Actions workspace, this action requires
that the Zephyr application itself be in a toplevel subdirectory of the GitHub repository, e.g. under app/
.
The west command to run, e.g. init
or build
.
Extra parameters/arguments to pass to the west command.
The following example assumes a git repository with the Zephyr application
placed in the app/
subdirectory, and demonstrates initalizing, updating, and
then building the application using west. This also includes caching of the
key module directories that are created in the workspace by west:
jobs:
build:
runs-on: ubuntu-latest
name: Build Test
steps:
# To use this repository's private action,
# you must check out the repository
- name: Checkout
uses: actions/checkout@v2
- name: Cache west modules
uses: actions/cache@v2
env:
cache-name: cache-zephyr-modules
with:
path: |
modules/
tools/
zephyr/
bootloader/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('app/west.yml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: West Init
uses: zmkfirmware/[email protected]
id: west-init
with:
command: 'init'
command-args: '-l app'
- name: West Update
uses: zmkfirmware/[email protected]
id: west-update
with:
command: 'update'
- name: West Config Zephyr Base
uses: zmkfirmware/[email protected]
id: west-config
with:
command: 'config'
command-args: '--global zephyr.base-prefer configfile'
- name: West Zephyr Export
uses: zmkfirmware/[email protected]
id: west-zephyr-export
with:
command: 'zephyr-export'
- name: West Build
uses: zmkfirmware/[email protected]
id: west-build
with:
command: 'build'
command-args: '-s app'