forked from lensfun/lensfun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
95 lines (95 loc) · 2.63 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
language: cpp
cache: ccache
os:
- linux
- osx
dist: xenial
osx_image: xcode11
compiler:
- clang
- gcc
addons:
apt:
packages:
- cmake
- doxygen
- libpng-dev
- libxml2-utils
- llvm
- clang
- docutils-common
- libomp-dev
- lcov
homebrew:
packages:
- doxygen
- glib
- libpng
- libxml2
- ccache
- libomp
notifications:
webhooks:
- https://coveralls.io/webhook
env:
global:
- COVERALLS_PARALLEL=true
matrix:
- build_type=Release
- build_type=Release CMAKE_EFLAGS="-DBUILD_STATIC=ON -DBUILD_LENSTOOL=ON"
- build_type=Debug
- build_type=Debug CMAKE_EFLAGS="-DBUILD_STATIC=ON -DBUILD_LENSTOOL=ON"
- build_type=Coverage
stages:
- name: test
- name: docs
before_install:
- "sudo chown -R travis: $HOME/.ccache"
- mkdir -p $TRAVIS_BUILD_DIR/build
install:
- pip install --user cpp-coveralls docutils
- export PATH=/Users/travis/Library/Python/2.7/bin:${PATH}
script:
- cd $TRAVIS_BUILD_DIR/build
- cmake $TRAVIS_BUILD_DIR -G"${generator:-Unix Makefiles}" -DCMAKE_BUILD_TYPE=${build_type:-Release} -DBUILD_TESTS=ON -DBUILD_DOC=ON ${CMAKE_EFLAGS[@]}
- cmake -j $(if [ $TRAVIS_OS_NAME = osx ]; then sysctl -n hw.ncpu; else nproc; fi) --build .
- sudo cmake --build . --target install
- cmake --build . --target docs
- ctest
after_script: |-
if [[ "$build_type" = "Coverage" ]]; then
if [ $CC = "clang" ] && [ $TRAVIS_OS_NAME = linux ]; then
GCOV_FILE=llvm-cov GCOV_OPTIONS='gcov -pl'
else
GCOV_FILE=gcov GCOV_OPTIONS='\-lp'
fi
coveralls --root $TRAVIS_BUILD_DIR -E "build" --gcov $GCOV_FILE --gcov-options "$GCOV_OPTIONS"
fi
before_cache:
- "sudo chown -R travis: $HOME/.ccache"
matrix:
exclude:
- os: osx
compiler: gcc # gcc = clang in macOS, unecessary duplicate
include:
- name: docs
if: repo = lensfun/lensfun AND branch = master
stage: docs
os: linux
dist: xenial
before_deploy:
- git clone https://github.com/lensfun/lensfun.github.io.git $TRAVIS_BUILD_DIR/lensfun_doc
- cd $TRAVIS_BUILD_DIR/lensfun_doc
- rm -rf manual/latest && mkdir manual/latest
- cp $TRAVIS_BUILD_DIR/build/doc_doxygen/* $TRAVIS_BUILD_DIR/lensfun_doc/manual/latest/
deploy:
provider: pages
local_dir: $TRAVIS_BUILD_DIR/lensfun_doc
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
keep_history: true
repo: lensfun/lensfun.github.io
target_branch: master
on:
repo: lensfun/lensfun
branch: master