Introduction: How to Use Eagle CAD on Travis CI for Build Automation
This instructable aims on explaining how to setup travis ci (.travis.yml file) in a way that it is able to process eagle 7 files (schematics .sch and pcb boards .brd). As a result it will automatically generate images, gerber files and bill-of-material/partlists, do ERC and DRC rule checking, auto-routing and export the project to KiCAD.
This instructable was inspired by how to's on using Arduino IDE on Travis CI for build automation as described here:
For a working example you can have a look at my repos:
For your work you can start by simply forking https://github.com/drtrigon/eagle-view and uploading your projects .sch and .brd files to the fork.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Eagle CAD
At the very beginning of this instructable is your eagle project and the files it consists of. I will assume that you do have such a project already - if not, but you want to test this instructable anyways, you can for example use the Arduino Uno Eagle Files available from Arduino Store (see "Documentation" tab).
In case you are not familar with eagle already and need to learn how to use it, please confer a tutorial or how-to like How to Use Eagle.cad for example.
Step 2: Automation Through Travis
Now let us have a look at "the magic" and how it works, if you are not familar with travis ci yet, please confer Getting started for example.
Basically we are walking along the common path when using travis; we put or mirror our git repo to github, enable travis for this repo (on github), add a .travis.yml config file to the repo and use the resulting output from travis in our repo then (e.g. show images on the main page provided by README.md).
In more detail the travis config sets up a dummy x server (Xvfb), downloads and installs eagle and kicad and runs following tasks (xdotool):
- generate gerbers, add files to zip archive and convert gerber to png
- drill excellion creation
- bom part list creation
- board image output
- schematic image output
- DRC & ERC checks (result stored in an image)
- auto-router as example, if AUTOROUTER_ENABLE was set to true (result stored in an image)
- eagle to kicad conversion, if KICAD_ENABLE was set to true (tested/working with KiCAD 5.0RC2)
- push result back to the github repo (needs setup of GIT_USER and GIT_PASS)
If an error occurs during one of these steps, travis finishes with the according state.
Step 3: Result
The set of resulting files (example for Arduino Uno) includes all gerber files needed for production (set up for 2 layers, but can be extended to 4 of course), images of the schematic and pcb board for use in any environment (without the need for eagle installed, working or running) and a kicad project for future use e.g.
For further examples check the branches of the eagle-view repo.
Finally I would like to emphasize that we have now all tools needed to automate all aspects of electronics projects by the help of github and travis:
- software and firmware: see the arduino examples by adafruit mentioned in the beginning
- electronics (schematic, hardware/pcb): as explained here in this instructable - also consider using kicad
- other CAD parts (mechanical, etc.): if you store them in .stl format, github will provide an online viewer inlcuding diff features
Possible Future Improvements: