.travis.yml 7.58 KB
Newer Older
1
language: php
2
sudo: false
3
dist: trusty
4 5 6 7 8 9

cache:
    directories:
        - vendor
        - $HOME/.composer/cache

10
php:
11
  - 7.1
Luís Cobucci's avatar
Luís Cobucci committed
12
  - 7.2
13
  - nightly
14

15
env:
16
  - DB=sqlite
17
  - DB=mysql
18
  - DB=mysqli
19

Luís Cobucci's avatar
Luís Cobucci committed
20 21 22
before_install:
  - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"

23
before_script:
24
  - if [[ "$DB" == "mysql" || "$DB" == "mysqli" || "$DB" == *"mariadb"* ]]; then mysql < tests/travis/create-mysql-schema.sql; fi;
25

Luís Cobucci's avatar
Luís Cobucci committed
26 27 28 29
install:
  - travis_retry composer -n install

script: ./vendor/bin/phpunit --configuration tests/travis/$DB.travis.xml
30

Luís Cobucci's avatar
Luís Cobucci committed
31 32
jobs:
  allow_failures:
33
    - php: nightly
34
    - stage: Coding standard
35

Luís Cobucci's avatar
Luís Cobucci committed
36 37 38
  include:
    - stage: Test
      php: 7.1
39 40
      env: DB=mysql MYSQL_VERSION=5.7
      sudo: required
Luís Cobucci's avatar
Luís Cobucci committed
41 42 43 44 45 46 47 48 49 50
      before_script:
        - bash ./tests/travis/install-mysql-5.7.sh
    - stage: Test
      php: 7.2
      env: DB=mysql MYSQL_VERSION=5.7
      sudo: required
      before_script:
        - bash ./tests/travis/install-mysql-5.7.sh
    - stage: Test
      php: nightly
51 52
      env: DB=mysql MYSQL_VERSION=5.7
      sudo: required
Luís Cobucci's avatar
Luís Cobucci committed
53 54
      before_script:
        - bash ./tests/travis/install-mysql-5.7.sh
55

Luís Cobucci's avatar
Luís Cobucci committed
56 57
    - stage: Test
      php: 7.1
58 59
      env: DB=mysqli MYSQL_VERSION=5.7
      sudo: required
Luís Cobucci's avatar
Luís Cobucci committed
60 61 62 63 64 65 66 67 68 69
      before_script:
        - bash ./tests/travis/install-mysql-5.7.sh
    - stage: Test
      php: 7.2
      env: DB=mysqli MYSQL_VERSION=5.7
      sudo: required
      before_script:
        - bash ./tests/travis/install-mysql-5.7.sh
    - stage: Test
      php: nightly
70 71
      env: DB=mysqli MYSQL_VERSION=5.7
      sudo: required
Luís Cobucci's avatar
Luís Cobucci committed
72 73
      before_script:
        - bash ./tests/travis/install-mysql-5.7.sh
74

Luís Cobucci's avatar
Luís Cobucci committed
75 76
    - stage: Test
      php: 7.1
77 78 79
      env: DB=mariadb MARIADB_VERSION=10.0
      addons:
        mariadb: 10.0
Luís Cobucci's avatar
Luís Cobucci committed
80 81 82 83 84 85 86
    - stage: Test
      php: 7.2
      env: DB=mariadb MARIADB_VERSION=10.0
      addons:
        mariadb: 10.0
    - stage: Test
      php: nightly
87 88 89 90
      env: DB=mariadb MARIADB_VERSION=10.0
      addons:
        mariadb: 10.0

Luís Cobucci's avatar
Luís Cobucci committed
91 92
    - stage: Test
      php: 7.1
93 94 95
      env: DB=mariadb MARIADB_VERSION=10.1
      addons:
        mariadb: 10.1
Luís Cobucci's avatar
Luís Cobucci committed
96 97 98 99 100 101 102
    - stage: Test
      php: 7.2
      env: DB=mariadb MARIADB_VERSION=10.1
      addons:
        mariadb: 10.1
    - stage: Test
      php: nightly
103 104 105 106
      env: DB=mariadb MARIADB_VERSION=10.1
      addons:
        mariadb: 10.1

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
    - stage: Test
      php: 7.1
      env: DB=mariadb MARIADB_VERSION=10.2
      addons:
        mariadb: 10.2
    - stage: Test
      php: 7.2
      env: DB=mariadb MARIADB_VERSION=10.2
      addons:
        mariadb: 10.2
    - stage: Test
      php: nightly
      env: DB=mariadb MARIADB_VERSION=10.2
      addons:
        mariadb: 10.2

    - stage: Test
      php: 7.1
      env: DB=mariadb.mysqli MARIADB_VERSION=10.2
      addons:
        mariadb: 10.2
    - stage: Test
      php: 7.2
      env: DB=mariadb.mysqli MARIADB_VERSION=10.2
      addons:
        mariadb: 10.2
    - stage: Test
      php: nightly
      env: DB=mariadb.mysqli MARIADB_VERSION=10.2
      addons:
        mariadb: 10.2

Luís Cobucci's avatar
Luís Cobucci committed
139 140 141 142 143
    - stage: Test
      php: 7.1
      env: DB=pgsql POSTGRESQL_VERSION=9.2
      services:
        - postgresql
144 145
      addons:
        postgresql: "9.2"
Luís Cobucci's avatar
Luís Cobucci committed
146 147 148
    - stage: Test
      php: 7.2
      env: DB=pgsql POSTGRESQL_VERSION=9.2
149 150 151 152
      services:
        - postgresql
      addons:
        postgresql: "9.2"
Luís Cobucci's avatar
Luís Cobucci committed
153 154 155
    - stage: Test
      php: nightly
      env: DB=pgsql POSTGRESQL_VERSION=9.2
156 157
      services:
        - postgresql
Luís Cobucci's avatar
Luís Cobucci committed
158 159
      addons:
        postgresql: "9.2"
160

Luís Cobucci's avatar
Luís Cobucci committed
161 162 163 164 165
    - stage: Test
      php: 7.1
      env: DB=pgsql POSTGRESQL_VERSION=9.3
      services:
        - postgresql
166 167
      addons:
        postgresql: "9.3"
Luís Cobucci's avatar
Luís Cobucci committed
168 169 170
    - stage: Test
      php: 7.2
      env: DB=pgsql POSTGRESQL_VERSION=9.3
171 172 173 174
      services:
        - postgresql
      addons:
        postgresql: "9.3"
Luís Cobucci's avatar
Luís Cobucci committed
175 176 177
    - stage: Test
      php: nightly
      env: DB=pgsql POSTGRESQL_VERSION=9.3
178 179
      services:
        - postgresql
Luís Cobucci's avatar
Luís Cobucci committed
180 181
      addons:
        postgresql: "9.3"
182

Luís Cobucci's avatar
Luís Cobucci committed
183 184 185 186 187
    - stage: Test
      php: 7.1
      env: DB=pgsql POSTGRESQL_VERSION=9.4
      services:
        - postgresql
188 189
      addons:
        postgresql: "9.4"
Luís Cobucci's avatar
Luís Cobucci committed
190 191 192
    - stage: Test
      php: 7.2
      env: DB=pgsql POSTGRESQL_VERSION=9.4
193 194 195 196
      services:
        - postgresql
      addons:
        postgresql: "9.4"
Luís Cobucci's avatar
Luís Cobucci committed
197 198 199
    - stage: Test
      php: nightly
      env: DB=pgsql POSTGRESQL_VERSION=9.4
200 201
      services:
        - postgresql
Luís Cobucci's avatar
Luís Cobucci committed
202 203
      addons:
        postgresql: "9.4"
204

Luís Cobucci's avatar
Luís Cobucci committed
205 206 207 208 209
    - stage: Test
      php: 7.1
      env: DB=pgsql POSTGRESQL_VERSION=9.5
      services:
        - postgresql
210 211
      addons:
        postgresql: "9.5"
Luís Cobucci's avatar
Luís Cobucci committed
212 213 214
    - stage: Test
      php: 7.2
      env: DB=pgsql POSTGRESQL_VERSION=9.5
215 216 217 218
      services:
        - postgresql
      addons:
        postgresql: "9.5"
Luís Cobucci's avatar
Luís Cobucci committed
219 220 221
    - stage: Test
      php: nightly
      env: DB=pgsql POSTGRESQL_VERSION=9.5
222 223
      services:
        - postgresql
Luís Cobucci's avatar
Luís Cobucci committed
224 225
      addons:
        postgresql: "9.5"
226

Luís Cobucci's avatar
Luís Cobucci committed
227 228 229 230 231
    - stage: Test
      php: 7.1
      env: DB=pgsql POSTGRESQL_VERSION=9.6
      services:
        - postgresql
232 233
      addons:
        postgresql: "9.6"
Luís Cobucci's avatar
Luís Cobucci committed
234 235 236
    - stage: Test
      php: 7.2
      env: DB=pgsql POSTGRESQL_VERSION=9.6
237 238 239 240
      services:
        - postgresql
      addons:
        postgresql: "9.6"
Luís Cobucci's avatar
Luís Cobucci committed
241 242 243
    - stage: Test
      php: nightly
      env: DB=pgsql POSTGRESQL_VERSION=9.6
244 245
      services:
        - postgresql
Luís Cobucci's avatar
Luís Cobucci committed
246 247
      addons:
        postgresql: "9.6"
248

249 250
    - stage: Test
      php: 7.1
251
      env: DB=pgsql POSTGRESQL_VERSION=10.0
252 253 254 255 256 257 258 259 260
      sudo: required
      services:
        - postgresql
      addons:
        postgresql: "9.6"
      before_script:
        - bash ./tests/travis/install-postgres-10.sh
    - stage: Test
      php: 7.2
261
      env: DB=pgsql POSTGRESQL_VERSION=10.0
262 263 264 265 266 267 268 269 270
      sudo: required
      services:
        - postgresql
      addons:
        postgresql: "9.6"
      before_script:
        - bash ./tests/travis/install-postgres-10.sh
    - stage: Test
      php: nightly
271
      env: DB=pgsql POSTGRESQL_VERSION=10.0
272 273 274 275 276 277 278 279
      sudo: required
      services:
        - postgresql
      addons:
        postgresql: "9.6"
      before_script:
        - bash ./tests/travis/install-postgres-10.sh

280 281 282 283 284 285 286 287 288 289 290 291 292 293
    - stage: Test
      php: 7.1
      env: DB=sqlite DEPENDENCIES=low
      install:
        - travis_retry composer update --prefer-dist --prefer-lowest

    - stage: Test
      if: type = cron
      php: 7.2
      env: DB=sqlite DEPENDENCIES=dev
      install:
        - composer config minimum-stability dev
        - travis_retry composer update --prefer-dist

Luís Cobucci's avatar
Luís Cobucci committed
294 295 296 297 298 299 300 301 302 303 304 305
    - stage: Coverage
      php: 7.1
      env: DB=sqlite
      before_script:
        - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
        - if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi
      script:
        - ./vendor/bin/phpunit --configuration tests/travis/$DB.travis.xml --coverage-clover clover.xml
      after_script:
        - wget https://scrutinizer-ci.com/ocular.phar
        - php ocular.phar code-coverage:upload --format=php-clover clover.xml

306 307
    - stage: Pull request coding standard
      if: type = pull_request
308
      php: 7.1
309
      script:
310 311 312 313 314
        - |
          if [ $TRAVIS_BRANCH != "master" ]; then
            git remote set-branches --add origin $TRAVIS_BRANCH;
            git fetch origin $TRAVIS_BRANCH;
          fi
315
        - git merge-base origin/$TRAVIS_BRANCH $TRAVIS_PULL_REQUEST_SHA || git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge --unshallow
316 317 318
        - wget https://github.com/diff-sniffer/git/releases/download/0.1.0/git-phpcs.phar
        - php git-phpcs.phar origin/$TRAVIS_BRANCH...$TRAVIS_PULL_REQUEST_SHA

Luís Cobucci's avatar
Luís Cobucci committed
319
    - stage: Coding standard
320
      if: NOT type = pull_request
321
      php: 7.1
Luís Cobucci's avatar
Luís Cobucci committed
322 323
      script:
        - ./vendor/bin/phpcs