-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
247 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,12 @@ | ||
# Introduction | ||
|
||
The goal of this project is to facilitate the running of tests and code analysis tools against a Moodle plugin in | ||
[Travis CI](https://travis-ci.org). | ||
|
||
Supported tests and code analysis tools: | ||
* [PHPUnit](https://phpunit.de) | ||
* [Behat](http://behat.org/) | ||
* [Moodle Code Checker](https://github.com/moodlehq/moodle-local_codechecker) | ||
* [Mustache Linting](https://docs.moodle.org/dev/Templates) | ||
* [Grunt tasks](https://docs.moodle.org/dev/Grunt) | ||
* [PHP Linting](https://github.com/JakubOnderka/PHP-Parallel-Lint) | ||
* [PHP Copy/Paste Detector](https://github.com/sebastianbergmann/phpcpd) | ||
* [PHP Mess Detector](http://phpmd.org) | ||
|
||
[![Latest Stable Version](https://poser.pugx.org/moodlerooms/moodle-plugin-ci/v/stable)](https://packagist.org/packages/moodlerooms/moodle-plugin-ci) | ||
[![Build Status](https://travis-ci.org/moodlerooms/moodle-plugin-ci.svg?branch=master)](https://travis-ci.org/moodlerooms/moodle-plugin-ci) | ||
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/moodlerooms/moodle-plugin-ci/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/moodlerooms/moodle-plugin-ci/?branch=master) | ||
[![Code Coverage](https://scrutinizer-ci.com/g/moodlerooms/moodle-plugin-ci/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/moodlerooms/moodle-plugin-ci/?branch=master) | ||
[![Total Downloads](https://poser.pugx.org/moodlerooms/moodle-plugin-ci/downloads)](https://packagist.org/packages/moodlerooms/moodle-plugin-ci) | ||
[![License](https://poser.pugx.org/moodlerooms/moodle-plugin-ci/license)](https://packagist.org/packages/moodlerooms/moodle-plugin-ci) | ||
|
||
# Requirements | ||
|
||
The requirements for **Version 2** are **PHP 5.6** or later and **Moodle 3.2** or later. | ||
|
||
In addition, the plugin being tested must have a [version.php](https://docs.moodle.org/dev/version.php) file | ||
and `$plugin->component` must be defined within it. | ||
|
||
If you need to run your plugin in earlier versions of Moodle, then please use Version 1 of this tool. Documentation | ||
and more information about Version 1 can be found in the [v1](https://github.com/moodlerooms/moodle-plugin-ci/tree/v1) | ||
branch. Please know that Version 1 is no longer getting new features and may not receive additional updates. | ||
|
||
# Getting started | ||
|
||
Follow these steps to get your Moodle plugin building in Travis CI. | ||
|
||
## Step 1 | ||
|
||
Sign into [Travis CI](https://travis-ci.org) with your GitHub account. Once you’re signed in, and Travis CI will have | ||
synchronized your repositories from GitHub. Go to your [profile](https://travis-ci.org/profile) page and enable Travis CI | ||
for the plugin you want to build. Now whenever your plugin receives an update or gets a new pull request, Travis CI will | ||
run a build to make sure nothing broke. | ||
|
||
## Step 2 | ||
|
||
Copy the [.travis.dist.yml](.travis.dist.yml) file into the root of your plugin and rename it to `.travis.yml`. Now | ||
might be a good time to review the `.travis.yml` contents and remove anything that is not needed. See this | ||
[help document](doc/TravisFileExplained.md) for an explanation about the contents of the this file. Once you have | ||
added the `.travis.yml` file, commit and push up to GitHub, to trigger a Travis CI build. Check the | ||
[build status](https://travis-ci.org/repositories) page to see if your build passes or fails. | ||
|
||
## Step 3 | ||
|
||
Congratulations, you are building on Travis CI! Next steps on your continuous build journey include: | ||
|
||
* Reviewing the below documentation to further improve and customize your build. | ||
* Resolve any build errors you may currently have. Get to that ever rewarding Green Build status. | ||
* Show off your build status by [adding the badge to your plugin's README file](https://docs.travis-ci.com/user/status-images/). | ||
* Write new tests to increase your code coverage. | ||
* Enjoy your favorite beverage because you no longer have to waste time manually testing your plugin! | ||
|
||
# Upgrading | ||
|
||
Guides to updating your plugin's `.travis.yml` file to use the latest versions of this tool. | ||
|
||
* [Upgrade to 2.0](UPGRADE-2.0.md) | ||
|
||
# Documentation | ||
|
||
* [Travis CI file explained](doc/TravisFileExplained.md) | ||
* [Add extra Moodle configs](doc/AddExtraConfig.md) | ||
* [Add extra plugins](doc/AddExtraPlugins.md) | ||
* [Ignoring files](doc/IgnoringFiles.md) | ||
* [Testing a plugin against PHP7](doc/PHP7.md) | ||
* [Generating code coverage](doc/CodeCoverage.md) | ||
|
||
# Usage / Versioning | ||
|
||
This project uses [Semantic Versioning](http://semver.org/) for its public API. The public API for this project | ||
is defined as the CLI interface of the [moodle-plugin-ci](bin/moodle-plugin-ci) script. _Everything_ outside of this | ||
script is considered to be private API and is not guaranteed to follow Semantic Versioning. | ||
|
||
The commands ran via the `moodle-plugin-ci` script by default take no arguments. It is recommended, if at all possible, | ||
to avoid using arguments to prevent problems with future versions. Rest assured though that if any arguments are | ||
modified, it will be in the [change log](CHANGELOG.md) and the version will be bumped appropriately according to | ||
Semantic Versioning. | ||
|
||
# License | ||
The goal of this project is to facilitate the running of tests and code analysis against a Moodle plugin in | ||
[Travis CI](https://travis-ci.org). All of these tests and tools are run everytime a change is pushed to a GitHub | ||
branch or pull request. | ||
|
||
This project is licensed under the GNU GPL v3 or later. See the [LICENSE](LICENSE) file for details. | ||
All documentation, guides, change log, etc can be found here: https://moodlerooms.github.io/moodle-plugin-ci/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
layout: page | ||
title: Help | ||
--- | ||
|
||
## Change log | ||
|
||
Always a good idea to check the [change log](CHANGELOG.md) if something suddenly breaks or behavior | ||
changed. Also a good place to look for new goodies. | ||
|
||
## Help topics | ||
|
||
* [Travis CI file explained](TravisFileExplained.html): every line of the `.travis.yml` file explained. | ||
* [Add extra Moodle configs](AddExtraConfig.html): how to add extra configs to Moodle `config.php`. | ||
* [Add extra plugins](AddExtraPlugins.html): how to add plugin dependencies to Moodle. | ||
* [Ignoring files](IgnoringFiles.html): how to ignore files that might be causing failures. | ||
* [Testing a plugin against PHP7](PHP7.html): how to test your plugin against PHP7. | ||
* [Generating code coverage](CodeCoverage.html): how to generate code coverage of your plugin. | ||
|
||
## Upgrade guides | ||
|
||
* [Upgrading to Version 2](UPGRADE-2.0.md) | ||
|
||
|
||
## Other help | ||
|
||
If the above links do not help you, maybe someone | ||
[asked it already](https://github.com/moodlerooms/moodle-plugin-ci/issues?q=is%3Aissue%20label%3Aquestion). | ||
If you still cannot find an answer, and Google has failed you as well, then please feel free | ||
to submit an [new issue](https://github.com/moodlerooms/moodle-plugin-ci/issues/new) providing | ||
as many relevant details as possible. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.