Skip to content

Commit cd12be2

Browse files
Merge pull request #151 from TheThingsNetwork/fix/150
Use Arduino CLI for CI
2 parents 7746111 + e170296 commit cd12be2

File tree

5 files changed

+39
-21
lines changed

5 files changed

+39
-21
lines changed

.travis.yml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
1-
language: python
2-
python:
3-
- "2.7"
4-
5-
# Cache PlatformIO packages using Travis CI container-based infrastructure
6-
sudo: false
7-
cache:
8-
directories:
9-
- "~/.platformio"
10-
1+
language: c
112
env:
12-
- PLATFORMIO_CI_SRC=test/TheThingsNetwork.ino
13-
- PLATFORMIO_CI_SRC=test/TheThingsMessage.ino
14-
3+
- ARDUINO_VERSION=1.6.13
4+
before_install:
5+
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16"
6+
- sleep 3
7+
- export DISPLAY=:1.0
8+
- wget http://downloads.arduino.cc/arduino-$ARDUINO_VERSION-linux64.tar.xz
9+
- tar xf arduino-$ARDUINO_VERSION-linux64.tar.xz
10+
- sudo mv arduino-$ARDUINO_VERSION /usr/local/share/arduino
11+
- sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino
1512
install:
16-
- pip install -U platformio
17-
13+
- ln -s $PWD /usr/local/share/arduino/libraries/TheThingsNetwork
14+
- arduino --install-library "DHT sensor library:1.3.0,Adafruit Unified Sensor:1.0.2"
15+
before_script:
16+
# Replace placeholders with actual frequency plan (on Mac OS folow -i by '')
17+
- find $PWD/examples -type f -name "*.ino" -exec sed -i 's/\(freqPlan = \)/\1TTN_FP_EU868;/g' {} +
1818
script:
19-
- platformio ci --lib=src --board=leonardo --board=sparkfun_promicro8
19+
- arduino --verify --board arduino:avr:leonardo $PWD/examples/ABP/ABP.ino
20+
- arduino --verify --board arduino:avr:leonardo $PWD/examples/DeviceInfo/DeviceInfo.ino
21+
- arduino --verify --board arduino:avr:leonardo $PWD/examples/Message/Receive/Receive.ino
22+
- arduino --verify --board arduino:avr:leonardo $PWD/examples/Message/Send/Send.ino
23+
- arduino --verify --board arduino:avr:leonardo $PWD/examples/PassThrough/PassThrough.ino
24+
- arduino --verify --board arduino:avr:leonardo $PWD/examples/QuickStart/QuickStart.ino
25+
- arduino --verify --board arduino:avr:leonardo $PWD/examples/Receive/Receive.ino
26+
- arduino --verify --board arduino:avr:leonardo $PWD/examples/Send/Send.ino
27+
- arduino --verify --board arduino:avr:leonardo $PWD/examples/Sensors/DHT/DHT.ino
28+
- arduino --verify --board arduino:avr:leonardo $PWD/examples/Sensors/LightSensor/LightSensor.ino
29+
- arduino --verify --board arduino:avr:leonardo $PWD/examples/Workshop/Workshop.ino
30+
- arduino --verify --board arduino:avr:leonardo $PWD/test/TheThingsMessage/TheThingsMessage.ino
31+
- arduino --verify --board arduino:avr:leonardo $PWD/test/TheThingsNetwork/TheThingsNetwork.ino
32+
notifications:
33+
email:
34+
on_success: change
35+
on_failure: change

CONTRIBUTING.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
## Contributing
22

3-
We'd ❤️ to welcome your contribution. Please make sure you:
3+
We'd ❤️ to welcome your contribution. Please make sure your changes include:
44

5-
1. Keep [keywords.txt](../keywords.txt) up to date with your changes.
6-
2. Keep [API.md](../API.md) up to date with your changes.
5+
1. Examples: [examples](examples)
6+
2. Syntax highlighting: [keywords.txt](../keywords.txt)
7+
3. Documentation: [docs](docs)
8+
4. Tests: [test](test)
9+
5. Verification of the examples and tests: [.travis.yml](.travis.yml)

examples/Message/Send/Send.ino

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ void loop() {
4646

4747
// Encode the selected fields of the struct as bytes
4848
byte *buffer;
49-
size_t buffer_size = 51;
5049
size_t size;
51-
TheThingsMessage::encodeSensorData(&data, &buffer, buffer_size, &size);
50+
TheThingsMessage::encodeSensorData(&data, &buffer, &size);
5251

5352
ttn.sendBytes(buffer, size);
5453

0 commit comments

Comments
 (0)