Update github action & workflow to build nrf-connect samples

This commit is contained in:
rbaron 2022-11-28 19:44:41 +01:00
parent fc3a0652aa
commit 4a6e3dcec3
6 changed files with 59 additions and 19 deletions

View file

@ -0,0 +1,13 @@
{
"name": "nrf-connect:v2.1",
"image": "nordicplayground/nrfconnect-sdk:v2.1-branch",
"features": {
},
"customizations": {
"vscode": {
"extensions": [
"nordic-semiconductor.nrf-connect"
]
}
}
}

View file

@ -1,12 +1,4 @@
FROM debian:bullseye-slim
RUN apt-get update && \
apt-get -y install wget tar unzip make clang-format gcc-arm-none-eabi
RUN cd /opt && \
wget https://www.nordicsemi.com/-/media/Software-and-other-downloads/SDKs/nRF5/Binaries/nRF5SDK1702d674dde.zip -O nRF5_SDK.zip && \
unzip nRF5_SDK.zip && \
mv nRF5_SDK_17.0.2_d674dde nRF5_SDK
FROM nordicplayground/nrfconnect-sdk:v2.1-branch
COPY build.sh /build.sh

View file

@ -1,5 +1,11 @@
name: 'Build'
description: 'Builds b-parasite firmware'
description: 'Builds a nrf-connect sample for b-parasite'
inputs:
sample-dir:
description: 'Sample directory to build'
required: true
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.sample-dir }}

View file

@ -1,10 +1,6 @@
#!/bin/bash
set -eux -o pipefail
export SDK_ROOT=/opt/nRF5_SDK
export GNU_INSTALL_ROOT=/usr/bin/
cd "${GITHUB_WORKSPACE}/${1}"
cd "$GITHUB_WORKSPACE/code/b-parasite"
make clean
make lint
make
west build --build-dir ./build --pristine --board bparasite_nrf52840

View file

@ -9,9 +9,38 @@ on:
jobs:
build:
runs-on: ubuntu-latest
name: Checks format & builds b-parasite's firmware
name: Checks format & builds samples
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
uses: actions/checkout@v3
- name: Run clang-format style check
uses: jidicula/clang-format-action@v4.9.0
with:
check-path: 'code/nrf-connect'
# Builds and upload blinky.hex.
- name: Build the blinky sample
uses: ./.github/actions/build
with:
sample-dir: code/nrf-connect/samples/blinky
- uses: actions/upload-artifact@v3
with:
name: blinky
path: code/nrf-connect/samples/blinky/build/zephyr/zephyr.hex
# Builds and upload soil_read_loop.hex.
- name: Build the soil_read_loop sample
uses: ./.github/actions/build
with:
sample-dir: code/nrf-connect/samples/soil_read_loop
- uses: actions/upload-artifact@v3
with:
name: soil_read_loop
path: code/nrf-connect/samples/soil_read_loop/build/zephyr/zephyr.hex
# Builds and upload ble.hex.
- name: Build the ble sample
uses: ./.github/actions/build
with:
sample-dir: code/nrf-connect/samples/ble
- uses: actions/upload-artifact@v3
with:
name: ble
path: code/nrf-connect/samples/ble/build/zephyr/zephyr.hex

4
code/.clang-format Normal file
View file

@ -0,0 +1,4 @@
---
BasedOnStyle: Google
ColumnLimit: 0