Skip to content

Commit b8a78d4

Browse files
authored
Merge pull request #64 from per1234/travis-ci-arduino-cli
Use Travis CI for automated testing
2 parents 98b9b57 + 76a36dd commit b8a78d4

File tree

21 files changed

+2889
-2390
lines changed

21 files changed

+2889
-2390
lines changed

.travis.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# default language
2+
language: generic
3+
4+
env:
5+
global:
6+
- CLI_VERSION=latest
7+
8+
matrix:
9+
include:
10+
# compile example sketches for the following boards
11+
- env:
12+
- BOARD='arduino:avr:mega:cpu=atmega2560'
13+
install:
14+
- arduino-cli core install arduino:avr
15+
16+
- env:
17+
- BOARD='arduino:samd:mkrzero'
18+
install:
19+
- arduino-cli core install arduino:samd
20+
21+
- env:
22+
- BOARD='arduino:megaavr:uno2018:mode=on'
23+
install:
24+
- arduino-cli core install arduino:megaavr
25+
26+
- env:
27+
- BOARD='arduino:sam:arduino_due_x'
28+
install:
29+
- arduino-cli core install arduino:sam
30+
31+
# check all code files for compliance with the Arduino code formatting style
32+
- env:
33+
- NAME='Code Formatting Check'
34+
language: minimal
35+
before_install:
36+
# install Artistic Style code formatter tool: http://astyle.sourceforge.net
37+
- |
38+
mkdir "${HOME}/astyle";
39+
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";
40+
tar --extract --file="${HOME}/astyle/astyle.tar.gz" --directory="${HOME}/astyle";
41+
cd "${HOME}/astyle/astyle/build/gcc";
42+
make;
43+
export PATH="$PWD/bin:$PATH";
44+
cd "$TRAVIS_BUILD_DIR"
45+
# download Arduino's Artistic Style configuration file
46+
- wget --directory-prefix="${HOME}/astyle" https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples_formatter.conf
47+
script:
48+
# check code formatting
49+
- 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'
50+
51+
# check all files for commonly misspelled words
52+
- env:
53+
- NAME='Spell Check'
54+
language: python
55+
python: 3.6
56+
before_install:
57+
# https://github.com/codespell-project/codespell
58+
- pip install codespell
59+
script:
60+
# codespell will ignore any words in extras/codespell-ignore-words-list.txt, which may be used to fix false positives
61+
- codespell --skip="${TRAVIS_BUILD_DIR}/.git" --ignore-words="${TRAVIS_BUILD_DIR}/extras/codespell-ignore-words-list.txt" "${TRAVIS_BUILD_DIR}"
62+
63+
# default phases shared by the compilation tests
64+
before_install:
65+
- wget http://downloads.arduino.cc/arduino-cli/arduino-cli-$CLI_VERSION-linux64.tar.bz2
66+
- tar xf arduino-cli-$CLI_VERSION-linux64.tar.bz2
67+
- mkdir -p "$HOME/bin"
68+
- mv arduino-cli-*-linux64 $HOME/bin/arduino-cli
69+
- export PATH="$PATH:$HOME/bin"
70+
- arduino-cli core update-index
71+
- buildExampleSketch() { arduino-cli compile --verbose --warnings all --fqbn $BOARD "$PWD/examples/$1"; }
72+
- mkdir -p "$HOME/Arduino/libraries"
73+
- ln -s "$PWD" "$HOME/Arduino/libraries/."
74+
75+
script:
76+
- buildExampleSketch CardInfo
77+
- buildExampleSketch Datalogger
78+
- buildExampleSketch DumpFile
79+
- buildExampleSketch Files
80+
- buildExampleSketch listfiles
81+
- buildExampleSketch ReadWrite
82+
83+
notifications:
84+
webhooks:
85+
# use TravisBuddy to comment on any pull request that results in a failed CI build
86+
urls:
87+
- https://www.travisbuddy.com/
88+
on_success: never
89+
on_failure: always

README.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
= SD Library for Arduino =
22

3+
image:https://travis-ci.org/arduino-libraries/SD.svg?branch=master[Build Status, link=https://travis-ci.org/arduino-libraries/SD]
4+
35
The SD library allows for reading from and writing to SD cards.
46

57
For more information about this library please visit us at

examples/Datalogger/Datalogger.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
/*
22
SD card datalogger
33
4-
This example shows how to log data from three analog sensors
5-
to an SD card using the SD library.
4+
This example shows how to log data from three analog sensors
5+
to an SD card using the SD library.
66
7-
The circuit:
8-
* analog sensors on analog ins 0, 1, and 2
9-
* SD card attached to SPI bus as follows:
7+
The circuit:
8+
analog sensors on analog ins 0, 1, and 2
9+
SD card attached to SPI bus as follows:
1010
** MOSI - pin 11
1111
** MISO - pin 12
1212
** CLK - pin 13
1313
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)
1414
15-
created 24 Nov 2010
16-
modified 9 Apr 2012
17-
by Tom Igoe
15+
created 24 Nov 2010
16+
modified 9 Apr 2012
17+
by Tom Igoe
1818
19-
This example code is in the public domain.
19+
This example code is in the public domain.
2020
21-
*/
21+
*/
2222

2323
#include <SPI.h>
2424
#include <SD.h>

examples/DumpFile/DumpFile.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
/*
22
SD card file dump
33
4-
This example shows how to read a file from the SD card using the
5-
SD library and send it over the serial port.
4+
This example shows how to read a file from the SD card using the
5+
SD library and send it over the serial port.
66
7-
The circuit:
8-
* SD card attached to SPI bus as follows:
7+
The circuit:
8+
SD card attached to SPI bus as follows:
99
** MOSI - pin 11
1010
** MISO - pin 12
1111
** CLK - pin 13
1212
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)
1313
14-
created 22 December 2010
15-
by Limor Fried
16-
modified 9 Apr 2012
17-
by Tom Igoe
14+
created 22 December 2010
15+
by Limor Fried
16+
modified 9 Apr 2012
17+
by Tom Igoe
1818
19-
This example code is in the public domain.
19+
This example code is in the public domain.
2020
21-
*/
21+
*/
2222

2323
#include <SPI.h>
2424
#include <SD.h>

examples/Files/Files.ino

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/*
22
SD card basic file example
33
4-
This example shows how to create and destroy an SD card file
5-
The circuit:
6-
* SD card attached to SPI bus as follows:
4+
This example shows how to create and destroy an SD card file
5+
The circuit:
6+
SD card attached to SPI bus as follows:
77
** MOSI - pin 11
88
** MISO - pin 12
99
** CLK - pin 13
1010
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)
1111
12-
created Nov 2010
13-
by David A. Mellis
14-
modified 9 Apr 2012
15-
by Tom Igoe
12+
created Nov 2010
13+
by David A. Mellis
14+
modified 9 Apr 2012
15+
by Tom Igoe
1616
17-
This example code is in the public domain.
17+
This example code is in the public domain.
1818
19-
*/
19+
*/
2020
#include <SPI.h>
2121
#include <SD.h>
2222

examples/ReadWrite/ReadWrite.ino

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/*
22
SD card read/write
33
4-
This example shows how to read and write data to and from an SD card file
5-
The circuit:
6-
* SD card attached to SPI bus as follows:
4+
This example shows how to read and write data to and from an SD card file
5+
The circuit:
6+
SD card attached to SPI bus as follows:
77
** MOSI - pin 11
88
** MISO - pin 12
99
** CLK - pin 13
1010
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)
1111
12-
created Nov 2010
13-
by David A. Mellis
14-
modified 9 Apr 2012
15-
by Tom Igoe
12+
created Nov 2010
13+
by David A. Mellis
14+
modified 9 Apr 2012
15+
by Tom Igoe
1616
17-
This example code is in the public domain.
17+
This example code is in the public domain.
1818
19-
*/
19+
*/
2020

2121
#include <SPI.h>
2222
#include <SD.h>

examples/listfiles/listfiles.ino

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
/*
22
Listfiles
33
4-
This example shows how print out the files in a
5-
directory on a SD card
4+
This example shows how print out the files in a
5+
directory on a SD card
66
7-
The circuit:
8-
* SD card attached to SPI bus as follows:
7+
The circuit:
8+
SD card attached to SPI bus as follows:
99
** MOSI - pin 11
1010
** MISO - pin 12
1111
** CLK - pin 13
1212
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)
1313
14-
created Nov 2010
15-
by David A. Mellis
16-
modified 9 Apr 2012
17-
by Tom Igoe
18-
modified 2 Feb 2014
19-
by Scott Fitzgerald
14+
created Nov 2010
15+
by David A. Mellis
16+
modified 9 Apr 2012
17+
by Tom Igoe
18+
modified 2 Feb 2014
19+
by Scott Fitzgerald
2020
21-
This example code is in the public domain.
21+
This example code is in the public domain.
2222
23-
*/
23+
*/
2424
#include <SPI.h>
2525
#include <SD.h>
2626

extras/codespell-ignore-words-list.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)