Skip to content

Commit 709e7db

Browse files
committed
gh: fix usage as module
1 parent 3bb2f23 commit 709e7db

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

.github/workflows/build.yml

+12-17
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,29 @@ jobs:
88
container: zephyrprojectrtos/ci:latest
99
env:
1010
CMAKE_PREFIX_PATH: /opt/toolchains
11+
PR_NUMBER: ${{ github.event.number }}
1112
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v4
14-
with:
15-
path: ArduinoCore-zephyr
16-
1713
- name: Initialize
18-
working-directory: ArduinoCore-zephyr
1914
run: |
2015
mkdir build && cd build
21-
west init -m https://github.com/arduino/ArduinoCore-zephyr.git
16+
west init -m https://github.com/${{ github.repository }}
17+
cd modules/lib/ArduinoCore-zephyr/
18+
git fetch origin ${{ github.ref }}
19+
git checkout ${{ github.ref_name }}
20+
cd -
2221
west update
23-
rm -rf modules/lib/ArduinoCore-zephyr/*
24-
cp -r ../* modules/lib/ArduinoCore-zephyr || true
25-
rm modules/lib/ArduinoCore-zephyr/cores/arduino/api
26-
cp -r modules/lib/ArduinoCore-API/api modules/lib/ArduinoCore-zephyr/cores/arduino/api
2722
2823
- name: Build fade
29-
working-directory: ArduinoCore-zephyr/build
24+
working-directory: build
3025
run: |
31-
west build -p -b arduino_nano_33_ble//sense ../samples/fade
26+
west build -p -b arduino_nano_33_ble//sense modules/lib/ArduinoCore-zephyr/samples/fade
3227
3328
- name: Build i2cdemo
34-
working-directory: ArduinoCore-zephyr/build
29+
working-directory: build
3530
run: |
36-
west build -p -b ek_ra8d1 ../samples/i2cdemo
31+
west build -p -b ek_ra8d1 modules/lib/ArduinoCore-zephyr/samples/i2cdemo
3732
3833
- name: Build adc
39-
working-directory: ArduinoCore-zephyr/build
34+
working-directory: build
4035
run: |
41-
west build -p -b arduino_nano_33_ble//sense ../samples/analog_input
36+
west build -p -b arduino_nano_33_ble/nrf52840/sense modules/lib/ArduinoCore-zephyr/samples/analog_input

cores/CMakeLists.txt

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
add_subdirectory(arduino)
3+
add_subdirectory(arduino)
4+
5+
zephyr_include_directories(../../ArduinoCore-API/)
6+
7+
if(NOT DEFINED ARDUINO_BUILD_PATH)
8+
zephyr_sources(../../ArduinoCore-API/api/CanMsg.cpp)
9+
zephyr_sources(../../ArduinoCore-API/api/CanMsgRingbuffer.cpp)
10+
zephyr_sources(../../ArduinoCore-API/api/Common.cpp)
11+
zephyr_sources(../../ArduinoCore-API/api/IPAddress.cpp)
12+
zephyr_sources(../../ArduinoCore-API/api/Print.cpp)
13+
zephyr_sources(../../ArduinoCore-API/api/Stream.cpp)
14+
zephyr_sources(../../ArduinoCore-API/api/String.cpp)
15+
endif()

cores/arduino/CMakeLists.txt

-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ zephyr_sources(zephyrCommon.cpp)
99
zephyr_sources(USB.cpp)
1010
zephyr_sources(itoa.cpp)
1111

12-
zephyr_sources(api/CanMsg.cpp)
13-
zephyr_sources(api/CanMsgRingbuffer.cpp)
14-
zephyr_sources(api/Common.cpp)
15-
zephyr_sources(api/IPAddress.cpp)
16-
zephyr_sources(api/Print.cpp)
17-
zephyr_sources(api/Stream.cpp)
18-
zephyr_sources(api/String.cpp)
19-
2012
if(DEFINED CONFIG_ARDUINO_ENTRY)
2113
zephyr_sources(main.cpp)
2214
zephyr_sources(threads.cpp)

0 commit comments

Comments
 (0)