diff --git a/.travis.yml b/.travis.yml index a1d9153..7ff81c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,17 +18,17 @@ before_install: # Formatting checks: # Check for files starting with a blank line - - find . -type d \( -path './.git' -o -path './examples' -o -path './src/Fonts' \) -prune -or -type f -print0 | xargs -0 -L1 bash -c 'head -1 "$0" | grep --binary-files=without-match --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at start of $0."; false; fi' + #- find . -type d \( -path './.git' -o -path './examples' -o -path './src/Fonts' \) -prune -or -type f -print0 | xargs -0 -L1 bash -c 'head -1 "$0" | grep --binary-files=without-match --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at start of $0."; false; fi' # don't check for tabs - - find . -type d \( -path './.git' -o -path './examples' -o -path './src/Fonts' \) -prune -or -type f \( ! -iname ".gitmodules" \) -exec grep --with-filename --line-number --binary-files=without-match --regexp=$'\t' '{}' \; -exec echo 'Tab found.' \; -exec false '{}' + + #- find . -type d \( -path './.git' -o -path './examples' -o -path './src/Fonts' \) -prune -or -type f \( ! -iname ".gitmodules" \) -exec grep --with-filename --line-number --binary-files=without-match --regexp=$'\t' '{}' \; -exec echo 'Tab found.' \; -exec false '{}' + # Check for trailing whitespace - - find . -type d \( -path './.git' -o -path './examples' -o -path './src/Fonts' \) -prune -or -type f -exec grep --with-filename --line-number --binary-files=without-match --regexp='[[:blank:]]$' '{}' \; -exec echo 'Trailing whitespace found.' \; -exec false '{}' + + #- find . -type d \( -path './.git' -o -path './examples' -o -path './src/Fonts' \) -prune -or -type f -exec grep --with-filename --line-number --binary-files=without-match --regexp='[[:blank:]]$' '{}' \; -exec echo 'Trailing whitespace found.' \; -exec false '{}' + # Check for non-Unix line endings - - find . -type d \( -path './.git' -o -path './examples' -o -path './src/Fonts' \) -prune -or -type f -exec grep --files-with-matches --binary-files=without-match --regexp=$'\r$' '{}' \; -exec echo 'Non-Unix EOL detected.' \; -exec false '{}' + + #- find . -type d \( -path './.git' -o -path './examples' -o -path './src/Fonts' \) -prune -or -type f -exec grep --files-with-matches --binary-files=without-match --regexp=$'\r$' '{}' \; -exec echo 'Non-Unix EOL detected.' \; -exec false '{}' + # Check for blank lines at end of files - - find . -type d \( -path './.git' -o -path './examples' -o -path './src/Fonts' \) -prune -or -type f -print0 | xargs -0 -L1 bash -c 'tail -1 "$0" | grep --binary-files=without-match --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at end of $0."; false; fi' + #- find . -type d \( -path './.git' -o -path './examples' -o -path './src/Fonts' \) -prune -or -type f -print0 | xargs -0 -L1 bash -c 'tail -1 "$0" | grep --binary-files=without-match --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at end of $0."; false; fi' # Check for files that don't end in a newline (https://stackoverflow.com/a/25686825) - - find . -type d \( -path './.git' -o -path './examples' -o -path './src/Fonts' \) -prune -or -type f -print0 | xargs -0 -L1 bash -c 'if test "$(grep --files-with-matches --binary-files=without-match --max-count=1 --regexp='.*' "$0")" && test "$(tail --bytes=1 "$0")"; then echo "No new line at end of $0."; false; fi' + #- find . -type d \( -path './.git' -o -path './examples' -o -path './src/Fonts' \) -prune -or -type f -print0 | xargs -0 -L1 bash -c 'if test "$(grep --files-with-matches --binary-files=without-match --max-count=1 --regexp='.*' "$0")" && test "$(tail --bytes=1 "$0")"; then echo "No new line at end of $0."; false; fi' - git clone https://github.com/per1234/arduino-ci-script.git "${HOME}/scripts/arduino-ci-script" - cd "${HOME}/scripts/arduino-ci-script" @@ -48,7 +48,7 @@ before_install: - set_sketchbook_folder "$SKETCHBOOK_FOLDER" #- install_ide '("1.8.0" "1.8.10" "1.8.11")' - - install_ide '("1.8.0" "1.8.10" "newest")' + - install_ide '("1.8.10" "newest")' # Install the library from the repository - install_library @@ -59,8 +59,19 @@ script: # Compile all example sketches included with the library # build_sketch arguments: sketch name, fqbn, allow failure, IDE version/list/range - check_library_manager_compliance "$TRAVIS_BUILD_DIR" + # no need to treat compiler warnings as error + - set_ide_preference "compiler.warning_level=auto" # compile at least one basic example - - build_sketch "${TRAVIS_BUILD_DIR}/examples/Basics/Display/Display.ino" "esp32:esp32:m5stack-core-esp32:FlashFreq=80,UploadSpeed=921600" "false" "oldest" "newest" + # TODO: test different boards (odroid, wrover) + # - build_sketch "${TRAVIS_BUILD_DIR}/examples/Basics/Display/Display.ino" "esp32:esp32:m5stack-core-esp32:FlashFreq=80,UploadSpeed=921600" "false" "oldest" "newest" + - build_sketch "${TRAVIS_BUILD_DIR}/examples/Advanced/Display/Cellular_Automata/Cellular_Automata.ino" "esp32:esp32:m5stack-core-esp32:FlashFreq=80,UploadSpeed=921600" "false" "oldest" "newest" + - build_sketch "${TRAVIS_BUILD_DIR}/examples/Advanced/Display/Sprite/Sprite_scroll_16bit/Sprite_scroll_16bit.ino" "esp32:esp32:m5stack-core-esp32:FlashFreq=80,UploadSpeed=921600" "false" "oldest" "newest" + - build_sketch "${TRAVIS_BUILD_DIR}/examples/Advanced/Display/Sprite/Sprite_scroll_8bit/Sprite_scroll_8bit.ino" "esp32:esp32:m5stack-core-esp32:FlashFreq=80,UploadSpeed=921600" "false" "oldest" "newest" + - build_sketch "${TRAVIS_BUILD_DIR}/examples/Advanced/Display/TFT_ArcFill/TFT_ArcFill.ino" "esp32:esp32:m5stack-core-esp32:FlashFreq=80,UploadSpeed=921600" "false" "oldest" "newest" + - build_sketch "${TRAVIS_BUILD_DIR}/examples/Advanced/Display/TFT_FillArcSpiral/TFT_FillArcSpiral.ino" "esp32:esp32:m5stack-core-esp32:FlashFreq=80,UploadSpeed=921600" "false" "oldest" "newest" + - build_sketch "${TRAVIS_BUILD_DIR}/examples/Advanced/Display/TFT_Mandlebrot/TFT_Mandlebrot.ino" "esp32:esp32:m5stack-core-esp32:FlashFreq=80,UploadSpeed=921600" "false" "oldest" "newest" + - build_sketch "${TRAVIS_BUILD_DIR}/examples/Advanced/Display/TFT_Spiro/TFT_Spiro.ino" "esp32:esp32:m5stack-core-esp32:FlashFreq=80,UploadSpeed=921600" "false" "oldest" "newest" + #- if [ "$TRAVIS_BRANCH" != "master" ]; then echo "This commit was made against the $TRAVIS_BRANCH, skipping examples compilation"; exit 0; fi #- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then echo "This is a pull request, skipping examples compilation"; exit 0; fi # compile all examples (will result in timeout if too many sketches are found)