Skip to content

Use Travis CI for automated testing #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 14, 2019
Merged

Use Travis CI for automated testing #64

merged 6 commits into from
May 14, 2019

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented May 13, 2019

Travis CI is used to run the following tests on the repository after every commit or pull request:

  • Compile all example sketches for Mega, MKR Zero, Uno WiFi Rev2, Due using the latest version of arduino-cli.
  • Use TravisBuddy to automatically comment on pull requests that result in a failed Travis CI build.
  • Check all code files for compliance with the Arduino code formatting style.
  • Check for commonly misspelled words.

Although it is not presently needed, I added an empty file: extras/codespell-ignore-words-list.txt. This file is to be used in case of false positives during the check for commonly misspelled words (all words in the file are ignored by codespell). My idea was that having the ignore system already in place would reduce the amount of hassle in the event of a false positive. If it is not considered desirable to add this file before it's needed, I'm happy to remove it from this PR.

I used the following files as a reference for this PR:

@per1234
Copy link
Contributor Author

per1234 commented May 13, 2019

As a volunteer project, I prepared a demonstration of how I would configure Travis CI were this my own repository.

Example Travis CI build:
https://travis-ci.org/per1234/SD/builds/531357867

.travis.yml:
https://github.com/per1234/SD/blob/travis-ci-alternate/.travis.yml

Features:

  • Compilation output is folded to make browsing the the log much faster and easier. A summary of each compilation is shown in the log that includes exit status, and warning count.
  • Compile all sketches found in the examples folder, so it automatically adapts to new examples being added.
  • Backwards compatibility testing using several "landmark" previous versions as well as the latest release of the Arduino IDE.
  • Compilation summary report in CSV format is printed to the log as well as being published to a separate repository (for easier viewing and download). This report can be used to more easily compare changes in memory usage and warning count between revisions: https://github.com/per1234/CI-reports/blob/SD/build_00027/travis_ci_job_report_00027.001.tsv
  • Check for common problems with library and example sketch structure.
  • Check for common problems with library.properties
  • Check for common problems with keywords.txt
  • File formatting checks:
    • Non-Unix line endings
    • Trailing whitespace
    • Files starting with a blank line
    • Unnecessary true tabs
    • Extra blank lines at end of files

I thought this might provide some ideas for enhancements to Arduino's Travis CI configuration. I'd be happy to add any of the above individual features to this PR.

Copy link
Contributor

@aentinger aentinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed the PR and it looks good to me 👍 @per1234 There is one small request from my side - please add the build-badge to the README page. Otherwise it is good to merge.

per1234 added 6 commits May 14, 2019 03:25
Travis CI will compile each of the example sketches for Mega, MKR Zero, Uno WiFi Rev2, and Due using the latest release of arduino-cli every time someone commits to the repository or submits a pull request.
TravisBuddy automatically comments on any pull request that results in a failed Travis CI build. This will cause the author of the pull request to get a notification of the failure and asking them to check the build results to see if they can fix the problem. The hope is that this will result in more pull requests that are valid before a maintainer needs to get involved. It also makes it easier on the pull request author because they don't need to remember to come back to the repository to check the CI build result.
The Artistic Style formatter tool was used with the https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples_formatter.conf configuration to format all code in the repository.
Use the Artistic Style formatting tool (also used for the Arduino IDE's auto format feature) to check all code files in the repository for compliance with the Arduino code formatting style.
Use codespell to check for commonly misspelled words during the Travis CI build. In the event of false positives, the words can be added to extras/codespell-ignore-words-list.txt, after which codespell will ignore those words.
@per1234
Copy link
Contributor Author

per1234 commented May 14, 2019

@lxrobotics I've added the requested build badge.

@aentinger
Copy link
Contributor

@per1234 Great 👍 You are good to merge.

@per1234 per1234 merged commit b8a78d4 into arduino-libraries:master May 14, 2019
@per1234 per1234 deleted the travis-ci-arduino-cli branch May 14, 2019 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants