Skip to content

Commit 235a688

Browse files
committed
Update workflow to build with PIO
1 parent f460f87 commit 235a688

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build Examples
33
on: [push, pull_request, workflow_dispatch]
44

55
jobs:
6-
build:
6+
build_arduino:
77
strategy:
88
fail-fast: false
99
matrix:
@@ -45,3 +45,42 @@ jobs:
4545
- name: NimBLE-Arduino
4646
fqbn: "h2zero:arm-ble:${{ matrix.variant }}"
4747
sketch-paths: ${{ matrix.example }}
48+
49+
build_pio:
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
example:
54+
- "libraries/n-able/examples/FreeRTOS"
55+
- "libraries/n-able/examples/BLE_Advertiser"
56+
- "libraries/n-able/examples/BLE_Scan"
57+
58+
runs-on: ubuntu-latest
59+
60+
steps:
61+
- uses: actions/checkout@v4
62+
- name: Set up Python
63+
uses: actions/setup-python@v5
64+
with:
65+
python-version: "3.x"
66+
- name: Install platformio
67+
run: |
68+
python -m pip install --upgrade pip
69+
pip install platformio
70+
- name: Build n-able PIO
71+
run: |
72+
mkdir -p example/framework
73+
rsync -Rr . example/framework
74+
mkdir example/src
75+
cat > example/platformio.ini << EOF
76+
[env]
77+
platform = https://github.com/h2zero/platform-n-able.git#1.0.0
78+
platform_packages = framework-n-able-arduino @ file://./framework
79+
framework = arduino
80+
lib_deps = h2zero/NimBLE-Arduino
81+
82+
[env:generic_nrf52840]
83+
board = generic_nrf52840
84+
EOF
85+
cp ${{ matrix.example }}/* example/src/
86+
platformio run -d example

0 commit comments

Comments
 (0)