Skip to content

Commit 00b13c6

Browse files
committed
Just give GHA a little bit priority over Travis
As far as we are removing Travis CI from core (see MDLSITE-7135) this just applies small tweaks to all the places where stuff related with Travis is documented, always trying to put the GHA alternative earlier in the doc. Basically moving a few paragraphs around and some little details here and there.
1 parent 37efc56 commit 00b13c6

File tree

7 files changed

+55
-54
lines changed

7 files changed

+55
-54
lines changed

docs/AddExtraConfig.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ title: Adding extra configs to Moodle's configuration file
55

66
Sometimes a plugin may require extra config in the Moodle `config.php` file because, for example, it interacts with a
77
non-standard service. This project provides a way to update the `config.php` file with the `add-config` command. Here
8-
is an example of how to use it in your `.travis.yml` file:
8+
is an example of how to use it in your `.github/workflow/*` or `.travis.yml` files:
99

1010
```yaml
11-
install:
1211
- moodle-plugin-ci install
1312
- moodle-plugin-ci add-config '$CFG->foo = "bar";'
1413
- moodle-plugin-ci add-config 'define("BAT", "baz");'
@@ -19,6 +18,7 @@ The first `add-config` call will add `$CFG->foo = "bar";` to the config file and
1918
`define("BAT", "baz");` to the config file, after our first line.
2019

2120
Some things to keep in mind when crafting these calls to `add-config`:
21+
2222
* You might be tempted to reverse the quotes because normally single quotes are used for strings in PHP. While this is
2323
true, we are also using Bash here and using double quotes will cause several problems. In particular, Bash will try
2424
to evaluate the string and replace things like `$CFG` with a Bash variable.

docs/AddExtraPlugins.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ title: Adding extra plugins
55

66
Sometimes the plugin that you are testing may depend on another plugin or even several other plugins. This project
77
provides a way to Git clone the extra plugins and add them to the Moodle test site. Here is an example of how to use
8-
it in your `.travis.yml` file:
8+
it in your `.github/workflow/*` or `.travis.yml` files:
99

1010
```yaml
11-
install:
1211
- moodle-plugin-ci add-plugin moodlehq/moodle-local_hub
1312
- moodle-plugin-ci install
1413
```

docs/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
99
The format of this change log follows the advice given at [Keep a CHANGELOG](http://keepachangelog.com).
1010

1111
## [Unreleased]
12+
### Changed
13+
- Small changes to documentation towards prioritise GitHub Actions over Travis CI.
1214

1315
## [3.4.11] - 2023-03-22
1416
### Changed

docs/Help.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ title: Help
55

66
## Change log
77

8-
Always a good idea to check the [change log](CHANGELOG.md) if something suddenly breaks or behavior
9-
changed. Also a good place to look for new goodies.
8+
Always a good idea to check the [change log](CHANGELOG.md) if something suddenly breaks or behaviour changed. Also a good place to look for new goodies.
109

1110
## Help topics
1211

13-
* [Travis CI file explained](TravisFileExplained.md): every line of the `.travis.dist.yml` file explained.
1412
* [GitHub Actions workflow file explained](GHAFileExplained.md): every line of the `gha.dist.yml` file explained.
13+
* [Travis CI file explained](TravisFileExplained.md): every line of the `.travis.dist.yml` file explained.
1514
* [Add extra Moodle configs](AddExtraConfig.md): how to add extra configs to Moodle `config.php`.
1615
* [Add extra plugins](AddExtraPlugins.md): how to add plugin dependencies to Moodle.
1716
* [Ignoring files](IgnoringFiles.md): how to ignore files that might be causing failures.

docs/IgnoringFiles.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,6 @@ using specific PHP comments. For details see this
1414
In addition, you can ignore additional files by defining `IGNORE_PATHS` and/or `IGNORE_NAMES` environment variables
1515
in your CI workflow file. These environment variables wont work for Grunt tasks, but will for everything else.
1616

17-
`.travis.yml` example:
18-
19-
```yaml
20-
env:
21-
global:
22-
- MOODLE_BRANCH=MOODLE_32_STABLE
23-
- IGNORE_PATHS=vendor/widget,javascript/min-lib.js
24-
- IGNORE_NAMES=*-m.js,bad_lib.php
25-
matrix:
26-
- DB=pgsql
27-
- DB=mysqli
28-
```
29-
3017
`.github/workflow/*` example:
3118

3219
```yaml
@@ -40,28 +27,27 @@ env:
4027
IGNORE_NAMES: '*-m.js,bad_lib.php'
4128
```
4229
43-
Both environment variables take a CSV value. For `IGNORE_PATHS`, it takes relative file paths to ignore. File paths
44-
can be a simple string like `foo/bar` or a regular expression like `/^foo\/bar/`. For `IGNORE_NAMES`, it takes
45-
file names to ignore. File names can be a simple string like `foo.php`, a glob like `*.php` or a regular expression
46-
like `/\.php$/`.
47-
48-
If you need to specify ignore paths for a specific command, then you can define additional environment variables. The
49-
variable names are the same as above, but prefixed with `COMMANDNAME_`.
50-
5130
`.travis.yml` example:
5231

5332
```yaml
5433
env:
5534
global:
5635
- MOODLE_BRANCH=MOODLE_32_STABLE
57-
- CODECHECKER_IGNORE_PATHS=vendor/widget,javascript/min-lib.js
58-
- CODECHECKER_IGNORE_NAMES=*-m.js,bad_lib.php
59-
- PHPUNIT_IGNORE_PATHS=$IGNORE_PATHS,cli
36+
- IGNORE_PATHS=vendor/widget,javascript/min-lib.js
37+
- IGNORE_NAMES=*-m.js,bad_lib.php
6038
matrix:
6139
- DB=pgsql
6240
- DB=mysqli
6341
```
6442

43+
Both environment variables take a CSV value. For `IGNORE_PATHS`, it takes relative file paths to ignore. File paths
44+
can be a simple string like `foo/bar` or a regular expression like `/^foo\/bar/`. For `IGNORE_NAMES`, it takes
45+
file names to ignore. File names can be a simple string like `foo.php`, a glob like `*.php` or a regular expression
46+
like `/\.php$/`.
47+
48+
If you need to specify ignore paths for a specific command, then you can define additional environment variables. The
49+
variable names are the same as above, but prefixed with `COMMANDNAME_`.
50+
6551
`.github/workflow/*` example:
6652

6753
```yaml
@@ -76,6 +62,20 @@ env:
7662
MUSTACHE_IGNORE_NAMES: 'broken.mustache'
7763
```
7864

65+
`.travis.yml` example:
66+
67+
```yaml
68+
env:
69+
global:
70+
- MOODLE_BRANCH=MOODLE_32_STABLE
71+
- CODECHECKER_IGNORE_PATHS=vendor/widget,javascript/min-lib.js
72+
- CODECHECKER_IGNORE_NAMES=*-m.js,bad_lib.php
73+
- PHPUNIT_IGNORE_PATHS=$IGNORE_PATHS,cli
74+
matrix:
75+
- DB=pgsql
76+
- DB=mysqli
77+
```
78+
7979
In the above example, we are adding the `cli` path to our ignore paths for the PHPUnit command (this is also how you
8080
can ignore files for code coverage). Please note that this is a complete override and there is no merging with
8181
`IGNORE_PATHS` and `IGNORE_NAMES`. So, in the above, the PHPUnit command would not ignore the file names

docs/ReleaseNewVersion.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Prior to tagging a release, ensure the following have been updated:
1313
* The `bin/moodle-plugin-ci` also needs to be updated accordingly, setting the `MOODLE_PLUGIN_CI_VERSION` constant
1414
to the version being released.
1515
* If this is a new major version, then CI tool example files and its docs need
16-
to be updated to use the new major version (e.g. for Travis CI make changes
17-
in `.travis.dist.yml` and `doc/TravisFileExplained.md`). Any other version
18-
will automatically be used.
16+
to be updated to use the new major version (e.g. for GitHub Actions
17+
CI make changes in `gha.dist.yml` and `docs/GHAFileExplained.md`).
18+
Any other version will automatically be used.
1919

2020
When all the changes above have been performed, push them straight upstream to
2121
`master` or create a standard PR to get them reviewed and incorporated

docs/index.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ analysis against a Moodle plugin in CI tool of your choice. All of these tests
88
and tools are run everytime a change is pushed to a GitHub branch or pull
99
request.
1010

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
11+
We currently provide user manual how to use it with [GitHub
12+
Actions](https://docs.github.com/en/actions) and [Travis
13+
CI](https://travis-ci.com), if you are using
1414
`moodle-plugin-ci` with other CI services please do share your setup examples
1515
by creating a ticket.
1616

@@ -20,6 +20,7 @@ because you can be more confident that the change wont break anything. There ar
2020
tools, like being able to test your code against multiple databases, multiple PHP versions, etc.
2121

2222
This project supports the following testing frameworks and code analysis tools:
23+
2324
* [PHPUnit](https://phpunit.de)
2425
* [Behat](http://behat.org/)
2526
* [Moodle Code Checker](https://github.com/moodlehq/moodle-local_codechecker)
@@ -46,23 +47,6 @@ Please know older versions (1 and 2) are no longer getting new features and may
4647

4748
Follow steps to get your Moodle plugin building in CI tool of your choice.
4849

49-
### Travis CI
50-
51-
#### Step 1
52-
53-
Sign into [Travis CI](https://travis-ci.com) with your GitHub account. Once you’re signed in, and Travis CI will have
54-
synchronized your repositories from GitHub. Go to your [profile](https://travis-ci.com/profile) page and enable Travis CI
55-
for the plugin you want to build. Now whenever your plugin receives an update or gets a new pull request, Travis CI will
56-
run a build to make sure nothing broke.
57-
58-
#### Step 2
59-
60-
Copy the [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml) file into the
61-
root of your plugin and rename it to `.travis.yml`. Now might be a good time to review the `.travis.yml` contents and
62-
remove anything that is not needed. See this [help document](TravisFileExplained.md) for an explanation about the
63-
contents of the this file. Once you have added the `.travis.yml` file, commit and push up to GitHub, to trigger a
64-
Travis CI build. Navigate back to [Travis CI](https://travis-ci.com) to see if your build passes or fails.
65-
6650
### GitHub Actions
6751

6852
#### Step 1
@@ -81,6 +65,23 @@ Start manual](https://docs.github.com/en/actions/quickstart#viewing-your-workflo
8165
useful. Now whenever you push commits to your plugin repo or it gets a new
8266
pull request, GitHub will run a build to make sure nothing broke.
8367

68+
### Travis CI
69+
70+
#### Step 1
71+
72+
Sign into [Travis CI](https://travis-ci.com) with your GitHub account. Once you’re signed in, and Travis CI will have
73+
synchronized your repositories from GitHub. Go to your [profile](https://travis-ci.com/profile) page and enable Travis CI
74+
for the plugin you want to build. Now whenever your plugin receives an update or gets a new pull request, Travis CI will
75+
run a build to make sure nothing broke.
76+
77+
#### Step 2
78+
79+
Copy the [.travis.dist.yml](https://github.com/moodlehq/moodle-plugin-ci/blob/master/.travis.dist.yml) file into the
80+
root of your plugin and rename it to `.travis.yml`. Now might be a good time to review the `.travis.yml` contents and
81+
remove anything that is not needed. See this [help document](TravisFileExplained.md) for an explanation about the
82+
contents of the this file. Once you have added the `.travis.yml` file, commit and push up to GitHub, to trigger a
83+
Travis CI build. Navigate back to [Travis CI](https://travis-ci.com) to see if your build passes or fails.
84+
8485
### Getting more of CI
8586

8687
Next steps on your continuous build journey may include:

0 commit comments

Comments
 (0)