-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
.travis.yml
127 lines (108 loc) · 6.73 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
language: python
python: 3.6
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:
# TODO: undo
# remove submodules, we don't want those to be actually tested for compliance
- git submodule status | rm -Rf `cut -d ' ' -f 3`
# 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'
# 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 '{}' +
# 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 '{}' +
# 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 '{}' +
# 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'
# 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'
- 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"
#- set_script_verbosity 1
#- 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"
#- install_ide '("1.8.0" "1.8.10" "1.8.11")'
- install_ide '("newest")'
# Install the library from the repository
- install_library "ESP32-Chimera-Core"
#- install_library https://github.com/tobozo/ESP32-Chimera-Core/archive/Touch.zip
- install_library https://github.com/PaulStoffregen/Time/archive/master.zip
- install_library "LovyanGFX"
- install_library "M5Stack-SD-Updater"
- install_library Sqlite3Esp32
- install_library https://github.com/mikalhart/TinyGPSPlus/archive/master.zip
- install_library "NimBLE-Arduino"
#- install_library https://github.com/tobozo/ESP32-BLECollector/releases/download/1.3/BLE.zip
#- install_library https://github.com/tobozo/NimBLE-Arduino/archive/master.zip
- install_package "esp32:esp32" "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json"
- pip install pyserial
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"
# compile at least one basic example
- set_ide_preference "compiler.warning_level=auto"
- mkdir "/tmp/BLECollector-binaries"
- mkdir "/tmp/m5stack"
- mkdir "/tmp/odroidgo"
- mkdir "/tmp/m5fire"
- mkdir "/tmp/m5core2"
#- set_ide_preference "custom_PartitionScheme=min_spiffs"
- set_ide_preference "build.path=/tmp/m5stack"
- build_sketch "${TRAVIS_BUILD_DIR}/ESP32-BLECollector.ino" "esp32:esp32:m5stack-core-esp32:PartitionScheme=min_spiffs" "false" "newest"
- cp "/tmp/m5stack/ESP32-BLECollector.ino.bin" "/tmp/BLECollector-binaries/M5stack-BLECollector.bin"
- set_ide_preference "build.path=/tmp/odroidgo"
- build_sketch "${TRAVIS_BUILD_DIR}/ESP32-BLECollector.ino" "esp32:esp32:odroid_esp32:PartitionScheme=min_spiffs" "false" "newest"
- cp "/tmp/odroidgo/ESP32-BLECollector.ino.bin" "/tmp/BLECollector-binaries/OdroidGo-BLECollector.bin"
- set_ide_preference "build.path=/tmp/m5fire"
- build_sketch "${TRAVIS_BUILD_DIR}/ESP32-BLECollector.ino" "esp32:esp32:m5stack-fire:PartitionScheme=default" "false" "newest"
- cp "/tmp/m5fire/ESP32-BLECollector.ino.bin" "/tmp/BLECollector-binaries/M5Fire-BLECollector.bin"
- set_ide_preference "build.path=/tmp/m5core2"
- build_sketch "${TRAVIS_BUILD_DIR}/ESP32-BLECollector.ino" "esp32:esp32:m5stack-core2:PartitionScheme=default" "false" "newest"
- cp "/tmp/m5core2/ESP32-BLECollector.ino.bin" "/tmp/BLECollector-binaries/M5Core2-BLECollector.bin"
- ls /tmp/BLECollector-binaries -la
#- 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
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
deploy:
- provider: releases
api_key: "${GH_TOKEN}"
file:
- "/tmp/BLECollector-binaries/M5stack-BLECollector.bin"
- "/tmp/BLECollector-binaries/OdroidGo-BLECollector.bin"
- "/tmp/BLECollector-binaries/M5Fire-BLECollector.bin"
- "/tmp/BLECollector-binaries/M5Core2-BLECollector.bin"
skip_cleanup: true
draft: true
on:
branch: master