forked from volkszaehler/vzlogger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
107 lines (98 loc) · 3.11 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
sudo: required
dist: bionic
language: cpp
addons:
apt:
packages:
- clang-format
matrix:
include:
- env: BUILD=1 CTEST_OUTPUT_ON_FAILURE=1 USE_GCC8=1
compiler: clang
- env: BUILD=1 CTEST_OUTPUT_ON_FAILURE=1 USE_GCC8=1
compiler: gcc
- env: BUILD=1 CTEST_OUTPUT_ON_FAILURE=1 USE_GCC8=0
compiler: gcc
- env: FORMAT=1
before_install:
- clang-format --version
install:
- |
export installDir=$(pwd);
echo "Install dir =$installDir";
if [ -n "$BUILD" ]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update -qq
if [ "$USE_GCC8" = "1" ]; then sudo apt-get install -y -qq g++-8; export CXX="g++-8" CC="gcc-8"; fi
$CXX --version
# install json-c
sudo apt-get install -y build-essential
sudo apt-get install -y wget
sudo apt-get install -y libtool
git clone -b json-c-0.12 https://github.com/json-c/json-c
cd json-c
sh autogen.sh
./configure
make
sudo make install
cd ..
sudo apt-get install -y libcurl4-openssl-dev openssl libmicrohttpd-dev uuid-dev uuid-runtime libunistring-dev
# -- get libsml --
git clone https://github.com/volkszaehler/libsml.git # or github.com/TheCount/libsml.git # or https://github.com/dailab/libsml.git
cd libsml
# git checkout develop # only dev branch seems to work
make
# -- install libsml --
sudo cp sml/lib/libsml.* /usr/lib/.
sudo cp -R sml/include/* /usr/include/.
sudo cp sml.pc /usr/lib/pkgconfig/.
cd ..
# -- install leptonica
sudo apt-get install -y libpng-dev libtiff-dev
wget https://github.com/DanBloomberg/leptonica/releases/download/1.79.0/leptonica-1.79.0.tar.gz
tar -zxvf leptonica-1.79.0.tar.gz
if [ -d leptonica-1.79.0 ]; then
cd leptonica-1.79.0
./configure --disable-programs
make
sudo make install
sudo ldconfig
cd ..
fi
# -- install libmbus
git clone https://github.com/rscada/libmbus
cd libmbus
./build.sh
sudo make install
cd ..
sudo apt-get install -y lcov
# -- install libmosquitto-dev
sudo add-apt-repository ppa:mosquitto-dev/mosquitto-ppa -y
sudo apt-get update -qq
sudo apt-get install -qq libmosquitto-dev
fi
script:
- pwd
- ls
- echo BUILD=$BUILD
- echo FORMAT=$FORMAT
- if [ -n "$BUILD" ]; then
echo "Executing build... in $installDir";
cd $installDir;
mkdir -p build;
cd build;
cmake .. -DMETEREXEC_ROOTACCESS=OFF -DENABLE_OCR=ON -DSML_HOME=/usr/local/src/libsml/sml && make && make test;
fi
- if [ -n "$FORMAT" ]; then
echo "Executing clang-format check... in $installDir";
cd $installDir;
pwd;
clang-format --version;
git --version;
find include src tests -type f -name '*.h' -o -name '*.cpp' -o -name '*.hpp' | xargs -I{} -P1 clang-format -i -style=file {} ;
echo "Git status after clang-format:";
git status --porcelain;
echo "Git diff:";
git diff;
test -z "$(git status --porcelain)" || (git status; git diff; false)
fi