Skip to content

Commit c4ed17c

Browse files
committed
feat: add ci
1 parent 609b671 commit c4ed17c

File tree

5 files changed

+144
-0
lines changed

5 files changed

+144
-0
lines changed

.github/workflows/build.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
- develop
6+
paths-ignore:
7+
- .git*
8+
- '**.md'
9+
- '*.properties'
10+
pull_request:
11+
branches:
12+
- main
13+
- develop
14+
paths-ignore:
15+
- .git*
16+
- '**.md'
17+
- '*.properties'
18+
19+
jobs:
20+
build:
21+
name: 'Build Test: ${{matrix.board.arch}}:${{matrix.board.name}}'
22+
runs-on: ubuntu-latest
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
board:
27+
- vendor: arduino
28+
arch: avr
29+
name: uno
30+
- vendor: arduino
31+
arch: megaavr
32+
name: uno2018
33+
- vendor: arduino
34+
arch: samd
35+
name: mkrvidor4000
36+
- vendor: arduino
37+
arch: samd
38+
name: mkrwifi1010
39+
- vendor: arduino
40+
arch: samd
41+
name: mkr1000
42+
- vendor: arduino
43+
arch: samd
44+
name: nano_33_iot
45+
- vendor: esp8266
46+
arch: esp8266
47+
name: generic
48+
- vendor: esp32
49+
arch: esp32
50+
name: esp32
51+
- vendor: esp32
52+
arch: esp32
53+
name: esp32s3
54+
- vendor: esp32
55+
arch: esp32
56+
name: esp32c3
57+
- vendor: rp2040
58+
arch: rp2040
59+
name: rpipicow
60+
- vendor: teensy
61+
arch: avr
62+
name: teensy35
63+
- vendor: teensy
64+
arch: avr
65+
name: teensy36
66+
- vendor: teensy
67+
arch: avr
68+
name: teensy41
69+
include:
70+
- index: https://downloads.arduino.cc/packages/package_index.json
71+
board:
72+
vendor: arduino
73+
- index: https://arduino.esp8266.com/stable/package_esp8266com_index.json
74+
board:
75+
vendor: esp8266
76+
- index: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
77+
board:
78+
vendor: esp32
79+
- index: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
80+
board:
81+
vendor: rp2040
82+
- index: https://www.pjrc.com/teensy/package_teensy_index.json
83+
board:
84+
vendor: teensy
85+
steps:
86+
- uses: actions/checkout@v4
87+
- name: compile example sketchs
88+
uses: arduino/compile-sketches@v1
89+
with:
90+
github-token: ${{ secrets.GITHUB_TOKEN }}
91+
fqbn: ${{matrix.board.vendor}}:${{matrix.board.arch}}:${{matrix.board.name}}
92+
platforms: |
93+
- name: ${{matrix.board.vendor}}:${{matrix.board.arch}}
94+
source-url: ${{matrix.index}}
95+
sketch-paths: |
96+
- examples/encode_decode
97+
- examples/encode_decode_index
98+
- examples/send_receive
99+
- examples/send_receive_index
100+
- examples/send_receive_manual
101+
- tests
102+
libraries: |
103+
- source-path: ./
104+
- name: ArduinoJson
105+
verbose: true

examples/encode_decode_index/encode_decode_index.ino

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,37 @@ void setup() {
194194
else
195195
Serial.println("test 6 success!");
196196
}
197+
{
198+
Packetizer::Packet p_in {0x01, {0xC0, 0xC1, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE}};
199+
const auto& p_buff = Packetizer::encode(p_in.index, p_in.data.data(), p_in.data.size());
200+
const auto& p_out = Packetizer::decode(p_buff.data.data(), p_buff.data.size());
201+
202+
Serial.print("index = ");
203+
Serial.println(p_out.index, HEX);
204+
Serial.print("input = ");
205+
for (const auto& p : p_in.data) {
206+
Serial.print(p, HEX);
207+
Serial.print(" ");
208+
}
209+
Serial.println();
210+
Serial.print("encoded = ");
211+
for (const auto& p : p_buff.data) {
212+
Serial.print(p, HEX);
213+
Serial.print(" ");
214+
}
215+
Serial.println();
216+
Serial.print("decoded = ");
217+
for (const auto& p : p_out.data) {
218+
Serial.print(p, HEX);
219+
Serial.print(" ");
220+
}
221+
Serial.println();
222+
223+
if (p_in.index != p_out.index || p_in.data != p_out.data)
224+
Serial.println("test 7 failed!");
225+
else
226+
Serial.println("test 7 success!");
227+
}
197228
}
198229

199230
void loop() {

examples/send_receive_other_apps/openFrameworks/send_receive/addons.make

100755100644
File mode changed.

examples/send_receive_other_apps/openFrameworks/send_receive_index/addons.make

100755100644
File mode changed.

tests/standalone/standalone.ino

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#define TEST_NO_SERIAL
22

3+
#if defined(ARDUINO_ARCH_AVR) || defined (ARDUINO_ARCH_SAM) || defined(ARDUINO_ARCH_SAMD)
4+
5+
void setup() {}
6+
void loop() {}
7+
8+
#else
9+
310
#include <Packetizer.h>
411
#include <cassert>
512

@@ -1220,3 +1227,4 @@ void loop()
12201227
{
12211228
}
12221229

1230+
#endif

0 commit comments

Comments
 (0)