-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
110 lines (95 loc) · 3.13 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
language: php
os: linux
sudo: false
dist: trusty
# Maybe the VM sees things different than bionic?
jdk: openjdk8
cache:
directories:
- $HOME/.composer/cache
- $HOME/.npm
addons:
chrome: stable
postgresql: "9.4"
apt:
packages:
- openjdk-8-jre-headless
# - default-jre
- chromium-chromedriver
services:
- mysql
- xvfb
env:
global:
#- IGNORE_PATHS=checkboxgroup/checkboxgroup.php # we know this dir is problematic
- MOODLE_DIR=/home/travis/build/moodle
- MOODLE_SELENIUM_JAR=/home/travis/build/moodle/selenium.jar
before_install:
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
- phpenv config-rm xdebug.ini
- cd ../..
- composer selfupdate -vvv
- composer create-project -n --no-dev --no-interaction --prefer-dist moodlehq/moodle-plugin-ci ci ^3
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
- echo $JAVA_HOME
- which java
- sudo rm -rf /usr/local/lib/jvm/
- sudo apt-get install -y openjdk-8-jdk-headless
- export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
- which java
- java -version
- $JAVA_HOME/bin/java -version
install:
- nvm install node
- nvm use node
- moodle-plugin-ci install
- xvfb-run -a --server-args="-screen 0 1024x768x24" make test java -Dwebdriver.chrome.driver=/usr/lib/chromium-browser/chromedriver -jar ${MOODLE_SELENIUM_JAR} -log /tmp/selenium.log &
- php -t ${MOODLE_DIR} -S localhost:8000 > /tmp/php-access.log 2> /tmp/php-error.log &
- sleep 5s
jobs:
fast_finish: true
include:
# Pre-checks against latest Moodle LTS stable only.
- stage: static
php: 7.1
# env: DB=mysqli MOODLE_BRANCH=MOODLE_35_STABLE
env: DB=mysqli MOODLE_BRANCH=MOODLE_38_STABLE
script:
- moodle-plugin-ci phplint
- moodle-plugin-ci phpcpd || true # Do not fail. There are known issues but show problems.
- moodle-plugin-ci phpmd
- moodle-plugin-ci codechecker || true # Allow codechecker to pass for now.
- moodle-plugin-ci savepoints
- moodle-plugin-ci mustache || true # A code checker bug does currently not validate mustache correctly.
- moodle-plugin-ci grunt || true # Finds stale files, but why?
- moodle-plugin-ci validate
# - stage: test
# php: 7.1
# env: DB=mysqli MOODLE_BRANCH=MOODLE_35_STABLE
# - stage: test
# php: 7.1
# env: DB=pgsql MOODLE_BRANCH=MOODLE_35_STABLE
# - stage: test
# php: 7.3
# env: DB=mysqli MOODLE_BRANCH=MOODLE_37_STABLE
# - stage: test
# php: 7.3
# env: DB=mysqli MOODLE_BRANCH=MOODLE_38_STABLE
- stage: test
php: 7.3
env: DB=pgsql MOODLE_BRANCH=MOODLE_38_STABLE
# - stage: test
# php: 7.3 # >= 7.2
# env: DB=mysqli MOODLE_BRANCH=MOODLE_39_STABLE
# - stage: test
# php: 7.3 # >= 7.2
# env: DB=mysqli MOODLE_BRANCH=MOODLE_310_STABLE
# Unit tests and behat tests against full matrix.
script:
- moodle-plugin-ci phpunit --coverage-clover
- moodle-plugin-ci behat --moodle=${MOODLE_DIR} --profile=chrome --dump || true
after_success:
- bash <(curl -s https://codecov.io/bash)
stages:
- static
- test