Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Arduino command line travis testing
# 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
# We'll test against only a single library example, and only for uno, but you could add more combinations
- BOARD=arduino:avr:uno NAME=NullStreamExample
# - BOARD=attiny:avr:attiny85 NAME=$NullStreamExample
- gcc
- sudo apt-get update -qq && sudo apt-get install -qq openjdk-6-jre avr-libc gcc-avr xvfb
# arduino
- wget
- 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
# - unzip
# - sudo mv attiny-ide-1.6.x/attiny /usr/local/share/arduino/hardware/
# arduino requires an X server even with command line
- 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
- 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

This comment has been minimized.

Copy link

awong1900 commented Nov 5, 2015

Nice work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.