forked from mundschenk-at/wp-typography
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
96 lines (85 loc) · 3.27 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
# Travis CI (MIT License) configuration file for the php-typography libryry.
# @link https://travis-ci.org/
# For use with the wp-Typography WordPress plugin.
# @link https://github.com/mundschenk-at/wp-typography
# Declare project language.
# @link http://about.travis-ci.org/docs/user/languages/php/
language: php
# Use Linux
os: linux
dist: xenial
# Cache composer stuff
cache:
directories:
- $HOME/.composer/cache
# Declare versions of PHP to use. Use one decimal max.
# @link http://docs.travis-ci.com/user/build-configuration/
jobs:
fast_finish: true
include:
# Current $required_php_version for WordPress: 5.2.4
# aliased to 5.2.17
- php: '5.2'
dist: precise
env: SCOPE=php52
# minimum version for activating wp-Typography 5.6.0, aliased to a recent 5.6.x version
- php: '5.6'
env: SCOPE=tests
# aliased to a recent 7.0 version
- php: '7.0'
env: SCOPE=tests
# aliased to a recent 7.1 version
- php: '7.1'
env: SCOPE=tests
# aliased to a recent 7.2 version
- php: '7.2'
env: SCOPE=tests
# aliased to a recent 7.3 version
- php: '7.3'
env: SCOPE=tests
# aliased to a recent 7.4 version
- php: '7.4'
env: SCOPE=coverage
# Use this to prepare the system to install prerequisites or dependencies.
# e.g. sudo apt-get update.
# Failures in this section will result in build status 'errored'.
before_install:
- if [[ "$SCOPE" == "tests" || "$SCOPE" == "coverage" ]]; then
composer remove humbug/php-scoper --dev --no-update --no-interaction;
composer update --no-interaction;
phpenv rehash;
fi
- if [[ "$SCOPE" == "coverage" ]]; then composer require php-coveralls/php-coveralls --dev; fi
# Use this to prepare your build for testing.
# e.g. copy database configurations, environment variables, etc.
# Failures in this section will result in build status 'errored'.
before_script:
# Run test script commands.
# Default is specific to project language.
# All commands must exit with code 0 on success. Anything else is considered failure.
script:
# Search for PHP syntax errors.
- if [[ "$SCOPE" == "php52" ]]; then
find -L . -name 'wp-typography.php' -print0 | xargs -0 -n 1 -P 4 php -l;
else
find -L . -not \( -path ./tests -prune \) -not \( -path ./vendor -prune \) -name '*.php' -not \( -name .scoper.inc.php -prune \) -print0 | xargs -0 -n 1 -P 4 php -l;
fi
# WordPress Coding Standards.
- if [[ "$PHPCS" == "1" ]]; then composer phpcs; fi
# Unit tests.
- if [[ "$SCOPE" == "tests" ]]; then composer test; fi
# Code coverage
- if [[ "$SCOPE" == "coverage" ]]; then
mkdir -p build/logs;
composer test -- --coverage-clover build/logs/clover.xml;
fi
after_script:
- if [[ "$SCOPE" == "coverage" ]]; then
php vendor/bin/coveralls -v;
wget https://scrutinizer-ci.com/ocular.phar;
php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml;
fi
# Receive notifications for build results.
# @link http://docs.travis-ci.com/user/notifications/#Email-notifications
notifications:
email: false