Skip to content

Commit dadad5e

Browse files
committed
Adding .travis.yml file Travis CI build
1 parent 2d5d436 commit dadad5e

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.travis.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
language: generic
2+
env:
3+
global:
4+
- CLI_VERSION=latest
5+
matrix:
6+
include:
7+
- env:
8+
- BOARD="arduino:samd:mkr1000"
9+
- env:
10+
- BOARD="arduino:samd:mkrwifi1010"
11+
- env:
12+
- BOARD="arduino:samd:mkrgsm1400"
13+
- env:
14+
- NAME=Code Formatting Check
15+
# must define an empty before_install phase, otherwise the default one is used
16+
before_install: true
17+
install:
18+
# install Artistic Style code formatter tool: http://astyle.sourceforge.net
19+
- |
20+
mkdir "${HOME}/astyle";
21+
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";
22+
tar --extract --file="${HOME}/astyle/astyle.tar.gz" --directory="${HOME}/astyle";
23+
cd "${HOME}/astyle/astyle/build/gcc";
24+
make;
25+
export PATH=$PWD/bin:$PATH;
26+
cd "$TRAVIS_BUILD_DIR"
27+
# download Arduino's Artistic Style configuration file
28+
- wget --directory-prefix="${HOME}/astyle" https://raw.githubusercontent.com/arduino/Arduino/master/build/shared/examples_formatter.conf
29+
script:
30+
# check code formatting
31+
- 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'
32+
- env:
33+
- NAME=Spell Check
34+
language: python
35+
python: 3.6
36+
# must define an empty before_install phase, otherwise the default one is used
37+
before_install: true
38+
install:
39+
# https://github.com/codespell-project/codespell
40+
- pip install codespell
41+
script:
42+
- codespell --skip="${TRAVIS_BUILD_DIR}/.git" --ignore-words="${TRAVIS_BUILD_DIR}/extras/codespell-ignore-words-list.txt" "${TRAVIS_BUILD_DIR}"
43+
# default phases
44+
before_install:
45+
- wget http://downloads.arduino.cc/arduino-cli/arduino-cli-$CLI_VERSION-linux64.tar.bz2
46+
- tar xf arduino-cli-$CLI_VERSION-linux64.tar.bz2
47+
- mkdir -p "$HOME/bin"
48+
- mv arduino-cli-*-linux64 $HOME/bin/arduino-cli
49+
- export PATH="$PATH:$HOME/bin"
50+
- arduino-cli core update-index
51+
- if [[ "$BOARD" =~ "arduino:samd:" ]]; then
52+
arduino-cli core install arduino:samd;
53+
fi
54+
- buildExampleSketch() { arduino-cli compile --warnings all --fqbn $BOARD $PWD/examples/$1; }
55+
install:
56+
- mkdir -p $HOME/Arduino/libraries
57+
- ln -s $PWD $HOME/Arduino/libraries/.
58+
script:
59+
- buildExampleSketch Arduino_Debug_Basic
60+
notifications:
61+
webhooks:
62+
urls:
63+
- https://www.travisbuddy.com/
64+
on_success: never
65+
on_failure: always

0 commit comments

Comments
 (0)