forked from open-lms-open-source/moodle-plugin-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
68 lines (56 loc) · 1.76 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
language: php
sudo: false
cache:
directories:
- $HOME/.composer/cache
php:
- 5.4
env:
global:
- IGNORE_PATHS=ignore
- IGNORE_NAMES=ignore_name.php
- COVERAGE=false
- DB=pgsql
matrix:
- MOODLE_BRANCH=MOODLE_29_STABLE
- MOODLE_BRANCH=MOODLE_28_STABLE
- MOODLE_BRANCH=MOODLE_27_STABLE DB=mysqli
matrix:
include:
- php: 7.0
env: MOODLE_BRANCH=MOODLE_30_STABLE
- php: 7.0
env: MOODLE_BRANCH=MOODLE_31_STABLE COVERAGE=true
- php: 7.0
env: MOODLE_BRANCH=master
install:
# Several tools complain about xdebug slowdown.
- phpenv config-rm xdebug.ini
- composer selfupdate
- composer install --no-interaction --prefer-dist
# Mimic how a Moodle plugin would be run.
- cp -R tests/Fixture/moodle-local_travis ../moodle-local_travis
- export PATH="$(cd bin; pwd):$(cd vendor/bin; pwd):$PATH"
- export TRAVIS_BUILD_DIR=$(cd ../moodle-local_travis; pwd)
# Finally, the standard install step.
- moodle-plugin-ci install
script:
- composer validate
- composer lint
- php-cs-fixer --dry-run -v fix
- if [ "$COVERAGE" = true ]; then phpdbg -qrr $(which phpunit) --coverage-clover coverage.clover; fi
- if [ "$COVERAGE" = false ]; then phpunit; fi
# This is basically "integration" testing.
- moodle-plugin-ci phplint
- moodle-plugin-ci phpcpd
- moodle-plugin-ci phpmd
- moodle-plugin-ci codechecker
- moodle-plugin-ci csslint
- moodle-plugin-ci shifter
- moodle-plugin-ci jshint
- moodle-plugin-ci validate
- moodle-plugin-ci phpunit --coverage-text
- moodle-plugin-ci behat
after_script:
- if [ "$COVERAGE" = true ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [ "$COVERAGE" = true ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi