Merge pull request #48 from umts/sntp-changes #64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
workflow_call: | |
inputs: | |
release_build: | |
description: 'Is this build for release?' | |
type: boolean | |
workflow_dispatch: | |
inputs: | |
release_build: | |
description: 'Is this build for release?' | |
type: boolean | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
ZEPHYR_SDK_INSTALL_PATH: /opt/toolchains | |
ZSDK_VERSION: 0.17.0 | |
container: | |
image: ghcr.io/zephyrproject-rtos/ci-base:main | |
env: | |
ZEPHYR_TOOLCHAIN_VARIANT: zephyr | |
ZEPHYR_SDK_INSTALL_DIR: ${ZEPHYR_SDK_INSTALL_PATH}/zephyr-sdk-${ZSDK_VERSION} | |
PKG_CONFIG_PATH: /usr/lib/i386-linux-gnu/pkgconfig | |
OVMF_FD_PATH: /usr/share/ovmf/OVMF.fd | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
## The ci-base image now takes care of this, but doesn't allow minimal install ## | |
- name: Make ZEPHYR_SDK_INSTALL_PATH | |
run: mkdir -p ${ZEPHYR_SDK_INSTALL_PATH} | |
- name: Download Zephyr SDK minimal | |
run: wget -nv https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/zephyr-sdk-${ZSDK_VERSION}_linux-x86_64_minimal.tar.xz | |
- name: Extract Zephyr SDK minimal | |
run: | | |
tar -xf zephyr-sdk-${ZSDK_VERSION}_linux-x86_64_minimal.tar.xz -C ${ZEPHYR_SDK_INSTALL_PATH}/ | |
rm zephyr-sdk-${ZSDK_VERSION}_linux-x86_64_minimal.tar.xz | |
- name: Download arm-zephyr-eabi toolchain | |
run: wget -nv ${WGET_ARGS} https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/toolchain_linux-x86_64_arm-zephyr-eabi.tar.xz | |
- name: Extract arm-zephyr-eabi toolchain | |
run: | | |
tar -xf toolchain_linux-x86_64_arm-zephyr-eabi.tar.xz -C ${ZEPHYR_SDK_INSTALL_PATH}/zephyr-sdk-${ZSDK_VERSION}/ | |
rm toolchain_linux-x86_64_arm-zephyr-eabi.tar.xz | |
- name: Run Zephyr SDK setup script | |
run: | | |
cd ${ZEPHYR_SDK_INSTALL_PATH} | |
zephyr-sdk-${ZSDK_VERSION}/setup.sh -h -c | |
- name: Restore west cache | |
id: west-cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
bootloader/ | |
modules/ | |
nrf/ | |
nrfxlib/ | |
pcf85063a/ | |
zephyr/ | |
key: ${{ runner.os }}-west-cache-${{ hashFiles('app/west.yml') }} | |
- name: West update | |
run: west update | |
- name: Update Python dependencies | |
run: | | |
pip install --no-cache-dir -r zephyr/scripts/requirements-base.txt | |
pip install --no-cache-dir -r zephyr/scripts/requirements-extras.txt | |
pip install --no-cache-dir -r nrf/scripts/requirements.txt | |
pip install --no-cache-dir -r bootloader/mcuboot/scripts/requirements.txt | |
- name: Create west cache | |
if: steps.west-cache.outputs.cache-hit != 'true' | |
uses: actions/cache/save@v4 | |
with: | |
path: | | |
bootloader/ | |
modules/ | |
nrf/ | |
nrfxlib/ | |
pcf85063a/ | |
zephyr/ | |
key: ${{ runner.os }}-west-cache-${{ hashFiles('app/west.yml') }} | |
- name: Add secret key files | |
if: ${{ inputs.release_build }} | |
env: | |
BOOT_ECDSA_P256: ${{ secrets.BOOT_ECDSA_P256 }} | |
run: | | |
mkdir ./app/keys/private/ | |
echo "$BOOT_ECDSA_P256" >> ./app/keys/private/boot-ecdsa-p256.pem | |
- name: Mark mounted git repositories as trusted | |
run: git config --global --add safe.directory '*' | |
- name: Build Zephyr app test | |
if: ${{ !inputs.release_build }} | |
env: | |
BOARD: circuitdojo_feather/nrf9160/ns | |
run: west build --sysbuild ./app -p -- -DCMAKE_BUILD_TYPE=Release | |
- name: Build Zephyr app for release | |
if: ${{ inputs.release_build }} | |
env: | |
BOARD: circuitdojo_feather/nrf9160/ns | |
run: west build --sysbuild ./app -p -- -DFILE_SUFFIX=release -DCMAKE_BUILD_TYPE=Release | |
- name: Extract branch name | |
run: echo "BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV | |
- name: Upload merged.hex | |
if: ${{ inputs.release_build }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.BRANCH }}_merged.hex | |
path: build/merged.hex | |
- name: Upload zephyr.signed.bin | |
if: ${{ inputs.release_build }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.BRANCH }}_zephyr.signed.bin | |
path: build/app/zephyr/zephyr.signed.bin |