mirror of
https://github.com/embedd-actions/nrf-connect-sdk-ci.git
synced 2024-12-26 17:02:24 +03:00
add files
This commit is contained in:
parent
8f082dbe0f
commit
d84ad915b7
78
Dockerfile
Normal file
78
Dockerfile
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
FROM debian:stable-slim
|
||||||
|
|
||||||
|
#ARG ARCH=amd64
|
||||||
|
ARG NRF_CONNECT_TAG=v2.3.0
|
||||||
|
# For new versions - xz
|
||||||
|
ARG ZEPHYR_ARCHIVE_EXTENSION=gz
|
||||||
|
# Should be for selected NRF_CONNECT_TAG
|
||||||
|
ENV ZEPHYR_TAG=0.15.2
|
||||||
|
|
||||||
|
RUN ARCH="$(dpkg --print-architecture)" && \
|
||||||
|
case $ARCH in \
|
||||||
|
"amd64") \
|
||||||
|
ZEPHYR_ARCH="x86_64" \
|
||||||
|
;; \
|
||||||
|
"arm64") \
|
||||||
|
ZEPHYR_ARCH="aarch64" \
|
||||||
|
;; \
|
||||||
|
esac && \
|
||||||
|
apt-get update && \
|
||||||
|
apt-get install \
|
||||||
|
--no-install-recommends \
|
||||||
|
git \
|
||||||
|
cmake \
|
||||||
|
ninja-build \
|
||||||
|
gperf \
|
||||||
|
ccache \
|
||||||
|
dfu-util \
|
||||||
|
device-tree-compiler \
|
||||||
|
wget \
|
||||||
|
python3-dev \
|
||||||
|
python3-pip \
|
||||||
|
python3-setuptools \
|
||||||
|
python3-tk \
|
||||||
|
python3-wheel \
|
||||||
|
xz-utils \
|
||||||
|
file \
|
||||||
|
make \
|
||||||
|
gcc \
|
||||||
|
gcc-multilib \
|
||||||
|
g++-multilib \
|
||||||
|
libsdl2-dev \
|
||||||
|
libmagic1 \
|
||||||
|
unzip \
|
||||||
|
build-essential \
|
||||||
|
libgit2-dev \
|
||||||
|
-y && \
|
||||||
|
rm -rf /var/cache/apt && \
|
||||||
|
pip3 install --upgrade pip --break-system-packages && \
|
||||||
|
mkdir ${HOME}/gn && \
|
||||||
|
cd ${HOME}/gn && \
|
||||||
|
wget -O gn.zip https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-$ARCH/+/latest &&\
|
||||||
|
unzip gn.zip && \
|
||||||
|
rm gn.zip && \
|
||||||
|
echo 'export PATH=${HOME}/gn:"$PATH"' >> ${HOME}/.bashrc && \
|
||||||
|
. ${HOME}/.bashrc && \
|
||||||
|
pip3 install west --break-system-packages && \
|
||||||
|
echo 'export PATH=~/.local/bin:"$PATH"' >> ~/.bashrc && \
|
||||||
|
. ~/.bashrc && \
|
||||||
|
west init -m https://github.com/nrfconnect/sdk-nrf --mr $NRF_CONNECT_TAG && \
|
||||||
|
west update && \
|
||||||
|
west zephyr-export && \
|
||||||
|
pip3 install -r zephyr/scripts/requirements.txt --break-system-packages && \
|
||||||
|
pip3 install -r nrf/scripts/requirements.txt --break-system-packages && \
|
||||||
|
pip3 install -r bootloader/mcuboot/scripts/requirements.txt --break-system-packages && \
|
||||||
|
cd ~ && \
|
||||||
|
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_TAG}/zephyr-sdk-${ZEPHYR_TAG}_linux-${ZEPHYR_ARCH}.tar.${ZEPHYR_ARCHIVE_EXTENSION} && \
|
||||||
|
(wget -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_TAG}/sha256.sum | shasum --check --ignore-missing) && \
|
||||||
|
tar xvf zephyr-sdk-${ZEPHYR_TAG}_linux-$ZEPHYR_ARCH.tar.${ZEPHYR_ARCHIVE_EXTENSION} && \
|
||||||
|
rm zephyr-sdk-${ZEPHYR_TAG}_linux-$ZEPHYR_ARCH.tar.${ZEPHYR_ARCHIVE_EXTENSION} && \
|
||||||
|
apt-get remove python3-pip build-essential -y && \
|
||||||
|
apt autoremove -y && \
|
||||||
|
apt autoclean -y
|
||||||
|
|
||||||
|
COPY ./entrypoint.sh /bin/
|
||||||
|
|
||||||
|
RUN chmod +x /bin/entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/bin/entrypoint.sh" ]
|
20
README.md
20
README.md
@ -1,2 +1,22 @@
|
|||||||
# nrf-connect-sdk-ci
|
# nrf-connect-sdk-ci
|
||||||
Build NRF Connect SDK projects
|
Build NRF Connect SDK projects
|
||||||
|
|
||||||
|
## Usage example:
|
||||||
|
|
||||||
|
```
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
uses: embedd-actions/nrf-connect-sdk-ci@v2.3.0
|
||||||
|
with:
|
||||||
|
board: nrf52833dk_nrf52833
|
||||||
|
build_dir: build
|
||||||
|
|
||||||
|
```
|
||||||
|
24
action.yml
Normal file
24
action.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
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
|
||||||
|
- --build-dir
|
||||||
|
- ${{ inputs.build_dir }}
|
||||||
|
- .
|
||||||
|
- --pristine
|
||||||
|
- --no-sysbuild
|
||||||
|
- --board
|
||||||
|
- ${{ inputs.board }}
|
||||||
|
|
11
docker-compose.yml
Normal file
11
docker-compose.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
nrf:
|
||||||
|
container_name: nrf
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
args:
|
||||||
|
- NRF_CONNECT_TAG=v2.4.2
|
||||||
|
- ZEPHYR_TAG=0.16.1
|
16
entrypoint.sh
Normal file
16
entrypoint.sh
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#echo 'export PATH=root/gn:"$PATH"' >> ${HOME}/.bashrc
|
||||||
|
|
||||||
|
#. ${HOME}/.bashrc
|
||||||
|
|
||||||
|
#echo 'export PATH=root/.local/bin:"$PATH"' >> ~/.bashrc
|
||||||
|
|
||||||
|
#. ~/.bashrc
|
||||||
|
|
||||||
|
. /root/gn/zephyr/zephyr-env.sh
|
||||||
|
/bin/bash /root/zephyr-sdk-${ZEPHYR_TAG}/setup.sh -t all
|
||||||
|
/bin/bash /root/zephyr-sdk-${ZEPHYR_TAG}/setup.sh -h
|
||||||
|
/bin/bash /root/zephyr-sdk-${ZEPHYR_TAG}/setup.sh -c
|
||||||
|
|
||||||
|
$@
|
Loading…
Reference in New Issue
Block a user