-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
70 lines (58 loc) · 2.47 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
language: php
dist: xenial
services:
- mysql
cache:
directories:
- $HOME/.composer/cache/files
addons:
postgresql: 9.6
apt:
packages:
- postgresql-9.6-postgis-2.3
env:
global:
- COMPOSER_ROOT_VERSION=4.x-dev
matrix:
include:
- php: 7.1
env: DB=PGSQL RECIPE_VERSION=4.3.x-dev PHPUNIT_TEST=1
- php: 7.2
env: DB=MYSQL RECIPE_VERSION=4.4.x-dev PHPUNIT_TEST=1
- php: 7.3
env: DB=MYSQL RECIPE_VERSION=4.4.x-dev PHPUNIT_COVERAGE_TEST=1
- php: 7.3
env: DB=MYSQL RECIPE_VERSION=4.4.x-dev PHPUNIT_TEST=1
- php: 7.3
env: DB=MYSQL RECIPE_VERSION=4.x-dev PHPUNIT_TEST=1
- php: 7.3
env: DB=MYSQL RECIPE_VERSION=4.x-dev PHPCS_TEST=1
before_script:
- psql -c 'create database travis_ci_test;' -U postgres
# Init PHP
- phpenv rehash
- phpenv config-rm xdebug.ini
- echo 'memory_limit = 2G' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
# Install composer dependencies
- composer validate # --strict here?
- composer require silverstripe/recipe-cms:"$RECIPE_VERSION" silverstripe/recipe-testing:^1 --no-update
- composer require --no-update silverstripe/widgets
- if [[ $BEHAT_TEST ]]; then composer require --no-update silverstripe/behat-extension:4.x-dev; fi;
- if [[ $DB == PGSQL ]]; then composer require silverstripe/postgresql:^2 --no-update; fi
- composer install --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
# Run dev/build
- vendor/bin/sake dev/build flush=all
# Dump constants for debug
- php vendor/silverstripe/framework/tests/dump_constants.php
script:
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit -d memory_limit=4G tests/ '' flush=1; fi
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit -d memory_limit=4G --coverage-clover=coverage.xml tests/ '' flush=1 ; fi
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs --config-set ignore_errors_on_exit 1 && vendor/bin/phpcs --config-set ignore_warnings_on_exit 1 && vendor/bin/phpcs src/ tests/ ; fi
- if [[ $NPM_TEST ]]; then git diff-files --quiet -w --relative=client; fi
- if [[ $NPM_TEST ]]; then git diff --name-status --relative=client; fi
- if [[ $NPM_TEST ]]; then yarn run test; fi
- if [[ $NPM_TEST ]]; then yarn run lint; fi
- if [[ $BEHAT_TEST ]]; then vendor/bin/behat @silverstripe-elemental; fi
-
after_success:
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi