Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 9 of 9

Thread: Teensy and Continuous Integration

  1. #1
    Senior Member
    Join Date
    Oct 2015
    Location
    Vermont, USA
    Posts
    167

    Teensy and Continuous Integration

    Hi,

    I'm thinking about attaching some continuous integration testing to my GitHub so that when I update my Teensy-oriented libraries, all of the example sketches are checked.

    I found a good adafruit example for testing standard Arduino code via Travis (https://learn.adafruit.com/continuou...g-your-project) but I assume that it will fail for lack of the Teensyduino add-on to the Arduino compiler (though I don't really undersand how the Arduino-Teensy things relate to each other at the compiler level)

    Has anyone used continuous integration with Teensy? I'd love some pointers!

    Chip

  2. #2
    Member Moo's Avatar
    Join Date
    Oct 2016
    Location
    London
    Posts
    20
    Quote Originally Posted by chipaudette View Post
    Has anyone used continuous integration with Teensy?
    https://travis-ci.org/newdigate/teensy-blink

    I've been meaning to get travis working with my teensy codes for a while. I basically copied the latest arduino travis yaml and fudged the rest of the details along the way. - I haven't tested it very well yet, but it seems I've managed to get blink to compile under teensy cores on travis. After many hours of Arduino learning curves, I might have got too excited when it went green...

  3. #3
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,555
    Chip - are/can you (be) on Windows?

    The Tset mod I did to FrankB's Compile.cmd creates and leaves a the Compile.cmd file in the Sketch directory - that could be run in Verify mode for the sketch where the output goes to a cmd console window.

    How many sketches are involved? If more than one it would just need an outer file to run each and gather the output. It ties to the installed IDE with TeensyDuino and runs the standard Arduino builder process.

  4. #4
    Member Moo's Avatar
    Join Date
    Oct 2016
    Location
    London
    Posts
    20
    Quote Originally Posted by Moo View Post
    I might have got too excited when it went green...
    No, its not quite right yet... its not actually compiling any .ino files yet...

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,555
    Here is the link to Windows tool that works from inside an editor - or CMDLINE or double click in Explorer: github.com/Defragster/Tset

    The readme there should have notes as needed for use on Windows. There must be way it could be translated to Linux/mAc? If anyone has the skillz let me know.

    If the same Teeny board and build options are used for all sketches the Compile.cmd can just be created once and placed in each directory - it scans the dir for an INO to start the builder with - which may be the tricky part - so that could be hardcoded if it helped.

    Then running :: C:> Compile.cmd 0
    Will do a verify build when then proper default directories to Arduino are given
    Last edited by defragster; 02-26-2019 at 10:25 PM.

  6. #6
    Member Moo's Avatar
    Join Date
    Oct 2016
    Location
    London
    Posts
    20
    Quote Originally Posted by defragster View Post

    There must be way it could be translated to Linux/mAc? If anyone has the skillz let me know.
    I've managed to get an automated build using travis for teensy 3.x projects;

    https://github.com/newdigate/teensy-blink

    https://travis-ci.org/newdigate/teensy-blink

    builds are triggered when changes are pushed to any branches of this repo, and when pull-requests are received.

    It gives a good indication when changes break the code, without having to pro-actively validate the changes manually.

    I've written some guidelines for other people to follow. I'd be interested if anybody else is interested in checking if they can apply this approach to their github teensy 3.x projects

    There are many potential improvements to this script.

  7. #7
    Junior Member
    Join Date
    Jun 2019
    Location
    New Hampshire, USA
    Posts
    1
    Here's a repo that uses github and Travis CI with the Teensy:

    https://github.com/Tympan/Tympan_Library

    We had some trouble with Audio and SD libraries; it appears the Travis build was looking to the default Arduino Audio and SD instead of those for the Teensy. We solved this by specifically calling out these libraries in the platformio.ini file (https://github.com/Tympan/Tympan_Lib...platformio.ini):

    Code:
    [env:teensy_device]
    platform = teensy
    framework = arduino
    board = teensy36
    build_flags = -D USB_EVERYTHING
    lib_deps =
        /home/travis/build/Tympan/Tympan_Library
        https://github.com/PaulStoffregen/Audio.git
        https://github.com/PaulStoffregen/SD.git
    We had to use the -D USB_EVERYTHING flag to get the USB audio and USB serial to work.

  8. #8
    Senior Member
    Join Date
    Oct 2015
    Location
    Vermont, USA
    Posts
    167
    Thanks for replies and thanks for the good work!

  9. #9
    Junior Member
    Join Date
    Jun 2019
    Posts
    3
    I use https://github.com/xxxajk/Arduino_Make to be able to compile teensy sketches from the commandline. You could very easily integrate this with any sort of CI system. Here's my custom makefile that also calls out to tycmd in order to upload to a teensy from one command `make upload` but obviously that wont work running in some cloud build server

    Code:
    BOARD=teensy:avr:teensy36:usb=serialhid,speed=180,opt=o1std,keys=en-us
    HEX=$(build_aDjOkT_path)/$(build_aDjOkT_project_name).hex
    MCU=mk66fx1m0
    OBJ_PATH_BASE=build
    include Arduino_Make/_Makefile.master
    
    upload: build
    	tycmd upload $(HEX)
    It uses the 'arduino-builder' tool so it knows how to automatically find the correct Arduino libraries and things and compile them in too.

    Re: integrating teensy & arduino, the one gotcha is there is no commandline installer for teensyduino, so what I do is manually install arduino & teensyduino on my laptop, then package it up into a tar file or whatever to install on the build server.
    One other gotcha is that it will try to run the GUI teensy uploader tool, to stop that from happening I replaced the file `arduino/hardware/tools/teensy_post_compile` with an empty shell script that does nothing (set it executable)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •