Skip to content

Commit 98ba7f5

Browse files
committed
Docs changes to reflect this is not limited to Travis CI.
1 parent 480406d commit 98ba7f5

File tree

5 files changed

+96
-14
lines changed

5 files changed

+96
-14
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
[![Total Downloads](https://poser.pugx.org/moodlehq/moodle-plugin-ci/downloads)](//packagist.org/packages/moodlehq/moodle-plugin-ci)
55
[![License](https://poser.pugx.org/moodlehq/moodle-plugin-ci/license)](//packagist.org/packages/moodlehq/moodle-plugin-ci)
66

7-
The goal of this project is to facilitate the running of tests and code analysis against a Moodle plugin in
8-
[Travis CI](https://travis-ci.com). All of these tests and tools are run everytime a change is pushed to a GitHub
9-
branch or pull request.
7+
The goal of this project is to facilitate the running of tests and code
8+
analysis against a Moodle plugin in CI tools, such as [Travis
9+
CI](https://travis-ci.com) or [GitHub
10+
Actions](https://docs.github.com/en/actions). All of these tests and tools
11+
are run everytime a change is pushed to a GitHub branch or pull request.
1012

1113
* [Getting started](https://moodlehq.github.io/moodle-plugin-ci/)
1214
* [Help topics](https://moodlehq.github.io/moodle-plugin-ci/Help.html)

docs/CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt
1212
### Fixed
1313
- `moodle-plugin-ci grunt` now only runs against the `yui/src` directory when configuring the YUI task.
1414
This resolves an issue where an "Unable to find local grunt" message was reported when code was structured in a legacy
15-
format. See #46 for more details.
15+
format. See [#46](https://github.com/moodlehq/moodle-plugin-ci/issues/46) for more details.
1616

1717
### Changed
1818
- `moodle-plugin-ci phpunit` when coverage report is included, phpdbg is called with ignore memory limits param
@@ -21,7 +21,7 @@ The format of this change log follows the advice given at [Keep a CHANGELOG](htt
2121

2222
### Added
2323
- Detect existence of legacy php-webdriver, and use a different Firefox image when it is in use.
24-
- GitHub Actions use manual and example.
24+
- Add [manual](https://github.com/moodlehq/moodle-plugin-ci/blob/master/docs/index.md) and [example](https://github.com/moodlehq/moodle-plugin-ci/blob/master/docs/GHAFileExplained.md) on using GitHub Actions as CI tool.
2525

2626
## [3.0.3] - 2020-10-16
2727
### Changed

docs/GHAFileExplained.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Below is the
88
file with comments added to explain what each section is doing. For additional
99
information please refer to [workflow syntax reference](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions).
1010

11-
If you are familiar with Travis, this should be strightforward to understand
12-
the syntax, you may find this [migration
11+
If you are familiar with Travis, it should be straightforward to understand
12+
the new syntax, also you may find this [migration
1313
manual](https://docs.github.com/en/actions/learn-github-actions/migrating-from-travis-ci-to-github-actions)
1414
useful.
1515

@@ -52,6 +52,9 @@ jobs:
5252
# build will be created. For example below 6 builds will be created in
5353
# total (7.2-pgsql, 7.2-mariadb, 7.3-pgsql, 7.3-mariadb, etc.). If we add
5454
# another branch, total number of builds will become 12.
55+
# If you need to use PHP 7.0 and run phpunit coverage test, make sure you are
56+
# using ubuntu-16.04 virtual environment in this case to have phpdbg or
57+
# this version in the system.
5558
strategy:
5659
fail-fast: false
5760
matrix:

docs/Help.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,75 @@ changed. Also a good place to look for new goodies.
1818
* [Generating code coverage](CodeCoverage.md): how to generate code coverage of your plugin.
1919
* [CLI commands and options](CLI.md): the available `moodle-plugin-ci` commands and their options.
2020

21+
## Test steps quick start
22+
23+
Below is short reference to steps you may find useful to optimise set of test steps you want to
24+
inclide in the CI scenario. For detailed information, see [CLI commands and options](CLI.md) manual.
25+
26+
**moodle-plugin-ci phplint**
27+
28+
This step lints your PHP files to check for syntax errors.
29+
30+
**moodle-plugin-ci phpcpd**
31+
32+
This step runs the PHP Copy/Paste Detector on your plugin. This helps to find
33+
code duplication.
34+
35+
**moodle-plugin-ci phpmd**
36+
37+
This step runs the PHP Mess Detector on your plugin. This helps to find
38+
potential problems with your code which can result in refactoring
39+
opportunities.
40+
41+
**moodle-plugin-ci codechecker**
42+
43+
This step runs the Moodle Code Checker to make sure that your
44+
plugin conforms to the Moodle coding standards. It is highly recommended that
45+
you keep this step. To fail on warnings use `--max-warnings 0`
46+
47+
**moodle-plugin-ci phpdoc**
48+
49+
This step runs Moodle PHPDoc checker on your plugin.
50+
51+
**moodle-plugin-ci validate**
52+
53+
This step runs some light validation on the plugin file structure
54+
and code. Validation can be plugin specific.
55+
56+
**moodle-plugin-ci savepoints**
57+
58+
This step validates your plugin's upgrade steps.
59+
60+
**moodle-plugin-ci mustache**
61+
62+
This step validates the HTML and Javascript in your Mustache templates.
63+
64+
**moodle-plugin-ci grunt**
65+
66+
This step runs Grunt tasks on the plugin. By default, it tries to run tasks
67+
relevant to your plugin and Moodle version, but you can run specific tasks by
68+
passing them as options, e.g.: `moodle-plugin-ci grunt -t task1 -t task2` To
69+
fail on eslint warnings use `--max-lint-warnings 0`
70+
71+
**moodle-plugin-ci phpunit**
72+
73+
This step runs the PHPUnit tests of your plugin. If your plugin has
74+
PHPUnit tests, then it is highly recommended that you keep this step.
75+
76+
**moodle-plugin-ci behat**
77+
78+
This step runs the Behat tests of your plugin. If your plugin has
79+
Behat tests, then it is highly recommended that you keep this step.
80+
There are few important options that you may want to use:
81+
- The auto rerun option allows you to rerun failures X number of times,
82+
default is 2, EG usage: `--auto-rerun 3`
83+
- The dump option allows you to print the failure HTML to the console,
84+
handy for debugging, e.g. usage: `--dump`
85+
- The suite option allows you to set the theme to use for behat test. If
86+
not specified, the default theme is used, e.g. usage: `--suite boost`
87+
- The profile option allows you to set the browser driver to use,
88+
default is Firefox. If you need Chrome, set `--profile chrome`.
89+
2190
## Upgrade guides
2291

2392
* [Upgrading to Version 3](UPGRADE-3.0.md)

docs/index.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,21 @@ layout: page
33
title: Introduction
44
---
55

6-
The goal of this project is to facilitate the running of tests and code analysis against a Moodle plugin in
7-
[Travis CI](https://travis-ci.com). All of these tests and tools are run everytime a change is pushed to a GitHub
8-
branch or pull request.
6+
The goal of this project is to facilitate the running of tests and code
7+
analysis against a Moodle plugin in CI tool of your choice. All of these tests
8+
and tools are run everytime a change is pushed to a GitHub branch or pull
9+
request.
10+
11+
We currently provide user manual how to use it with [Travis
12+
CI](https://travis-ci.com) and [GitHub
13+
Actions](https://docs.github.com/en/actions), if you are using
14+
`moodle-plugin-ci` with other CI services please do share your setup examples
15+
by creating a ticket.
916

1017
Why would you want to do this? It saves you from having to remember to setup and run PHPUnit, Behat, code checker, etc
1118
every single time you make a change. If you have enough test coverage, it also makes accepting pull requests painless
12-
because you can be more confident that the change wont break anything. There are many more advantages to using a
13-
service like Travis CI, like being able to test your code against multiple databases, multiple PHP versions, etc.
19+
because you can be more confident that the change wont break anything. There are many more advantages to use CI
20+
tools, like being able to test your code against multiple databases, multiple PHP versions, etc.
1421

1522
This project supports the following testing frameworks and code analysis tools:
1623
* [PHPUnit](https://phpunit.de)
@@ -76,12 +83,13 @@ pull request, GitHub will run a build to make sure nothing broke.
7683

7784
### Getting more of CI
7885

79-
Congratulations, you are running CI tests on your plugin! Next steps on your continuous build journey include:
86+
Next steps on your continuous build journey may include:
8087

8188
* Reviewing the [help documentation](Help.md) to further improve and customize your build.
8289
* Resolve any build errors you may currently have. Get to that ever rewarding Green Build status.
83-
* Show off your build status by adding the badge to your plugin's README file.
90+
* Show off your build status by adding the build status badge to your plugin's README file.
8491
* Write new tests to increase your code coverage.
92+
* Contribute to this repo if you have improvement idea or found an issue.
8593
* Enjoy your favorite beverage because you no longer have to waste time manually testing your plugin!
8694

8795
## Upgrading

0 commit comments

Comments
 (0)