-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
59 lines (50 loc) · 3.61 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
# This file is used to configure the Travis CI tests for this repository
matrix:
include:
- name: 'Unit Tests'
language: python
python: 3.6
script:
- git clone --depth 1 https://github.com/per1234/inoliblist.git "${TRAVIS_BUILD_DIR}/../inoliblist"
- python "${TRAVIS_BUILD_DIR}/tests/test_inolibbuglist.py" --ghtoken $GITHUB_TOKEN --github_login per1234 --browser_command "\"/c/Program Files/Mozilla Firefox/firefox.exe\" -new-tab" --arduino_ci_script_branch master --arduino_ci_script_application_folder "${HOME}" --arduino_ci_script_arduino_ide_version "1.8.6"
- name: 'PEP8 Compliance Check'
language: python
python: 3.6
before_install:
- pip install pycodestyle
script:
- find "${TRAVIS_BUILD_DIR}" -path "${TRAVIS_BUILD_DIR}/.git" -prune -or -name '*.py' -exec pycodestyle {} +
- name: 'File Formatting Checks'
language: minimal
script:
# Check for UTF-8 BOM file encoding
- find "${TRAVIS_BUILD_DIR}" -path "${TRAVIS_BUILD_DIR}/.git" -prune -or -type f -exec grep --files-with-matches --binary-files=without-match $'\xEF\xBB\xBF' '{}' \; -exec echo 'UTF-8 BOM encoding detected.' \; -exec false '{}' +
# Check for files starting with a blank line
- find "${TRAVIS_BUILD_DIR}" -path "${TRAVIS_BUILD_DIR}/.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'
# Check for tabs
- find "${TRAVIS_BUILD_DIR}" -path "${TRAVIS_BUILD_DIR}/.git" -prune -or \( -not -name '*.csv' -and -type f \) -exec grep --with-filename --line-number --binary-files=without-match --regexp=$'\t' '{}' \; -exec echo 'Tab found.' \; -exec false '{}' +
# Check for trailing whitespace
- find "${TRAVIS_BUILD_DIR}" -path "${TRAVIS_BUILD_DIR}/.git" -prune -or \( -not -name '*.csv' -and -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 "${TRAVIS_BUILD_DIR}" -path "${TRAVIS_BUILD_DIR}/.git" -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 "${TRAVIS_BUILD_DIR}" -path "${TRAVIS_BUILD_DIR}/.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'
# Check for files that don't end in a newline (https://stackoverflow.com/a/25686825)
- find "${TRAVIS_BUILD_DIR}" -path "${TRAVIS_BUILD_DIR}/.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'
- name: 'Spell Check'
language: python
python: 3.6
before_install:
- pip install codespell
script:
- codespell --skip="${TRAVIS_BUILD_DIR}/.git" --ignore-words="${TRAVIS_BUILD_DIR}/etc/codespell-ignore-words-list.txt" "${TRAVIS_BUILD_DIR}"
notifications:
email:
on_success: always
on_failure: always
webhooks:
urls:
# Use TravisBuddy to automatically comment on any pull request that results in a failed CI build
- https://www.travisbuddy.com/
on_success: never
on_failure: always