forked from arximboldi/lager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
67 lines (61 loc) · 1.69 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
language: nix
dist: trusty
matrix:
include:
- env: DO=check TYPE=Debug COVERAGE=true
- env: DO=check TYPE=Release
- env: DO=build
- env: DO=docs
before_install:
- |
: ${TYPE:=Debug}
function build-p { [[ "${DO}" == build ]]; }
function check-p { [[ "${DO}" == check ]]; }
function docs-p { [[ "${DO}" == docs ]]; }
function coverage-p { [[ "${COVERAGE}" == true ]]; }
function deploy-p {
[[ "${TRAVIS_PULL_REQUEST}" == "false" && \
"${TRAVIS_BRANCH}" == "master" ]]
}
function upload-p {
[[ -n "$encrypted_158188634a82_key" && \
-n "$encrypted_158188634a82_iv" ]]
}
function decrypt-ssh-key {
openssl aes-256-cbc \
-K $encrypted_158188634a82_key \
-iv $encrypted_158188634a82_iv \
-in tools/travis/ssh-key.enc \
-out tools/travis/ssh-key -d
chmod 600 tools/travis/ssh-key
}
function with-nix {
nix-shell --run "set -e; $1"
}
install:
- with-nix "echo == nix environment ok"
before_script:
- |
with-nix "
mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=${TYPE} \
-DENABLE_COVERAGE=${COVERAGE}
"
script:
- |
set -e
! build-p || nix-build
! check-p || with-nix "cd build && make -j2 check"
! docs-p || with-nix "cd build && make docs"
after_success:
- |
! coverage-p || with-nix "
cd build
find . -name \"*.gcno\" | xargs gcov -bcprs ${PWD} &> /dev/null
bash <(curl -s https://codecov.io/bash) -x gcov
"
if upload-p; then
decrypt-ssh-key
! docs-p || ! deploy-p || with-nix "cd build && make upload-docs"
fi