forked from AliceO2Group/QualityControl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
61 lines (61 loc) · 1.82 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
language: cpp
matrix:
include:
- os: linux
dist: xenial
env: TOOL=clang-format
addons:
apt:
sources:
- llvm-toolchain-xenial-7
packages:
- clang-format-7
compiler: clang
- os: linux
if: branch = master
dist: xenial
env: TOOL=docs
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- cmake
- doxygen
- doxygen-doc
- doxygen-latex
- doxygen-gui
- graphviz
deploy:
provider: pages
skip_cleanup: true
github_token: $GITHUB_API_TOKEN
local_dir: build/doc/html
script:
- if [[ $TOOL == "clang-format" ]] && [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
cd $TRAVIS_BUILD_DIR;
BASE_COMMIT=$(git rev-parse $TRAVIS_BRANCH);
COMMIT_FILES=$(git diff --name-only $BASE_COMMIT | grep -i -v LinkDef);
RESULT_OUTPUT="$(git-clang-format-7 --commit $BASE_COMMIT --diff --binary `which clang-format-7` $COMMIT_FILES)";
if [ "$RESULT_OUTPUT" == "no modified files to format" ] || [ "$RESULT_OUTPUT" == "clang-format did not modify any files" ] ; then
exit 0;
else
echo "$RESULT_OUTPUT";
exit 1;
fi
fi
- if [[ $TOOL == "docs" ]]; then
echo "cmake_minimum_required(VERSION 3.12)" > CMakeLists.txt-new;
echo "cmake_policy(VERSION 3.12)" >> CMakeLists.txt-new;
cat CMakeLists.txt | awk '/# ---- Project ----/,/# ---- End Project ----/';
cat CMakeLists.txt | awk '/# ---- Project ----/,/# ---- End Project ----/' >> CMakeLists.txt-new;
echo "add_subdirectory(doc)" >> CMakeLists.txt-new;
cat CMakeLists.txt-new;
mv CMakeLists.txt-new CMakeLists.txt;
mkdir build;
cd build;
cmake ..;
make doc;
fi
notifications:
email: false