Skip to content

Commit

Permalink
Merge pull request #151 from TheThingsNetwork/fix/150
Browse files Browse the repository at this point in the history
Use Arduino CLI for CI
  • Loading branch information
johanstokking authored Dec 1, 2016
2 parents 7746111 + e170296 commit cd12be2
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 21 deletions.
48 changes: 32 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
language: python
python:
- "2.7"

# Cache PlatformIO packages using Travis CI container-based infrastructure
sudo: false
cache:
directories:
- "~/.platformio"

language: c
env:
- PLATFORMIO_CI_SRC=test/TheThingsNetwork.ino
- PLATFORMIO_CI_SRC=test/TheThingsMessage.ino

- ARDUINO_VERSION=1.6.13
before_install:
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16"
- sleep 3
- export DISPLAY=:1.0
- wget http://downloads.arduino.cc/arduino-$ARDUINO_VERSION-linux64.tar.xz
- tar xf arduino-$ARDUINO_VERSION-linux64.tar.xz
- sudo mv arduino-$ARDUINO_VERSION /usr/local/share/arduino
- sudo ln -s /usr/local/share/arduino/arduino /usr/local/bin/arduino
install:
- pip install -U platformio

- ln -s $PWD /usr/local/share/arduino/libraries/TheThingsNetwork
- arduino --install-library "DHT sensor library:1.3.0,Adafruit Unified Sensor:1.0.2"
before_script:
# Replace placeholders with actual frequency plan (on Mac OS folow -i by '')
- find $PWD/examples -type f -name "*.ino" -exec sed -i 's/\(freqPlan = \)/\1TTN_FP_EU868;/g' {} +
script:
- platformio ci --lib=src --board=leonardo --board=sparkfun_promicro8
- arduino --verify --board arduino:avr:leonardo $PWD/examples/ABP/ABP.ino
- arduino --verify --board arduino:avr:leonardo $PWD/examples/DeviceInfo/DeviceInfo.ino
- arduino --verify --board arduino:avr:leonardo $PWD/examples/Message/Receive/Receive.ino
- arduino --verify --board arduino:avr:leonardo $PWD/examples/Message/Send/Send.ino
- arduino --verify --board arduino:avr:leonardo $PWD/examples/PassThrough/PassThrough.ino
- arduino --verify --board arduino:avr:leonardo $PWD/examples/QuickStart/QuickStart.ino
- arduino --verify --board arduino:avr:leonardo $PWD/examples/Receive/Receive.ino
- arduino --verify --board arduino:avr:leonardo $PWD/examples/Send/Send.ino
- arduino --verify --board arduino:avr:leonardo $PWD/examples/Sensors/DHT/DHT.ino
- arduino --verify --board arduino:avr:leonardo $PWD/examples/Sensors/LightSensor/LightSensor.ino
- arduino --verify --board arduino:avr:leonardo $PWD/examples/Workshop/Workshop.ino
- arduino --verify --board arduino:avr:leonardo $PWD/test/TheThingsMessage/TheThingsMessage.ino
- arduino --verify --board arduino:avr:leonardo $PWD/test/TheThingsNetwork/TheThingsNetwork.ino
notifications:
email:
on_success: change
on_failure: change
9 changes: 6 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## Contributing

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

1. Keep [keywords.txt](../keywords.txt) up to date with your changes.
2. Keep [API.md](../API.md) up to date with your changes.
1. Examples: [examples](examples)
2. Syntax highlighting: [keywords.txt](../keywords.txt)
3. Documentation: [docs](docs)
4. Tests: [test](test)
5. Verification of the examples and tests: [.travis.yml](.travis.yml)
3 changes: 1 addition & 2 deletions examples/Message/Send/Send.ino
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ void loop() {

// Encode the selected fields of the struct as bytes
byte *buffer;
size_t buffer_size = 51;
size_t size;
TheThingsMessage::encodeSensorData(&data, &buffer, buffer_size, &size);
TheThingsMessage::encodeSensorData(&data, &buffer, &size);

ttn.sendBytes(buffer, size);

Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit cd12be2

Please sign in to comment.