-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
190 lines (163 loc) · 6.04 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
language: php
# change distribution due to:
# https://moodle.org/mod/forum/discuss.php?d=389744
dist: bionic
sudo: required
addons:
firefox: "47.0.1"
postgresql: "9.4"
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
- openjdk-8-jre-headless
- chromium-chromedriver
services:
- mysql
- postgresql
cache:
directories:
- $HOME/.composer/cache
- $HOME/.npm
# moodle 3.6 requires at least PHP 7.0
# moodle 3.7 and moodle 3.8 require at least PHP 7.1
# PHP 7.0 is not available for dist bionic
jobs:
include:
- name: 'Moodle 3.9, PHP 7.3, MySQL'
php: 7.3
env:
- MOODLE_BRANCH=master
- DB=mysqli
- name: 'Moodle 3.8, PHP 7.3, MySQL'
php: 7.3
env:
- MOODLE_BRANCH=MOODLE_38_STABLE
- DB=mysqli
- name: 'Moodle 3.7, PHP 7.3, MySQL'
php: 7.3
env:
- MOODLE_BRANCH=MOODLE_37_STABLE
- DB=mysqli
- name: 'Moodle 3.7, PHP 7.2, MySQL'
php: 7.2
env:
- MOODLE_BRANCH=MOODLE_37_STABLE
- DB=mysqli
- name: 'Moodle 3.6, PHP 7.1, PostgreSQL'
php: 7.1
env:
- MOODLE_BRANCH=MOODLE_36_STABLE
- DB=pgsql
# - name: 'Moodle 3.6.8, PHP 7.3, PostgreSQL'
# php: 7.3
# env:
# - MOODLE_BRANCH=v3.6.8
# - DB=pgsql
env:
global:
- IGNORE_PATHS=tests
before_install:
# This disables XDebug which should speed up the build.
- phpenv config-rm xdebug.ini
# This installs NodeJS which is used by Grunt, etc.
# nvm 14.3 for Moodle 3.7 and later
- >
if [ "$MOODLE_BRANCH" = 'MOODLE_36_STABLE' ];
then
nvm install 8.9
nvm use 8.9
else
nvm install 14.3
nvm use 14.3
fi
# nvm Version 8.9 for Moodle 3.6
# - nvm install 8.9
# - nvm use 8.9
# Currently we are inside of the clone of your repository. We move up two
# directories to build the project.
- cd ../..
# Install this project into a directory called "ci".
- composer create-project -n --no-dev --prefer-dist blackboard-open-source/moodle-plugin-ci ci ^2
# Update the $PATH so scripts from this project can be called easily.
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
install:
# plugin requires special behaviour to run unit and behat tests
- moodle-plugin-ci add-plugin elearning-ostfalia/moodle-qbehaviour_adaptiveexternalgrading
- moodle-plugin-ci add-plugin elearning-ostfalia/moodle-qtype_proforma
# Run the default install. The overview of what this does:
# - Clone the Moodle project into a directory called moodle.
# - Create a data directory called moodledata.
# - Create Moodle config.php, database, etc.
# - Copy your plugin(s) into Moodle.
# - Run Composer install within Moodle.
# - Run NPM install in Moodle and in your plugin if it has a "package.json".
# - Run "grunt ignorefiles" within Moodle to update ignore file lists.
# - If your plugin has Behat features, then Behat will be setup.
# - If your plugin has unit tests, then PHPUnit will be setup.
- moodle-plugin-ci install
# timeout must be increased for import feature
- moodle-plugin-ci add-config '$CFG->behat_increasetimeout = 3;'
before_script:
# diagnosis
- firefox --version
- /usr/lib/chromium-browser/chromedriver --version
- chromium-browser --version
- pwd
- ls
- cat ./moodle/config.php
# This lists steps that are run for the purposes of testing. Any of
# these steps can be re-ordered or removed to your liking. And of
# course, you can add any of your own custom steps.
script:
# This step runs the Behat tests of your plugin. If your plugin has
# Behat tests, then it is highly recommended that you keep this step.
# There are two important options that you may want to use:
# - The auto rerun option allows you to rerun failures X number of times,
# default is 2, EG usage: --auto-rerun 3
# - The dump option allows you to print the failure HTML to the console,
# handy for debugging, EG usage: --dump
# - The suite option allows you to set the theme to use for behat test. If
# not specified, the default theme is used, EG usage: --suite boost
#
# Behat tests fail (import.feature and backup_and_restore.feature)
# https://github.com/blackboard-open-source/moodle-plugin-ci/issues/70
- moodle-plugin-ci behat --auto-rerun 0
# - moodle-plugin-ci behat --profile chrome --auto-rerun 0
# This step lints your PHP files to check for syntax errors.
- moodle-plugin-ci phplint
# This step runs the PHP Copy/Paste Detector on your plugin.
# This helps to find code duplication.
- moodle-plugin-ci phpcpd
# This step runs the PHP Mess Detector on your plugin. This helps to find
# potential problems with your code which can result in
# refactoring opportunities.
- moodle-plugin-ci phpmd
# This step runs the Moodle Code Checker to make sure that your plugin
# conforms to the Moodle coding standards. It is highly recommended
# that you keep this step.
# - moodle-plugin-ci codechecker
# This step runs some light validation on the plugin file structure
# and code. Validation can be plugin specific.
- moodle-plugin-ci validate
# This step validates your plugin's upgrade steps.
- moodle-plugin-ci savepoints
# This step validates the HTML and Javascript in your Mustache templates.
# - moodle-plugin-ci mustache
# This step runs Grunt tasks on the plugin. By default, it tries to run
# tasks relevant to your plugin and Moodle version, but you can run
# specific tasks by passing them as options,
# EG: moodle-plugin-ci grunt -t task1 -t task2
# - moodle-plugin-ci grunt
# (disabled because of claiming stale javascript files)
# This step runs Moodle PHPDoc checker on your plugin.
# - moodle-plugin-ci phpdoc
# This step runs the PHPUnit tests of your plugin. If your plugin has
# PHPUnit tests, then it is highly recommended that you keep this step.
- moodle-plugin-ci phpunit
after_script:
# See: https://github.com/moodlerooms/moodle-plugin-ci/issues/32
- killall -9 php
- killall -9 java
- killall -9 Xvfb