COVID-19 impact: We are still operating and shipping all orders! We are operating with a reduced staff, so for critical requirements, including fighting COVID-19, please contact us so we can identify priorities. Click here for more info.

Roll your own continuous Arduino testing with our new arduino-ci

Posted by Ryan on 7 January 2021
Tags: arduino

As I wrote a few years ago, we used to use Travis CI and PlatformIO to confirm our Arduino libraries and examples compile after every code change. This helps us maintain confidence in the quality of our code and makes it easier to release changes. Of course that’s not as good as the extensive testing with actual hardware that we also do, but it’s really great as a quick check that we haven’t completely broken anything.

Unfortunately, Travis CI doesn’t work for code in development that has not yet been put up on GitHub. That, combined with Travis CI limiting how many testing minutes you get each month for free and GitHub Actions existing as a free replacement for it, pushed me to make a new solution that works for us.

So, we made arduino-ci: a simple Ruby script that is super easy to use with the continuous testing solutions provided by GitHub and GitLab. It uses arduino-cli to install cores (bundles of code for specific Arduino board architectures), install library dependencies, and compile all the examples. By default, it compiles all examples for the following boards:

  • arduino:avr:uno
  • arduino:avr:leonardo
  • arduino:avr:mega
  • arduino:avr:micro
  • arduino:avr:yun
  • arduino:sam:arduino_due_x
  • arduino:samd:arduino_zero_native
  • Intel:arc32:arduino_101
  • esp8266:esp8266:huzzah

You can use the configuration file to edit these defaults and add any additional library dependencies.

This isn’t the only Arduino continous testing program around. There’s also:

  • arduino_ci (underscore not dash) – a much bigger Ruby project with features like C++ unit testing and mocks
  • ci-arduino (are you seeing the pattern of confusing names yet?) – Adafruit’s testing program written in Python with features like Doxygen integration and code formatting

Sorry about the names, really! In contrast with these, arduino-ci is a very small program that focuses on compiling Arduino libraries and examples.

We are using arduino-ci for all of our libraries, and it should work for any Arduino Library, so if you have one, please try it out and tell us what you think! For more information, please read the arduino-ci readme.

0 comments

Post a comment

Using your Pololu account allows you to customize your avatar and manage your comments; you can also post anonymously.

Related Categories

Arduino-Compatible
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Menu
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors