This repository has been archived by the owner on Aug 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.travis.yml
67 lines (55 loc) · 2.59 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
language: cpp
sudo: enabled
matrix:
include:
- env:
- NAME=Test
install:
- sudo apt-get install lcov
before_script:
- cd test && mkdir build && cd build
script:
- cmake ..
- make
after_success:
- lcov --directory . --zerocounters
- bin/testArduinoCloudThing
- lcov --directory . --capture --output-file coverage.info
- lcov --remove coverage.info 'test/*' '/usr/*' 'lib/*' --output-file coverage.info
- lcov --list coverage.info
- bash <(curl -s https://codecov.io/bash) -f coverage.info
- cd ..
- rm -rf build
- env:
- NAME=Code Formatting Check
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 -path './src/lib' -prune -or -path './test/external' -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'
- env:
- NAME=Spell Check
language: python
python: 3.6
install:
# https://github.com/codespell-project/codespell
- pip install codespell
script:
- codespell --skip="${TRAVIS_BUILD_DIR}/.git","${TRAVIS_BUILD_DIR}/src/lib","${TRAVIS_BUILD_DIR}/test/external" --ignore-words="${TRAVIS_BUILD_DIR}/extras/codespell-ignore-words-list.txt" "${TRAVIS_BUILD_DIR}"
notifications:
webhooks:
urls:
# TravisBuddy will automatically comment on any PR that results in a failed Travis CI build, which will cause the PR author to get a notification
- https://www.travisbuddy.com/
on_success: never
on_failure: always