diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..3770c7fc --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,37 @@ +name: Build + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + container: Dockerfile + env: + CMAKE_PREFIX_PATH: /opt/toolchains + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + path: example-application + + - name: Initialize + working-directory: example-application + run: | + west init -l . + west update + + - name: Build firmware + working-directory: example-application + run: | + west build -b arduino_nano_33_ble samples/blinky_arduino + + - name: Twister Tests + working-directory: example-application + run: | + ../zephyr/scripts/twister -G --board-root boards/ --testsuite-root ./tests/ + + - name: Archive firmware + uses: actions/upload-artifact@v2 + with: + name: firmware + path: example-application/build/zephyr/zephyr.* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..612f7664 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,62 @@ +FROM debian:stable-slim AS base + +FROM base AS west + +RUN \ + apt-get -y update \ + && apt-get -y install --no-install-recommends \ + python3 \ + python3-pip \ + python3-wheel \ + && pip3 install west \ + && apt-get remove -y --purge \ + python3-pip \ + python3-wheel \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +FROM west AS python + +ARG ZEPHYR_VERSION=v3.2.0 +ENV ZEPHYR_VERSION=${ZEPHYR_VERSION} + +RUN \ + apt-get -y update \ + && apt-get -y install --no-install-recommends \ + git \ + python3 \ + python3-pip \ + python3-wheel \ + && pip3 install \ + -r https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/${ZEPHYR_VERSION}/scripts/requirements-base.txt \ + && pip3 install cmake \ + && apt-get remove -y --purge \ + python3-pip \ + python3-wheel \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +FROM python AS sdk + +ARG ARCHITECTURE=x86_64 +ARG ZEPHYR_SDK_VERSION=0.15.2 +ARG ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk +ARG TOOLCHAIN=arm-zephyr-eabi + +RUN \ + export sdk_file_name="zephyr-sdk-${ZEPHYR_SDK_VERSION}_linux-$(uname -m)_minimal.tar.gz" \ + && apt-get -y update \ + && apt-get -y install --no-install-recommends \ + device-tree-compiler \ + git \ + ninja-build \ + wget \ + && wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZEPHYR_SDK_VERSION}/${sdk_file_name}" \ + && mkdir -p ${ZEPHYR_SDK_INSTALL_DIR} && \ + tar -xvf ${sdk_file_name} -C ${ZEPHYR_SDK_INSTALL_DIR} --strip-components=1 \ + && ${ZEPHYR_SDK_INSTALL_DIR}/setup.sh -t ${TOOLCHAIN} \ + && rm ${sdk_file_name} \ + && apt-get remove -y --purge \ + wget \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ No newline at end of file diff --git a/west.yml b/west.yml new file mode 100644 index 00000000..88e51a28 --- /dev/null +++ b/west.yml @@ -0,0 +1,13 @@ +# Copyright (c) 2021 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +manifest: + remotes: + - name: zephyrproject-rtos + url-base: https://github.com/zephyrproject-rtos + + projects: + - name: zephyr + remote: zephyrproject-rtos + revision: main + import: true