forked from maths/moodle-qtype_stack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
122 lines (98 loc) · 5.17 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
111
112
113
114
115
116
117
118
119
120
121
122
language: php
sudo: required
addons:
firefox: "47.0.1"
postgresql: "9.6"
apt:
packages:
- oracle-java8-installer
- oracle-java8-set-default
- maxima
- maxima-share
- texinfo
cache:
directories:
- $HOME/.composer/cache
- $HOME/.npm
matrix:
# I would like to run at least some of these with DB=mysqli, but that
# currently fails with dist: trusty which we need for Maxima.
# The error is ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
# The solution is to add --protocol=TCP in src/Installer/Database/MySQLDatabase.php
# in https://github.com/moodlerooms/moodle-plugin-ci, but I can't work out
# how to do that.
include:
- php: 7.0
env: TASK=PHPUNIT MOODLE_BRANCH=MOODLE_32_STABLE DB=pgsql
- php: 5.6
env: TASK=PHPUNIT MOODLE_BRANCH=MOODLE_33_STABLE DB=mysqli
# Would be good to run this next test in PHP 7.2, but STACK does not support that yet.
- php: 7.1
env: TASK=PHPUNIT MOODLE_BRANCH=MOODLE_34_STABLE DB=pgsql
- php: 7.1
env: TASK=PHPUNIT MOODLE_BRANCH=MOODLE_35_STABLE DB=mysqli
# Master here will need to be changed to MOODLE_36_STABLE once Moodle 3.6 has been released.
- php: 7.1
env: TASK=PHPUNIT MOODLE_BRANCH=master DB=pgsql
- php: 5.6
env: TASK=BEHAT MOODLE_BRANCH=MOODLE_32_STABLE DB=mysqli
- php: 7.0
env: TASK=BEHAT MOODLE_BRANCH=MOODLE_33_STABLE DB=pgsql
- php: 7.1
env: TASK=BEHAT MOODLE_BRANCH=MOODLE_34_STABLE DB=mysqli
# Would be good to run this next test in PHP 7.2, but STACK does not support that yet.
- php: 7.1
env: TASK=BEHAT MOODLE_BRANCH=MOODLE_35_STABLE DB=pgsql
# Master here will need to be changed to MOODLE_36_STABLE once Moodle 3.6 has been released.
- php: 7.1
env: TASK=BEHAT MOODLE_BRANCH=master DB=mysqli
- php: 7.1
env: TASK=CODESTYLE MOODLE_BRANCH=MOODLE_35_STABLE DB=mysqli
- php: 7.1
env: TASK=CODEKNOWNFAILS MOODLE_BRANCH=MOODLE_35_STABLE DB=mysqli
allow_failures:
# This relates to the bit right at the end, where we run some of the coding style checks in this group.
# We don't care if these checks fail, but we want to be able to see the results.
- php: 7.1
env: TASK=CODEKNOWNFAILS MOODLE_BRANCH=MOODLE_35_STABLE DB=mysqli
before_install:
- phpenv config-rm xdebug.ini
- nvm install 8.9
- nvm use 8.9
- cd ../..
- composer create-project -n --no-dev --prefer-dist moodlerooms/moodle-plugin-ci ci ^2
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
install:
- moodle-plugin-ci add-plugin maths/moodle-qbehaviour_dfexplicitvaildate
- moodle-plugin-ci add-plugin maths/moodle-qbehaviour_dfcbmexplicitvaildate
- moodle-plugin-ci add-plugin maths/moodle-qbehaviour_adaptivemultipart
- moodle-plugin-ci install
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_PLATFORM", "unix-optimised");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMAVERSION", "'`maxima --version | sed 's/Maxima //'`'");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASTIMEOUT", "10");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASRESULTSCACHE", "db");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMACOMMAND", "timeout --kill-after=10s 10s /home/travis/build/maxima_opt_auto -eval '\''(cl-user::run)'\''");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_PLOTCOMMAND", "gnuplot");'
- moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASDEBUGGING", "0");'
- cp /home/travis/build/moodledata/phpu_moodledata/stack/maxima_opt_auto /home/travis/build/maxima_opt_auto
# Output some diagnostic about how the install went.
# Travis seems to be using Maxima version 5.32.1, lisp gcl, which is very old!
- maxima --list-avail
- cat ./moodle/config.php
- echo 'ATAlgEquiv(x^2-1,(x-1)*(x+1));quit();' | timeout --kill-after=10s 10s /home/travis/build/maxima_opt_auto -eval '(cl-user::run)'
script:
# Run all the PHP unit tests.
- if [ "$TASK" = 'PHPUNIT' ]; then moodle-plugin-ci phpunit; fi
# Run all the Behat tests.
- if [ "$TASK" = 'BEHAT' ]; then moodle-plugin-ci behat; fi
# Run all the various code style tests - this subset should all pass.
- if [ "$TASK" = 'CODESTYLE' ]; then moodle-plugin-ci phplint; fi
- if [ "$TASK" = 'CODESTYLE' ]; then moodle-plugin-ci validate; fi
- if [ "$TASK" = 'CODESTYLE' ]; then moodle-plugin-ci savepoints; fi
- if [ "$TASK" = 'CODESTYLE' ]; then moodle-plugin-ci mustache; fi
- if [ "$TASK" = 'CODESTYLE' ]; then moodle-plugin-ci grunt; fi
# Run all the various code style tests - these ones are konwn to fail.
# Once we get them passing, move them to the CODESTYLE section above.
- if [ "$TASK" = 'CODEKNOWNFAILS' ]; then moodle-plugin-ci phpmd; fi
- if [ "$TASK" = 'CODEKNOWNFAILS' ]; then moodle-plugin-ci phpcpd; fi
- if [ "$TASK" = 'CODEKNOWNFAILS' ]; then moodle-plugin-ci codechecker; fi