forked from crankyoldgit/IRremoteESP8266
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
51 lines (51 loc) · 2.31 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
language: c
env:
- PLATFORMIO_BUILD_CACHE_DIR="../../.pio/buildcache"
cache:
directories:
- "~/.platformio"
before_install:
- wget https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py
install:
- sudo apt-get install jq
- sudo apt-get purge python-enum34
- sudo apt-get install pylint3
- sudo pip install platformio
- pio update
script: echo Running checks
notifications:
email:
on_success: change
on_failure: change
jobs:
include:
- name: "Compile the trivial examples"
script:
# Check that everything compiles but some heavy tasks e.g. IRMQTTServer & IRrecvDumpV2
# i.e. We are splitting the work load in to parallel tasks.
- find . -regextype egrep -name platformio.ini -type f \! -regex ".*IR(MQTTServer|recvDumpV2).*" | sed 's,/platformio.ini$,,' | xargs -n 1 pio run --project-dir
- name: "Compile the complex examples"
script:
# Check that everything else compiles.
# i.e. We are splitting the work load in to parallel tasks.
- find . -regextype egrep -name platformio.ini -type f -regex ".*IR(MQTTServer|recvDumpV2).*" | sed 's,/platformio.ini$,,' | xargs -n 1 pio run --project-dir
- name: "Unit tests & Linter checks"
script:
# Run all the Tests & check the code linters have no issues.
# i.e. We are splitting the work load in to parallel tasks.
# Check the version numbers match.
- LIB_VERSION=$(egrep "^#define\s+_IRREMOTEESP8266_VERSION_\s+" src/IRremoteESP8266.h | cut -d\" -f2)
- test ${LIB_VERSION} == "$(jq -r .version library.json)"
- grep -q "^version=${LIB_VERSION}$" library.properties
# Check the tools programs compile.
- (cd tools; make all)
# Check for lint issues.
- shopt -s nullglob
- python cpplint.py --extensions=c,cc,cpp,ino --headers=h,hpp {src,src/locale,test,tools}/*.{h,c,cc,cpp,hpp,ino} examples/*/*.{h,c,cc,cpp,hpp,ino}
- pylint3 -d F0001 {src,test,tools}/*.py
- shopt -u nullglob
# Build and run the unit tests.
- (cd test; make run)
- (cd tools; make run_tests)
# Check that every example directory has a platformio.ini file.
- (status=0; for dir in examples/*; do if [[ ! -f "${dir}/platformio.ini" ]]; then echo "${dir} has no 'platform.ini' file!"; status=1; fi; done; exit ${status})