Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
play

GitHub Action

Zephyr West

v0.2.0

Zephyr West

play

Zephyr West

Action incorporating Zephyr dependencies and West build tool

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Zephyr West

uses: zmkfirmware/[email protected]

Learn more about this action in zmkfirmware/zephyr-west-action

Choose a version

Zephyr West Github Action

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.

Directory Layout Requirement

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/.

Inputs

command

The west command to run, e.g. init or build.

command-args

Extra parameters/arguments to pass to the west command.

Example

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'