.travis.yml 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. sudo: required
  2. language: python
  3. python: 3.6
  4. env:
  5. global:
  6. # The Arduino IDE will be installed at APPLICATION_FOLDER/arduino
  7. - APPLICATION_FOLDER="${HOME}/arduino-ide"
  8. - SKETCHBOOK_FOLDER="${HOME}/arduino-sketchbook"
  9. before_install:
  10. # TODO: undo
  11. # remove submodules, we don't want those to be actually tested for compliance
  12. - git submodule status | rm -Rf `cut -d ' ' -f 3`
  13. # Formatting checks:
  14. # Check for files starting with a blank line
  15. - find . -path './.git' -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'
  16. # Check for tabs
  17. - find . -path './.git' -prune -or -type f \( ! -iname ".gitmodules" \) -exec grep --with-filename --line-number --binary-files=without-match --regexp=$'\t' '{}' \; -exec echo 'Tab found.' \; -exec false '{}' +
  18. # Check for trailing whitespace
  19. - find . -path './.git' -prune -or -type f -exec grep --with-filename --line-number --binary-files=without-match --regexp='[[:blank:]]$' '{}' \; -exec echo 'Trailing whitespace found.' \; -exec false '{}' +
  20. # Check for non-Unix line endings
  21. - find . -path './.git' -prune -or -type f -exec grep --files-with-matches --binary-files=without-match --regexp=$'\r$' '{}' \; -exec echo 'Non-Unix EOL detected.' \; -exec false '{}' +
  22. # Check for blank lines at end of files
  23. - find . -path './.git' -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'
  24. # Check for files that don't end in a newline (https://stackoverflow.com/a/25686825)
  25. - find . -path './.git' -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'
  26. - git clone https://github.com/per1234/arduino-ci-script.git "${HOME}/scripts/arduino-ci-script"
  27. - cd "${HOME}/scripts/arduino-ci-script"
  28. # Get new tags from the remote
  29. - git fetch --tags
  30. # Checkout the latest tag
  31. - git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
  32. - source "${HOME}/scripts/arduino-ci-script/arduino-ci-script.sh"
  33. #- set_script_verbosity 1
  34. #- set_verbose_output_during_compilation "true"
  35. # Check for library issues that don't affect compilation
  36. - set_library_testing "true"
  37. - set_application_folder "$APPLICATION_FOLDER"
  38. - set_sketchbook_folder "$SKETCHBOOK_FOLDER"
  39. - install_ide '("1.8.0" "1.8.9" "newest")'
  40. # Install the library from the repository
  41. - install_library
  42. - install_library "M5Stack"
  43. - install_library 'https://github.com/bblanchon/ArduinoJson.git' # "ArduinoJSON"
  44. - ls ${TRAVIS_BUILD_DIR} -la
  45. - ls ${TRAVIS_BUILD_DIR}/examples/M5Stack-SD-Menu/ -la
  46. - ls $SKETCHBOOK_FOLDER -la
  47. - ls $SKETCHBOOK_FOLDER/libraries -la
  48. - pwd
  49. # what the fsck is wrong install_package() ??
  50. - install_package "esp32:esp32" "https://dl.espressif.com/dl/package_esp32_index.json" # # esp32:esp32:m5stack-core-esp32
  51. #- /home/travis/arduino-ide/arduino-1.8.10/arduino --pref "compiler.warning_level=none" --save-prefs &>/dev/null
  52. #- /home/travis/arduino-ide/arduino-1.8.10/arduino --pref "build.warn_data_percentage=75" --save-prefs &>/dev/null
  53. #- /home/travis/arduino-ide/arduino-1.8.10/arduino --pref "boardsmanager.additional.urls=https://dl.espressif.com/dl/package_esp32_index.json" --save-prefs &>/dev/null
  54. #- /home/travis/arduino-ide/arduino-1.8.10/arduino --install-boards esp32:esp32 &>/dev/null
  55. - pip install pyserial
  56. script:
  57. # Compile all example sketches included with the library
  58. # build_sketch arguments: sketch name, fqbn, allow failure, IDE version/list/range
  59. - check_library_manager_compliance "$TRAVIS_BUILD_DIR"
  60. - build_sketch "${TRAVIS_BUILD_DIR}/examples/M5Stack-SD-Menu/M5Stack-SD-Menu.ino" "esp32:esp32:m5stack-core-esp32:FlashFreq=80,UploadSpeed=921600" "false" "newest"
  61. after_script:
  62. # Commit a report of the job results to the CI-reports repository
  63. - USER_NAME="$(echo "$TRAVIS_REPO_SLUG" | cut -d'/' -f 1)"
  64. - REPOSITORY_NAME="$(echo "$TRAVIS_REPO_SLUG" | cut -d'/' -f 2)"
  65. - publish_report_to_repository "$REPORT_GITHUB_TOKEN" "https://github.com/${USER_NAME}/CI-reports.git" "$REPOSITORY_NAME" "build_$(printf "%05d\n" "${TRAVIS_BUILD_NUMBER}")" "false"
  66. # Print a tab separated report of all sketch verification results to the log
  67. - display_report
  68. notifications:
  69. email:
  70. on_success: always
  71. on_failure: always
  72. webhooks:
  73. urls:
  74. - https://www.travisbuddy.com/
  75. on_success: never
  76. on_failure: always