-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
134 lines (113 loc) · 4.48 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
sudo: required
dist: xenial
services:
- mysql
language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
env:
matrix:
- R=3.0.2
- R=3.4
- R=3.5
global:
- PHPUNIT=3.7.33
R=3.2.3
matrix:
include:
- php: 7.0
env:
- COVERALLS=1
- R=3.0.2
- php: 7.0
env:
- LINTR=1
LINTR_COMMENT_BOT=false
- php: 7.0
env:
- PHPCS=1
- php: 7.1
env:
- PHPUNIT=5.7.19
- R=3.4
- php: 7.2
env:
- PHPUNIT=5.7.19
- R=3.0.2
- php: 7.2
env:
- PHPUNIT=5.7.19
- R=3.4
- php: 7.2
env:
- PHPUNIT=5.7.19
- R=3.5
- php: 7.3
env:
- PHPUNIT=5.7.19
- R=3.0.2
- php: 7.3
env:
- PHPUNIT=5.7.19
- R=3.4
- php: 7.3
env:
- PHPUNIT=5.7.19
- R=3.5
exclude:
- php: 7.2
env: R=3.0.2
- php: 7.2
env: R=3.4
- php: 7.2
env: R=3.5
- php: 7.3
env: R=3.0.2
- php: 7.3
env: R=3.4
- php: 7.3
env: R=3.5
cache:
directories:
- $HOME/R/Library
- $HOME/downloads
before_script:
- sudo sh -c "if [ '$R' = '3.4' ] || [ '$R' = '3.5' ]; then apt-key adv --keyserver keyserver.ubuntu.com --recv E084DAB9; fi"
- sudo sh -c "if [ '$R' = '3.4' ]; then add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu trusty/' -y; fi"
- sudo sh -c "if [ '$R' = '3.5' ]; then add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu trusty-cran35/' -y; fi"
- sudo sh -c "if [ '$R' = '3.4' ] || [ '$R' = '3.5' ]; then apt-get update -qq; fi"
- sudo apt-get install -y --force-yes r-base
- sudo sh -c "if [ '$R' != '3.5' ]; then apt-get install -y --force-yes r-cran-rserve; fi"
- sudo sh -c "if [ '$R' = '3.5' ]; then wget \"https://www.rforge.net/Rserve/snapshot/Rserve_1.8-6.tar.gz\"; fi"
- sudo sh -c "if [ '$R' = '3.5' ]; then R CMD INSTALL Rserve_1.8-6.tar.gz; fi"
- sudo sh -c "if [ '$LINTR' = '1' ]; then sudo apt-get install --yes r-base-dev; fi"
- sudo mkdir -p ~/R/Library
- sudo echo 'R_LIBS=~/R/Library' > ~/.Renviron
- sudo echo 'options(repos = "https://cran.rstudio.com")' > ~/.Rprofile
- sudo sh -c "Rscript -e 'if(!\"psy\" %in% rownames(installed.packages())) { install.packages(\"psy\", dependencies = TRUE) }';"
- sudo sh -c "Rscript -e 'if(!\"gplots\" %in% rownames(installed.packages())) { install.packages(\"gplots\", dependencies = TRUE) }'"
- sudo sh -c "Rscript -e 'if(!\"ggplot2\" %in% rownames(installed.packages())) { install.packages(\"ggplot2\", dependencies = TRUE) }'"
- sudo sh -c "if [ '$LINTR' = '1' ]; then Rscript -e 'if(!\"lintr\" %in% rownames(installed.packages())) { install.packages(\"lintr\", dependencies = TRUE) }'; fi"
- sudo R CMD Rserve
- sh -c "mysql -e 'CREATE DATABASE qdnatool_test;'"
- chmod -R 777 ./app/tmp
- sh -c "if [ '$COVERALLS' = '1' ]; then composer require \"satooshi/php-coveralls=v1.0.1\"; fi"
- sh -c "if [ '$PHPUNIT' != '3.7.33' ]; then composer remove --dev \"phpunit/phpunit\"; fi"
- composer require "phpunit/phpunit=$PHPUNIT"
- sh -c "if [ '$PHPCS' = '1' ]; then cd $TRAVIS_BUILD_DIR/app; Vendor/bin/phpcs --config-set installed_paths Vendor/cakephp/cakephp-codesniffer; fi"
- phpenv rehash
- echo -e "<?php\nclass DATABASE_CONFIG {\n\n\tpublic \$test = array(\n\t\t'datasource' => 'Database/Mysql',\n\t\t'database' => 'qdnatool_test',\n\t\t'host' => '0.0.0.0',\n\t\t'login' => 'travis',\n\t\t'persistent' => false,\n\t);\n}" > app/Config/database.php
- echo -e "<?php\n\$config = array(\n\t'Rserve' => array(\n\t\t'host' => 'localhost',\n\t\t'port' => 6311,\n\t\t'debug' => false\n\t)\n);\n" > app/Config/rserve.php
script:
- sh -c "if [ '$COVERALLS' = '1' ]; then cd $TRAVIS_BUILD_DIR/app; Vendor/bin/cake test app AllTests --stderr --coverage-clover ../build/logs/clover.xml --configuration ../phpunit.xml; fi;"
- sh -c "if [ '$PHPCS' = '1' ]; then cd $TRAVIS_BUILD_DIR/app; Vendor/bin/phpcs -p --extensions=ctp,php --standard=CakePHP --ignore=Plugin --ignore=Vendor --ignore=webroot/js/ckeditor -n $TRAVIS_BUILD_DIR; fi;"
- sh -c "if [ '$PHPCS' != '1' ] && [ '$COVERALLS' != 1 ] && [ '$LINTR' != 1 ]; then cd $TRAVIS_BUILD_DIR/app; Vendor/bin/cake test app AllTests --stderr; fi"
- sh -c "if [ '$LINTR' = '1' ]; then cd $TRAVIS_BUILD_DIR; ./bin/travis-linter.sh; fi"
after_success:
- sh -c "if [ '$COVERALLS' = '1' ]; then cd $TRAVIS_BUILD_DIR; php app/Vendor/bin/coveralls -c .coveralls.yml -v; fi"
notifications:
email: false