forked from Megunolink/ArduinoCrashMonitor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
84 lines (66 loc) · 4.26 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# This file is used to configure the Travis CI tests of this library
# Although sudo is not required by arduino-ci-script, I've experienced that setting "sudo: false" can cause the Travis CI build time to significantly increase for some reason so this setting is left as "sudo: required"
sudo: required
env:
global:
# The Arduino IDE will be installed at APPLICATION_FOLDER/arduino
- APPLICATION_FOLDER="${HOME}/arduino-ide"
- SKETCHBOOK_FOLDER="${HOME}/arduino-sketchbook"
before_install:
# Formatting checks:
# Check for files starting with a blank line
- find . -path ./.git -prune -o -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'
# Check for tabs
- "if grep --line-number --recursive --binary-files=without-match --exclude-dir=.git --exclude=keywords.txt --regexp=$'\t' .; then echo 'Tab found.'; false; fi"
# Check for trailing whitespace
- "if grep --line-number --recursive --binary-files=without-match --exclude-dir=.git --regexp='[[:blank:]]$' .; then echo 'Trailing whitespace found.'; false; fi"
# Check for non-Unix line endings
- "if grep --files-with-matches --recursive --binary-files=without-match --exclude-dir=.git --regexp=$'\r$' .; then echo 'Non-Unix EOL detected.'; false; fi"
# Check for blank lines at end of files
- find . -path ./.git -prune -o -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 . -path ./.git -prune -o -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'
# Check for typos
- git clone https://github.com/ss18/grep-typos.git "${HOME}/scripts/grep-typos"
- find "$TRAVIS_BUILD_DIR" -path "${TRAVIS_BUILD_DIR}/.git" -prune -or -type f -print0 | xargs --null --max-args=1 bash "${HOME}/scripts/grep-typos/grep_typos.sh" "$0"
- rm "${HOME}/scripts/grep-typos" --recursive --force
- git clone https://github.com/per1234/arduino-ci-script.git "${HOME}/scripts/arduino-ci-script"
- cd "${HOME}/scripts/arduino-ci-script"
# Get new tags from the remote
- git fetch --tags
# Checkout the latest tag
- git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
- source "${HOME}/scripts/arduino-ci-script/arduino-ci-script.sh"
# Uncomment the following lines to get verbose output for debugging
# 0 (minimum/default) - 2 (maximum) verbosity
#- set_script_verbosity 2
# Turn on verbose output during compilation
#- set_verbose_output_during_compilation "true"
# Check for library issues that don't affect compilation
- set_library_testing "true"
- set_application_folder "$APPLICATION_FOLDER"
- set_sketchbook_folder "$SKETCHBOOK_FOLDER"
# The EEPROM v2.0 library, which is required by the examples, was added in Arduino IDE 1.6.2, but that version doesn't play nicely with other versions so I'm testing with 1.6.3 and newer
- install_ide '("1.6.5-r5" "1.6.9" "1.6.13" "1.8.5" "newest")'
# Install the library from the repository
- install_library
script:
# Compile all example sketches included with the library
# build_sketch arguments: sketch name, fqbn, allow failure, IDE version/list/range
- build_sketch "${SKETCHBOOK_FOLDER}/libraries/WatchdogLog/examples" "arduino:avr:uno" "false" "oldest" "newest"
after_script:
# Commit a report of the job results to the CI-reports repository
- USER_NAME="$(echo "$TRAVIS_REPO_SLUG" | cut -d'/' -f 1)"
- REPOSITORY_NAME="$(echo "$TRAVIS_REPO_SLUG" | cut -d'/' -f 2)"
- 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"
# Print a tab separated report of all sketch verification results to the log
- display_report
notifications:
email:
on_success: always
on_failure: always
webhooks:
urls:
- https://www.travisbuddy.com/
on_success: never
on_failure: always