From ab23c9f64aa0fbbae5d7d4ad63ec710673232188 Mon Sep 17 00:00:00 2001 From: Dhruva Gole Date: Sun, 27 Nov 2022 09:30:15 +0530 Subject: [PATCH 1/3] create west.yml This file can be used to directly pull and use this module. Main use case at the moment is to easily pull this module in a docker container and then run a simple sample build test to see if code compiles without errors. Signed-off-by: Dhruva Gole --- west.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 west.yml diff --git a/west.yml b/west.yml new file mode 100644 index 000000000..9f3b2a499 --- /dev/null +++ b/west.yml @@ -0,0 +1,19 @@ +# Copyright (c) 2022 Dhruva Gole +# SPDX-License-Identifier: Apache-2.0 + +# NOTE: This is created to be used for CI/CD workflow. So use it only +# if you are in the zephyrproject directory or else things may break. + +manifest: + self: + path: modules/lib/Arduino-Zephyr-API + + remotes: + - name: zephyrproject-rtos + url-base: https://github.com/zephyrproject-rtos + + projects: + - name: zephyr + remote: zephyrproject-rtos + revision: main + import: true From 0798dcf163d37f85efad42ba2e55c1025eb17d5b Mon Sep 17 00:00:00 2001 From: Dhruva Gole Date: Sun, 27 Nov 2022 12:19:20 +0530 Subject: [PATCH 2/3] create Dockerfile for build verification This Dockerfile can be used to verify that the project builds correctly without any errors. Signed-off-by: Dhruva Gole --- Dockerfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..0e19accb4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# Copyright (c) 2022 Dhruva Gole +# SPDX-License-Identifier: Apache-2.0 + +FROM zephyrprojectrtos/ci:latest AS base + +RUN \ + west init -m https://github.com/zephyrproject-rtos/gsoc-2022-arduino-core.git && west update \ + && git clone https://github.com/arduino/ArduinoCore-API.git ArduinoCore-API \ + && sed '/WCharacter.h/ s/./\/\/ &/' ArduinoCore-API/api/ArduinoAPI.h > ArduinoCore-API/api/tmpArduinoAPI.h \ + && mv ArduinoCore-API/api/tmpArduinoAPI.h ArduinoCore-API/api/ArduinoAPI.h \ + && cp -r /ArduinoCore-API/api /modules/lib/Arduino-Zephyr-API/cores/arduino/. \ + && cd modules/lib/Arduino-Zephyr-API && ls -la \ + && west build -p -b arduino_nano_33_ble samples/blinky_arduino \ + && printf '%s\n' "Module Successfully setup and built..." From 75e41ec7f01cde9c11dc968340cd20bf8bfa68f6 Mon Sep 17 00:00:00 2001 From: Dhruva Gole Date: Wed, 30 Nov 2022 18:46:15 +0530 Subject: [PATCH 3/3] add build.yml for CI CD This creates a CI CD build workflow to check if project builds successfully for a basic blink led sample Signed-off-by: Dhruva Gole --- .github/workflows/build.yml | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..06af383c0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,41 @@ +name: Build + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + container: zephyrprojectrtos/ci:latest + env: + CMAKE_PREFIX_PATH: /opt/toolchains + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + path: Arduino-Zephyr-API + + - name: Initialize + working-directory: Arduino-Zephyr-API + run: | + west init -m https://github.com/DhruvaG2000/arduino-core-testing.git + west update + git clone https://github.com/arduino/ArduinoCore-API.git ArduinoCore-API + sed '/WCharacter.h/ s/./\/\/ &/' ArduinoCore-API/api/ArduinoAPI.h > ArduinoCore-API/api/tmpArduinoAPI.h + mv ArduinoCore-API/api/tmpArduinoAPI.h ArduinoCore-API/api/ArduinoAPI.h + cp -r ArduinoCore-API/api /__w/arduino-core-testing/arduino-core-testing/Arduino-Zephyr-API/modules/lib/Arduino-Zephyr-API/cores/arduino/. + + - name: Build fade + working-directory: Arduino-Zephyr-API + run: | + west build -p -b arduino_nano_33_ble_sense samples/fade + + - name: Build i2cdemo + working-directory: Arduino-Zephyr-API + run: | + west build -p -b arduino_nano_33_ble_sense samples/i2cdemo + + - name: Archive firmware + uses: actions/upload-artifact@v2 + with: + name: firmware + path: Arduino-Zephyr-API/build/zephyr/zephyr.*