forked from Ericsson/codechecker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
162 lines (148 loc) · 6.29 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
language:
- python
services:
- postgresql
matrix:
include:
- os: linux
name: "Analyzer, web (sqlite, psycopg2, pg8000) and tools test cases."
sudo: required
dist: bionic
python: "3.6"
env: CC_MODULE=analyzer
- os: linux
name: "Server/client test cases (sqlite)"
sudo: required
dist: bionic
python: "3.6"
env: DATABASE=sqlite
- os: linux
name: "Server/client test cases (psycopg2)"
sudo: required
dist: bionic
python: "3.6"
env: DATABASE=psql_psycopg2
- os: linux
name: "Server/client test cases (pg8000)"
sudo: required
dist: bionic
python: "3.6"
env: DATABASE=psql_pg8000
- os: osx
osx_image: xcode10
name: "Analyzer test cases"
sudo: false
language: generic
env: CC_MODULE=analyzer
- os: osx
osx_image: xcode10
name: "Server/client test cases (sqlite)"
sudo: false
language: generic
env: DATABASE=sqlite
- os: osx
osx_image: xcode10
name: "Server/client test cases (psycopg2)"
sudo: false
language: generic
env:
- DATABASE=psql_psycopg2
- POSTGRESQL_VERSION=9.6
- os: osx
osx_image: xcode10
name: "Analyzer, web (sqlite, psycopg2, pg8000) and tools test cases."
sudo: false
language: generic
env:
- DATABASE=psql_pg8000
- POSTGRESQL_VERSION=9.6
before_install:
# Download macOS specific extra dependencies.
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then git clone https://github.com/llvm-mirror/clang.git ~/llvm --branch master --single-branch --depth 1; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update-reset; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install doxygen; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install llvm@9; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH=/usr/local/opt/llvm@9/bin:$PATH; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PYTHONPATH=~/llvm/tools/scan-build-py/; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH=~/llvm/tools/scan-build-py/bin:$PATH; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then chmod a+x ~/llvm/tools/scan-build-py/bin/intercept-build; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then which clang; which clang-tidy; fi
# Set the proper Clang versions early in the PATH.
- export PATH=$HOME:$PATH
# PostgreSQL is not started automatically on macOS.
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then rm -rf /usr/local/var/postgres; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then initdb /usr/local/var/postgres; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew services start postgres; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then while ! pg_isready; do sleep 1; done; createuser -s postgres; fi
install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip3 install --ignore-installed nose --user; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH=/Users/travis/Library/Python/3.7/bin:$PATH; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip3 install virtualenv; fi
# Remove clang symlinks from the travis base install.
# The update-alternatives changes will not change the used clang version without this.
# /usr/local is searched for clang binaries before the /usr/bin direcory.
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo rm -rf /usr/local/clang-*; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 9999; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 9999; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-9 9999; fi
# Check if the right clang and clang-tidy is used
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then update-alternatives --display clang; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then update-alternatives --display clang++; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then update-alternatives --display clang-tidy; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then which clang++; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then which clang; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then which clang-tidy; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then clang++ --version; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then clang --version; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then clang-tidy --version; fi
# Run brew cleanup at before_cache stage otherwise, the cache will grow
# indefinitely as new package versions are released.
before_cache:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew cleanup; fi
- rm -f $HOME/.cache/pip/log/debug.log
# Cache downloaded bottles (binary packages) to speed up our build process.
# See: https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci
cache:
directories:
- $HOME/Library/Caches/Homebrew
- $HOME/.cache/pip
addons:
apt:
sources:
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- sourceline: 'deb-src http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
packages:
- g++-6
- doxygen
- gcc-multilib
- libc6-dev-i386
- libpq-dev
- thrift-compiler
- clang-9
- clang-tidy-9
postgresql: "9.6"
script:
- >
make pip_dev_deps &&
make pycodestyle &&
make pylint &&
make clean_travis &&
make package &&
make -C tools/plist_to_html test &&
make -C tools/report-converter package test &&
make -C tools/codechecker_report_hash test &&
if [[ "$CC_MODULE" = "analyzer" ]]; then
BUILD_DIR=$TRAVIS_BUILD_DIR/build make -C analyzer \
test_unit \
test_functional \
test_tu_collector &&
if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then
make -C analyzer test_build_logger
fi
elif [[ ! -z "$DATABASE" ]]; then
make -C web test_matrix_${DATABASE}
else
make test
fi