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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# default language
language: generic

env:
global:
- CLI_VERSION=latest

matrix:
include:
# compile example sketches for the following boards
- env:
- BOARD='arduino:avr:mega:cpu=atmega2560'
install:
- arduino-cli core install arduino:avr

- env:
- BOARD='arduino:samd:mkrzero'
install:
- arduino-cli core install arduino:samd

- env:
- BOARD='arduino:megaavr:uno2018:mode=on'
install:
- arduino-cli core install arduino:megaavr

- env:
- BOARD='arduino:sam:arduino_due_x'
install:
- arduino-cli core install arduino:sam

# check all code files for compliance with the Arduino code formatting style
- env:
- NAME='Code Formatting Check'
language: minimal
before_install:
# install Artistic Style code formatter tool: http://astyle.sourceforge.net
- |
mkdir "${HOME}/astyle";
wget --no-verbose --output-document="${HOME}/astyle/astyle.tar.gz" "https://iweb.dl.sourceforge.net/project/astyle/astyle/astyle%203.1/astyle_3.1_linux.tar.gz";
tar --extract --file="${HOME}/astyle/astyle.tar.gz" --directory="${HOME}/astyle";
cd "${HOME}/astyle/astyle/build/gcc";
make;
export PATH="$PWD/bin:$PATH";
cd "$TRAVIS_BUILD_DIR"
# download Arduino's Artistic Style configuration file
- wget --directory-prefix="${HOME}/astyle" https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples_formatter.conf
script:
# check code formatting
- find . -regextype posix-extended -path './.git' -prune -or \( -iregex '.*\.((ino)|(h)|(hpp)|(hh)|(hxx)|(h\+\+)|(cpp)|(cc)|(cxx)|(c\+\+)|(cp)|(c)|(ipp)|(ii)|(ixx)|(inl)|(tpp)|(txx)|(tpl))$' -and -type f \) -print0 | xargs -0 -L1 bash -c 'if ! diff "$0" <(astyle --options=${HOME}/astyle/examples_formatter.conf --dry-run < "$0"); then echo "Non-compliant code formatting in $0"; false; fi'

# check all files for commonly misspelled words
- env:
- NAME='Spell Check'
language: python
python: 3.6
before_install:
# https://github.com/codespell-project/codespell
- pip install codespell
script:
# codespell will ignore any words in extras/codespell-ignore-words-list.txt, which may be used to fix false positives
- codespell --skip="${TRAVIS_BUILD_DIR}/.git" --ignore-words="${TRAVIS_BUILD_DIR}/extras/codespell-ignore-words-list.txt" "${TRAVIS_BUILD_DIR}"

# default phases shared by the compilation tests
before_install:
- wget http://downloads.arduino.cc/arduino-cli/arduino-cli-$CLI_VERSION-linux64.tar.bz2
- tar xf arduino-cli-$CLI_VERSION-linux64.tar.bz2
- mkdir -p "$HOME/bin"
- mv arduino-cli-*-linux64 $HOME/bin/arduino-cli
- export PATH="$PATH:$HOME/bin"
- arduino-cli core update-index
- buildExampleSketch() { arduino-cli compile --verbose --warnings all --fqbn $BOARD "$PWD/examples/$1"; }
- mkdir -p "$HOME/Arduino/libraries"
- ln -s "$PWD" "$HOME/Arduino/libraries/."

script:
- buildExampleSketch CardInfo
- buildExampleSketch Datalogger
- buildExampleSketch DumpFile
- buildExampleSketch Files
- buildExampleSketch listfiles
- buildExampleSketch ReadWrite

notifications:
webhooks:
# use TravisBuddy to comment on any pull request that results in a failed CI build
urls:
- https://www.travisbuddy.com/
on_success: never
on_failure: always
2 changes: 2 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
= SD Library for Arduino =

image:https://travis-ci.org/arduino-libraries/SD.svg?branch=master[Build Status, link=https://travis-ci.org/arduino-libraries/SD]

The SD library allows for reading from and writing to SD cards.

For more information about this library please visit us at
Expand Down
20 changes: 10 additions & 10 deletions examples/Datalogger/Datalogger.ino
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
SD card datalogger

This example shows how to log data from three analog sensors
to an SD card using the SD library.
This example shows how to log data from three analog sensors
to an SD card using the SD library.

The circuit:
* analog sensors on analog ins 0, 1, and 2
* SD card attached to SPI bus as follows:
The circuit:
analog sensors on analog ins 0, 1, and 2
SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)

created 24 Nov 2010
modified 9 Apr 2012
by Tom Igoe
created 24 Nov 2010
modified 9 Apr 2012
by Tom Igoe

This example code is in the public domain.
This example code is in the public domain.

*/
*/

#include <SPI.h>
#include <SD.h>
Expand Down
20 changes: 10 additions & 10 deletions examples/DumpFile/DumpFile.ino
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
SD card file dump

This example shows how to read a file from the SD card using the
SD library and send it over the serial port.
This example shows how to read a file from the SD card using the
SD library and send it over the serial port.

The circuit:
* SD card attached to SPI bus as follows:
The circuit:
SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)

created 22 December 2010
by Limor Fried
modified 9 Apr 2012
by Tom Igoe
created 22 December 2010
by Limor Fried
modified 9 Apr 2012
by Tom Igoe

This example code is in the public domain.
This example code is in the public domain.

*/
*/

#include <SPI.h>
#include <SD.h>
Expand Down
18 changes: 9 additions & 9 deletions examples/Files/Files.ino
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/*
SD card basic file example

This example shows how to create and destroy an SD card file
The circuit:
* SD card attached to SPI bus as follows:
This example shows how to create and destroy an SD card file
The circuit:
SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)

created Nov 2010
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe
created Nov 2010
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe

This example code is in the public domain.
This example code is in the public domain.

*/
*/
#include <SPI.h>
#include <SD.h>

Expand Down
18 changes: 9 additions & 9 deletions examples/ReadWrite/ReadWrite.ino
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/*
SD card read/write

This example shows how to read and write data to and from an SD card file
The circuit:
* SD card attached to SPI bus as follows:
This example shows how to read and write data to and from an SD card file
The circuit:
SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)

created Nov 2010
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe
created Nov 2010
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe

This example code is in the public domain.
This example code is in the public domain.

*/
*/

#include <SPI.h>
#include <SD.h>
Expand Down
24 changes: 12 additions & 12 deletions examples/listfiles/listfiles.ino
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
/*
Listfiles

This example shows how print out the files in a
directory on a SD card
This example shows how print out the files in a
directory on a SD card

The circuit:
* SD card attached to SPI bus as follows:
The circuit:
SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)

created Nov 2010
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe
modified 2 Feb 2014
by Scott Fitzgerald
created Nov 2010
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe
modified 2 Feb 2014
by Scott Fitzgerald

This example code is in the public domain.
This example code is in the public domain.

*/
*/
#include <SPI.h>
#include <SD.h>

Expand Down
Empty file.
Loading