|
| 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 |
0 commit comments