forked from crankyoldgit/IRremoteESP8266
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
69 lines (69 loc) · 3.25 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
language: c
addons:
apt:
packages:
- jq
- doxygen
- graphviz
- python3
- python3-pip
- pylint3
- python3-setuptools
env:
- PLATFORMIO_BUILD_CACHE_DIR="../../.pio/buildcache"
IRRECVDUMP_RE=".*IRrecvDumpV.*"
IRMQTTSERVER_RE=".*IRMQTTServer.*"
MAKEFLAGS="-j 2"
cache:
directories:
- "~/.platformio"
before_install:
- wget https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py
- python --version && pip --version
- python3 --version && pip3 --version
- sudo pip3 install -U 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 "${IRRECVDUMP_RE}|${IRMQTTSERVER_RE}" | sed 's,/platformio.ini$,,' | xargs --verbose -n 1 pio run --jobs 2 --project-dir
- name: "Compile the IRrecvDumpV2+ examples"
script:
# Check that IRrecvDumpV2+ compiles.
# i.e. We are splitting the work load in to parallel tasks.
- find . -regextype egrep -name platformio.ini -type f -regex "${IRRECVDUMP_RE}" | sed 's,/platformio.ini$,,' | xargs --verbose -n 1 pio run --jobs 2 --project-dir
- name: "Unit tests, Linter, Doc checks, & Compile IRMQTTServer"
script:
# Run all the Tests & check the code linters have no issues, and that
# IRMQTTServer compiles.
# 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})
# Check that doxygen completes without errors or warnings.
- (DOXYGEN_OUTPUT=$(doxygen 2>&1); if [[ $? -ne 0 || -n "${DOXYGEN_OUTPUT}" ]]; then echo "${DOXYGEN_OUTPUT}"; exit 1; fi)
# Check that all files has supported sections.
- (SUPPORTED_OUTPUT=$(python3 tools/scrape_supported_devices.py --noout --alert 2>&1); if [[ $? -ne 0 || -n "${SUPPORTED_OUTPUT}" ]]; then echo "${SUPPORTED_OUTPUT}"; exit 1; fi)
# Check that IRMQTTServer compiles.
- find . -regextype egrep -name platformio.ini -type f -regex "${IRMQTTSERVER_RE}" | sed 's,/platformio.ini$,,' | xargs --verbose -n 1 pio run --jobs 2 --project-dir