Skip to content

Doing continuous integration with arduino builder

per1234 edited this page Sep 15, 2022 · 7 revisions

If you wish to be sure your library or package keeps on compiling while you develop it, you want some automatic way of running the Arduino IDE. You want it to compile, say, your library examples, every time you change your library implementation.

Continuous Integration (CI) comes to the rescue. CI servers like Jenkins allow you set up just this kind on automation with a "job", have it run automatically and send you an email if something has broken.

Suppose you're developing library "My_Beautiful_Library", located at ~/mylibs/My_Beautiful_Library. This is how you can run the copy of arduino-builder shipped with the Arduino IDE in order to verify the correctness of your library examples:

cd PATH_TO_ARDUINO_IDE
for sketch in `find ~/mylibs/My_Beautiful_Library/examples/ -name '*.ino'`
do
  ./arduino-builder -hardware ./hardware -tools ./hardware/tools/avr -tools ./tools-builder -libraries ./libraries -libraries ~/mylibs/ -fqbn arduino:avr:uno $sketch
done

This short script will compile for the Arduino UNO every example found under ~/mylibs/My_Beautiful_Library/examples/.

Clone this wiki locally