Skip to content

add build.yml for CI CD #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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.*
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) 2022 Dhruva Gole <[email protected]>
# 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..."
19 changes: 19 additions & 0 deletions west.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2022 Dhruva Gole <[email protected]>
# 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