Newer
Older
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
# Give sudo to environment
sudo: required
# Make Docker available inside the container
services:
- docker
# Use the PHP environment
language: php
# Don't send notifications via email, that's annoying
notifications:
email:
on_success: never
on_failure: never
# Trigger only on master -- we'll add Github pull requests in settings
branches:
only:
- master
# Cache composer dependencies
cache:
directories:
- vendor
- $HOME/.composer/cache
# Build these combinations of PHP and WordPress Versions
matrix:
include:
- php: 7.2
env: WP_VERSION=latest
- php: 7.1
env: WP_VERSION=latest
- php: 7.2
env: WP_VERSION=trunk
# Setup environment
before_script:
# Export composer
- export PATH="$HOME/.composer/vendor/bin:$PATH"
# Install plugin with composer
- composer install --no-progress
# Run tests
script:
# Run just unit tests first -- if they fail we never spend the time building the environment for integration tests
- composer unit-tests
# Install full test environment using composer script
- composer wp-install
# Run integration tests
- composer wp-tests
# IF tests passed run coverage and sniffs
after_sucess:
# Run coverage
- vendor/bin/phpunit --coverage-clover=coverage.xml
# Report to codecov
- bash <(curl -s https://codecov.io/bash) CODECOV_KEY