forked from fossology/fossology
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
178 lines (164 loc) · 6.55 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Copyright Siemens AG, 2014-2017
# SPDX-License-Identifier: GPL-2.0 LGPL-2.1
# build FOSSology on Travis CI - https://travis-ci.org/
language: php
dist: trusty
php:
- '5.6'
addons:
- postgresql: "9.3"
cache:
- apt
sudo: required
services:
- docker
install:
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
- sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main'
- sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main'
- sudo apt-get update -qq
- apt-cache --names-only search '^(gcc|clang)-[0-9.]+$'
- sudo apt-get install -q -y debhelper libglib2.0-dev libmagic-dev libxml2-dev
libtext-template-perl librpm-dev rpm libpcre3-dev libssl-dev
apache2 libapache2-mod-php5 php5-pgsql php-pear php5-cli
binutils bzip2 cabextract cpio sleuthkit genisoimage poppler-utils
rpm upx-ucl unrar-free unzip p7zip-full p7zip wget git-core subversion
libpq-dev libcunit1-dev libcppunit-dev
libboost-regex-dev libboost-program-options-dev
liblocal-lib-perl libspreadsheet-writeexcel-perl libdbd-sqlite3-perl
- sudo apt-get install -q -y --allow-unauthenticated $CXX $CC || sudo apt-get install -q -y --allow-unauthenticated $CC
- sudo apt-get install -q -y cppcheck
- ( cd src && composer install --dev )
- install/scripts/install-spdx-tools.sh
- install/scripts/install-ninka.sh
before_script:
- sudo mkdir -p /var/local/cache/fossology
- sudo chown $(whoami) /var/local/cache/fossology
- psql -c "CREATE USER fossy WITH PASSWORD 'fossy' CREATEDB;" -U postgres
- psql -c "create database fossology;" -U postgres
env:
global:
- PHPTESTSUITE=''
- CHECKBEFORE='cppcheck -q -isrc/nomos/agent_tests/testdata/NomosTestfiles/ -isrc/testing/dataFiles/ src/'
- MAKETARGETS='all test-lib'
script:
- set -e
- src/testing/syntax/syntaxtest.sh
- if [[ ! -z "$CHECKBEFORE" ]]; then $CHECKBEFORE; fi
- if [[ ! -z "$MAKETARGETS" ]]; then make $MAKETARGETS; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.5" ]]; then composer require --dev --no-update phpunit/phpunit ~4; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.6" ]]; then composer require --no-update phpunit/phpunit ~5; fi
- if [[ ! -z "$PHPTESTSUITE" ]]; then phpunit -csrc/phpunit.xml --testsuite="$PHPTESTSUITE"; fi
- set +e
after_script:
- mkdir -p build/logs
- php src/vendor/bin/coveralls -vv -x clover.xml
matrix:
include:
################################################################################
## general tests
- env: TEST=default-docker-test
before_script:
install:
script:
- src/testing/docker/default-docker-test.sh
after_script:
- env: TEST=docker-compose-test
before_script:
install:
script: src/testing/docker/docker-compose-test.sh
after_script:
################################################################################
## C/C++ and phpunit agent tests
#### with PHP 5.6
- env: CC=gcc CXX=g++ MAKETARGETS='all test-lib test-monk test-nomos'
after_script:
- env: CC=clang-3.6 CXX=clang++-3.6 MAKETARGETS='all test-lib test-monk test-nomos'
after_script:
- env: CC=gcc-4.6 CXX=g++-4.6 MAKETARGETS='all test-lib test-monk test-nomos'
after_script:
- env: CC=gcc-4.8 CXX=g++-4.8 MAKETARGETS='all test-lib test-monk test-nomos'
after_script:
- env: CC=gcc-4.9 CXX=g++-4.9 MAKETARGETS='all test-lib test-monk test-nomos'
after_script:
- env: CC=gcc-5 CXX=g++-5 MAKETARGETS='all test-lib test-monk test-nomos'
after_script:
- env: CC=gcc-5 CXX=g++-5 CFLAGS='-Wall -Werror'
after_script:
- env: CC=clang-3.6 CXX=clang++-3.6 CFLAGS='-Wall -Werror -Wno-error=deprecated-register'
after_script:
#### with PHP 7.0
- php: 7.0
env: CC=gcc CXX=g++ MAKETARGETS='all test-lib test-monk test-nomos'
after_script:
- php: 7.0
env: CC=clang-3.6 CXX=clang++-3.6 MAKETARGETS='all test-lib test-monk test-nomos'
6after_script:
- php: 7.0
env: CC=gcc-5 CXX=g++-5 MAKETARGETS='all test-lib test-monk test-nomos'
after_script:
- php: 7.0
env: CC=gcc-5 CXX=g++-5 CFLAGS='-Wall -Werror'
after_script:
#### with PHP 7.1
- php: 7.1 # allowed failure
env: CC=gcc CXX=g++ MAKETARGETS='all test-lib test-monk test-nomos'
after_script:
- php: 7.1 # allowed failure
env: CC=clang-3.6 CXX=clang++-3.6 MAKETARGETS='all test-lib test-monk test-nomos'
6after_script:
- php: 7.1 # allowed failure
env: CC=gcc-5 CXX=g++-5 MAKETARGETS='all test-lib test-monk test-nomos'
after_script:
- php: 7.1 # allowed failure
env: CC=gcc-5 CXX=g++-5 CFLAGS='-Wall -Werror'
after_script:
################################################################################
## PHP tests
#### PHP: PhpUnit Tests
- php: 5.5
env:
PHPTESTSUITE='Fossology PhpUnit Test Suite'
CHECKBEFORE=''
MAKETARGETS='build-lib VERSIONFILE build-cli'
- php: 5.6
env:
PHPTESTSUITE='Fossology PhpUnit Test Suite'
CHECKBEFORE=''
MAKETARGETS='build-lib VERSIONFILE build-cli'
- php: 7.0
env:
PHPTESTSUITE='Fossology PhpUnit Test Suite'
CHECKBEFORE=''
MAKETARGETS='build-lib VERSIONFILE build-cli'
- php: 7.1
env:
PHPTESTSUITE='Fossology PhpUnit Test Suite'
CHECKBEFORE=''
MAKETARGETS='build-lib VERSIONFILE build-cli'
#### PHP: phpcpd
- script: # allowed failure
- src/vendor/bin/phpcpd src/cli/ src/copyright/ src/decider*/ src/lib/ src/monk/ src/nomos/ src/readmeoss/ src/spdx2/ src/www/
after_script:
################################################################################
allow_failures:
- php: 7.1
env: CC=gcc CXX=g++ MAKETARGETS='all test-lib test-monk test-nomos'
after_script:
- php: 7.1
env: CC=clang-3.6 CXX=clang++-3.6 MAKETARGETS='all test-lib test-monk test-nomos'
6after_script:
- php: 7.1
env: CC=gcc-5 CXX=g++-5 MAKETARGETS='all test-lib test-monk test-nomos'
after_script:
- php: 7.1
env: CC=gcc-5 CXX=g++-5 CFLAGS='-Wall -Werror'
after_script:
- script:
- src/vendor/bin/phpcpd src/cli/ src/copyright/ src/decider*/ src/lib/ src/monk/ src/nomos/ src/readmeoss/ src/spdx2/ src/www/
after_script:
- php: 7.1
env:
PHPTESTSUITE='Fossology PhpUnit Test Suite'
CHECKBEFORE=''
MAKETARGETS='build-lib VERSIONFILE build-cli'