-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
62 lines (43 loc) · 1.84 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
# Standard .travis.yml for a Mautic plugin. Adjust env variables as needed.
env:
global:
# The exact plugin folder/bundle name.
- "MAUTIC_PLUGIN=MauticRevenueEventBundle"
dist: precise
language: php
services:
- mysql
php:
- 5.6.19
- 7.0
- 7.1
- 7.2
before_install:
# Create mautictest database.
- mysql -e 'CREATE DATABASE mautictest;'
# Turn off XDebug.
- phpenv config-rm xdebug.ini || return
# Install dependencies in parallel.
- travis_retry composer global require hirak/prestissimo
# Set to test environment for Symfony's commands in post install commands.
- export SYMFONY_ENV="test"
# Install PHPSTAN for PHP 7+
- if [[ ${TRAVIS_PHP_VERSION:0:3} != "5.6" ]]; then composer global require phpstan/phpstan-shim:0.8.5; fi
# Clone the latest core release.
- git clone -b staging --single-branch --depth 1 https://github.com/mautic/mautic.git /tmp/mautic
# Combine core with our plugin.
- mkdir -p /tmp/mautic/plugins/$MAUTIC_PLUGIN
- rsync -r --delete-after --quiet $TRAVIS_BUILD_DIR/ /tmp/mautic/plugins/$MAUTIC_PLUGIN
- rsync -r --delete-after --quiet /tmp/mautic/ $TRAVIS_BUILD_DIR/
install:
# Install core dependencies.
- composer install
# Install plugin dependencies (if any).
- composer install
script:
# Run PHPUnit including core tests to find potential BC breaks.
- bin/phpunit -d memory_limit=2256M --bootstrap vendor/autoload.php --configuration app/phpunit.xml.dist --fail-on-warning
# Run PHPSTAN analysis for PHP 7+ only in the scope of this plugin.
- if [[ ${TRAVIS_PHP_VERSION:0:3} != "5.6" ]]; then ~/.composer/vendor/phpstan/phpstan-shim/phpstan.phar analyse plugins/$MAUTIC_PLUGIN; fi
# Check code standards for PHP 7.2 only in the scope of this plugin.
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.2" ]]; then bin/php-cs-fixer fix -v --dry-run --diff plugins/$MAUTIC_PLUGIN; fi