Update github action & workflow to build nrf-connect samples
This commit is contained in:
parent
fc3a0652aa
commit
4a6e3dcec3
6 changed files with 59 additions and 19 deletions
13
.devcontainer/devcontainer.json
Normal file
13
.devcontainer/devcontainer.json
Normal 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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
10
.github/actions/build/Dockerfile
vendored
10
.github/actions/build/Dockerfile
vendored
|
|
@ -1,12 +1,4 @@
|
||||||
FROM debian:bullseye-slim
|
FROM nordicplayground/nrfconnect-sdk:v2.1-branch
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
COPY build.sh /build.sh
|
COPY build.sh /build.sh
|
||||||
|
|
||||||
|
|
|
||||||
8
.github/actions/build/action.yml
vendored
8
.github/actions/build/action.yml
vendored
|
|
@ -1,5 +1,11 @@
|
||||||
name: 'Build'
|
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:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
||||||
|
args:
|
||||||
|
- ${{ inputs.sample-dir }}
|
||||||
|
|
|
||||||
8
.github/actions/build/build.sh
vendored
8
.github/actions/build/build.sh
vendored
|
|
@ -1,10 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eux -o pipefail
|
set -eux -o pipefail
|
||||||
|
|
||||||
export SDK_ROOT=/opt/nRF5_SDK
|
cd "${GITHUB_WORKSPACE}/${1}"
|
||||||
export GNU_INSTALL_ROOT=/usr/bin/
|
|
||||||
|
|
||||||
cd "$GITHUB_WORKSPACE/code/b-parasite"
|
west build --build-dir ./build --pristine --board bparasite_nrf52840
|
||||||
make clean
|
|
||||||
make lint
|
|
||||||
make
|
|
||||||
35
.github/workflows/b-parasite.yml
vendored
35
.github/workflows/b-parasite.yml
vendored
|
|
@ -9,9 +9,38 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Checks format & builds b-parasite's firmware
|
name: Checks format & builds samples
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
- name: Build
|
- 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
|
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
4
code/.clang-format
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
BasedOnStyle: Google
|
||||||
|
ColumnLimit: 0
|
||||||
Loading…
Add table
Reference in a new issue