Created
April 1, 2015 07:04
-
-
Save jacobrosenthal/ffeadc44ebcc03b9b09b to your computer and use it in GitHub Desktop.
Arduino command line travis testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test build your arduino libraries with travis and the official arduino tool chain | |
# assumes directory structure | |
# /NullStream | |
# NullStream.h | |
# NullStream.cpp | |
# examples | |
# NullStreamExample | |
# NullStreamExample.ino | |
language: cpp | |
env: | |
# We'll test against only a single library example, and only for uno, but you could add more combinations | |
# https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc | |
- BOARD=arduino:avr:uno NAME=NullStreamExample | |
# - BOARD=attiny:avr:attiny85 NAME=$NullStreamExample | |
compiler: | |
- gcc | |
before_install: | |
- sudo apt-get update -qq && sudo apt-get install -qq openjdk-6-jre avr-libc gcc-avr xvfb | |
install: | |
# arduino | |
- wget http://downloads-02.arduino.cc/arduino-1.6.1-linux64.tar.xz | |
- tar -xvf arduino-1.6.1-linux64.tar.xz | |
- sudo mv arduino-1.6.1/ /usr/local/share/arduino | |
# you could add attiny the extra attiny board package | |
# - wget https://github.com/damellis/attiny/archive/ide-1.6.x.zip | |
# - unzip ide-1.6.x.zip | |
# - sudo mv attiny-ide-1.6.x/attiny /usr/local/share/arduino/hardware/ | |
before_script: | |
# arduino requires an X server even with command line | |
# https://github.com/arduino/Arduino/issues/1981 | |
- Xvfb :1 -screen 0 1024x768x16 &> xvfb.log & | |
# put your source files in a folder under a new libraries folder | |
- sudo mkdir /usr/src/arduino | |
- sudo mkdir /usr/src/arduino/libraries | |
- sudo ln -s $TRAVIS_BUILD_DIR /usr/src/arduino/libraries/something | |
script: | |
- sudo DISPLAY=:1.0 /usr/local/share/arduino/arduino --board $BOARD --pref sketchbook.path=/usr/src/arduino --verify /usr/src/arduino/libraries/something/examples/$NAME/$NAME.ino |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice work