add files
This commit is contained in:
parent
962b2babf4
commit
7c3fd20b4f
42
Dockerfile
Normal file
42
Dockerfile
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
FROM ubuntu:22.04 as base
|
||||||
|
WORKDIR /workdir
|
||||||
|
|
||||||
|
ARG sdk_version=v2.3.0
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get upgrade -y && \
|
||||||
|
apt-get -y install wget unzip
|
||||||
|
|
||||||
|
# Install toolchain
|
||||||
|
# Make nrfutil install in a shared location, because when used with GitHub
|
||||||
|
# Actions, the image will be launched with the home dir mounted from the local
|
||||||
|
# checkout.
|
||||||
|
ENV NRFUTIL_HOME=/usr/local/share/nrfutil
|
||||||
|
RUN wget -q https://developer.nordicsemi.com/.pc-tools/nrfutil/x64-linux/nrfutil && \
|
||||||
|
mv nrfutil /usr/local/bin && \
|
||||||
|
chmod +x /usr/local/bin/nrfutil && \
|
||||||
|
nrfutil install toolchain-manager && \
|
||||||
|
nrfutil install toolchain-manager search && \
|
||||||
|
nrfutil toolchain-manager install --ncs-version ${sdk_version} && \
|
||||||
|
nrfutil toolchain-manager list
|
||||||
|
|
||||||
|
#
|
||||||
|
# ClangFormat
|
||||||
|
#
|
||||||
|
RUN apt-get -y install clang-format && \
|
||||||
|
wget -qO- https://raw.githubusercontent.com/nrfconnect/sdk-nrf/${sdk_version}/.clang-format > /workdir/.clang-format
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Prepare image with a ready to use build environment
|
||||||
|
SHELL ["nrfutil","toolchain-manager","launch","/bin/bash","--","-c"]
|
||||||
|
RUN west init -m https://github.com/nrfconnect/sdk-nrf --mr ${sdk_version} . && \
|
||||||
|
west update --narrow -o=--depth=1
|
||||||
|
|
||||||
|
# Launch into build environment with the passed arguments
|
||||||
|
# Currently this is not supported in GitHub Actions
|
||||||
|
# See https://github.com/actions/runner/issues/1964
|
||||||
|
ENTRYPOINT [ "nrfutil", "toolchain-manager", "launch", "/bin/bash", "--", "/root/entrypoint.sh" ]
|
||||||
|
COPY ./entrypoint.sh /root/entrypoint.sh
|
17
action.yml
Normal file
17
action.yml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
name: 'NRF Connect SDK'
|
||||||
|
description: 'Building nrf connect sdk projects'
|
||||||
|
inputs:
|
||||||
|
board: # id of input
|
||||||
|
description: 'Board for build'
|
||||||
|
required: true
|
||||||
|
build_dir:
|
||||||
|
description: 'Building directory'
|
||||||
|
required: true
|
||||||
|
default: 'build'
|
||||||
|
runs:
|
||||||
|
using: 'docker'
|
||||||
|
image: 'Dockerfile'
|
||||||
|
args:
|
||||||
|
- west
|
||||||
|
- build
|
||||||
|
- --board nrf52833dk_nrf52833
|
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
nrf:
|
||||||
|
container_name: nrf
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
args:
|
||||||
|
- sdk_version=v2.3.0
|
||||||
|
|
||||||
|
|
5
entrypoint.sh
Normal file
5
entrypoint.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
. /workdir/zephyr/zephyr-env.sh
|
||||||
|
|
||||||
|
exec $@
|
Loading…
Reference in New Issue
Block a user