1 |
efrain |
1 |
# This is the language of our project.
|
|
|
2 |
language: php
|
|
|
3 |
|
|
|
4 |
# Installs the required version of Firefox for Behat, an updated version
|
|
|
5 |
# of PostgreSQL and extra APT packages. Java 8 is only required
|
|
|
6 |
# for Mustache command.
|
|
|
7 |
addons:
|
|
|
8 |
postgresql: "9.5"
|
|
|
9 |
|
|
|
10 |
services:
|
|
|
11 |
- mysql
|
|
|
12 |
- postgresql
|
|
|
13 |
- docker
|
|
|
14 |
|
|
|
15 |
# Cache NPM's and Composer's caches to speed up build times.
|
|
|
16 |
cache:
|
|
|
17 |
directories:
|
|
|
18 |
- $HOME/.composer/cache
|
|
|
19 |
- $HOME/.npm
|
|
|
20 |
|
|
|
21 |
# Determines which versions of PHP to test our project against. Each version
|
|
|
22 |
# listed here will create a separate build and run the tests against that
|
|
|
23 |
# version of PHP.
|
|
|
24 |
php:
|
|
|
25 |
- 7.0
|
|
|
26 |
- 7.1
|
|
|
27 |
- 7.2
|
|
|
28 |
- 7.3
|
|
|
29 |
- 7.4
|
|
|
30 |
|
|
|
31 |
# This section sets up the environment variables for the build.
|
|
|
32 |
env:
|
|
|
33 |
global:
|
|
|
34 |
# This line determines which version branch of Moodle to test against.
|
|
|
35 |
- MOODLE_BRANCH=MOODLE_39_STABLE
|
|
|
36 |
- IGNORE_PATHS=lang,editor,library,reporting
|
|
|
37 |
# This matrix is used for testing against multiple databases. So for
|
|
|
38 |
# each version of PHP being tested, one build will be created for each
|
|
|
39 |
# database listed here. EG: for PHP 5.6, one build will be created
|
|
|
40 |
# using PHP 5.6 and pgsql. In addition, another build will be created
|
|
|
41 |
# using PHP 5.6 and mysqli.
|
|
|
42 |
matrix:
|
|
|
43 |
- DB=pgsql
|
|
|
44 |
- DB=mysqli
|
|
|
45 |
|
|
|
46 |
# Optionally, it is possible to specify a different Moodle repo to use
|
|
|
47 |
# (git://github.com/moodle/moodle.git is used by default):
|
|
|
48 |
# - MOODLE_REPO=git://github.com/username/moodle.git
|
|
|
49 |
|
|
|
50 |
# This lists steps that are run before the installation step.
|
|
|
51 |
before_install:
|
|
|
52 |
# This disables XDebug which should speed up the build.
|
|
|
53 |
- phpenv config-rm xdebug.ini
|
|
|
54 |
# Currently we are inside of the clone of your repository. We move up two
|
|
|
55 |
# directories to build the project.
|
|
|
56 |
- cd ../..
|
|
|
57 |
# Install this project into a directory called "ci".
|
|
|
58 |
- composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
|
|
|
59 |
# Update the $PATH so scripts from this project can be called easily.
|
|
|
60 |
- export PATH="$(cd ci/bin; pwd):$(cd ci/vendor/bin; pwd):$PATH"
|
|
|
61 |
|
|
|
62 |
# This lists steps that are run for installation and setup.
|
|
|
63 |
install:
|
|
|
64 |
# Run the default install. The overview of what this does:
|
|
|
65 |
# - Clone the Moodle project into a directory called moodle.
|
|
|
66 |
# - Create a data directory called moodledata.
|
|
|
67 |
# - Create Moodle config.php, database, etc.
|
|
|
68 |
# - Copy your plugin(s) into Moodle.
|
|
|
69 |
# - Run Composer install within Moodle.
|
|
|
70 |
# - Run NPM install in Moodle and in your plugin if it has a "package.json".
|
|
|
71 |
# - Run "grunt ignorefiles" within Moodle to update ignore file lists.
|
|
|
72 |
# - If your plugin has Behat features, then Behat will be setup.
|
|
|
73 |
# - If your plugin has unit tests, then PHPUnit will be setup.
|
|
|
74 |
- moodle-plugin-ci install
|
|
|
75 |
|
|
|
76 |
# This lists steps that are run for the purposes of testing. Any of
|
|
|
77 |
# these steps can be re-ordered or removed to your liking. And of
|
|
|
78 |
# course, you can add any of your own custom steps.
|
|
|
79 |
script:
|
|
|
80 |
# This step lints your PHP files to check for syntax errors.
|
|
|
81 |
- moodle-plugin-ci phplint
|
|
|
82 |
# This step runs the PHP Copy/Paste Detector on your plugin.
|
|
|
83 |
# This helps to find code duplication.
|
|
|
84 |
- moodle-plugin-ci phpcpd
|
|
|
85 |
# This step runs the PHP Mess Detector on your plugin. This helps to find
|
|
|
86 |
# potential problems with your code which can result in
|
|
|
87 |
# refactoring opportunities.
|
|
|
88 |
- moodle-plugin-ci phpmd
|
|
|
89 |
# This step runs the Moodle Code Checker to make sure that your plugin
|
|
|
90 |
# conforms to the Moodle coding standards. It is highly recommended
|
|
|
91 |
# that you keep this step.
|
|
|
92 |
- moodle-plugin-ci codechecker
|
|
|
93 |
# This step runs Moodle PHPDoc checker on your plugin.
|
|
|
94 |
# - moodle-plugin-ci phpdoc
|
|
|
95 |
# This step runs some light validation on the plugin file structure
|
|
|
96 |
# and code. Validation can be plugin specific.
|
|
|
97 |
- moodle-plugin-ci validate
|
|
|
98 |
# This step validates your plugin's upgrade steps.
|
|
|
99 |
- moodle-plugin-ci savepoints
|
|
|
100 |
# This step validates the HTML and Javascript in your Mustache templates.
|
|
|
101 |
# - moodle-plugin-ci mustache
|
|
|
102 |
# This step runs Grunt tasks on the plugin. By default, it tries to run
|
|
|
103 |
# tasks relevant to your plugin and Moodle version, but you can run
|
|
|
104 |
# specific tasks by passing them as options,
|
|
|
105 |
# EG: moodle-plugin-ci grunt -t task1 -t task2
|
|
|
106 |
# - moodle-plugin-ci grunt
|
|
|
107 |
# This step runs the PHPUnit tests of your plugin. If your plugin has
|
|
|
108 |
# PHPUnit tests, then it is highly recommended that you keep this step.
|
|
|
109 |
- moodle-plugin-ci phpunit
|
|
|
110 |
# This step runs the Behat tests of your plugin. If your plugin has
|
|
|
111 |
# Behat tests, then it is highly recommended that you keep this step.
|
|
|
112 |
# There are two important options that you may want to use:
|
|
|
113 |
# - The auto rerun option allows you to rerun failures X number of times,
|
|
|
114 |
# default is 2, EG usage: --auto-rerun 3
|
|
|
115 |
# - The dump option allows you to print the failure HTML to the console,
|
|
|
116 |
# handy for debugging, EG usage: --dump
|
|
|
117 |
# - The suite option allows you to set the theme to use for behat test. If
|
|
|
118 |
# not specified, the default theme is used, EG usage: --suite boost
|