Skip to content

Build Zephyr binaries #1

Build Zephyr binaries

Build Zephyr binaries #1

Workflow file for this run

# Copyright (c) 2023 Golioth, Inc.
# SPDX-License-Identifier: Apache-2.0
name: Build Zephyr binaries
on:
workflow_dispatch:
inputs:
ZEPHYR_SDK:
required: true
type: string
default: 0.16.3
BOARD:
required: true
type: string
default: aludel_mini_v1_sparkfun9160_ns
ARTIFACT:
required: true
type: boolean
default: false
TAG:
type: string
workflow_call:
inputs:
ZEPHYR_SDK:
required: true
type: string
BOARD:
required: true
type: string
ARTIFACT:
required: true
type: boolean
TAG:
type: string
jobs:
build:
runs-on: ubuntu-latest
container: golioth/golioth-zephyr-base:${{ inputs.ZEPHYR_SDK }}-SDK-v0
env:
ZEPHYR_SDK_INSTALL_DIR: /opt/toolchains/zephyr-sdk-${{ inputs.ZEPHYR_SDK }}
steps:
- name: Setup West workspace
run: |
west init -m https://github.com/$GITHUB_REPOSITORY .
west update --narrow -o=--depth=1
west zephyr-export
pip3 install -r deps/zephyr/scripts/requirements-base.txt
# Needed for TF-M
pip3 install cryptography pyasn1 pyyaml cbor>=1.0.0 imgtool>=1.9.0 jinja2 click
- name: Build with West
run: |
west build -p -b ${{ inputs.BOARD }} app -- -DCONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION=\"0.0.0\"
- name: Prepare artifacts
if: inputs.ARTIFACT == true && inputs.TAG != ''
run: |
cd build/zephyr
mkdir -p artifacts
mv merged.hex ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${{ inputs.BOARD }}_full.hex
mv app_update.bin ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${{ inputs.BOARD }}_update.bin
mv zephyr.elf ./artifacts/golioth-${{ github.event.repository.name }}_${{ inputs.TAG }}_${{ inputs.BOARD }}.elf
# Run IDs are unique per repo but are reused on re-runs
- name: Save artifact
if: inputs.ARTIFACT == true
uses: actions/upload-artifact@v3
with:
name: build_artifacts_${{ github.run_id }}
path: |
build/zephyr/artifacts/*