Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Github actions integration: Difference between revisions

From MoodleDocs
Line 21: Line 21:
=== How do I start a build? ===
=== How do I start a build? ===


Whenever you push a change to any branch in your repository... a build will be queued and executed. You can see how all your builds are progressing by going to your moodle.git clone page, then select the actions tab. From there you can filter by branch, by status, access to every build, see failures, relaunch jobs...
Whenever you push a change to any branch in your repository... a build will be queued and executed. You can see how all your builds are progressing by visiting your moodle.git clone page at GitHub, then selecting the actions tab. From there you can filter by branch, by status, access to every build, see failures, relaunch jobs...


[[File:actions_dashboard.png|GitHub Actions "dashboard"]]
[[File:actions_dashboard.png|GitHub Actions "dashboard"]]

Revision as of 00:26, 27 November 2020

Moodle core

Background

Moodle is regularly tested against a matrix of Databases, PHP Versions, and operating systems, however many developers do not have the resources available to run on many of these combinations before pushing an issue for integration as they are time-consuming to both set up and to run.

There are many Continuous Integration tools available to developers, and GitHub Actions is just one of those available to the Open Source community.

Since November 2020 (Moodle 3.5.16 and up), Moodle includes a GitHub Actions configuration file in its repository. This configuration file configures and controls a GitHub build across a matrix of testing environments. This allows developers pushing patches to Moodle to have their code unit tested before it reaches integration. The hope is that the availability of this integration should reduce the number of unit test failures seen during Integration.

Note: Moodle HQ uses the Jenkins CI platform and this should be seen as the canonical CI server for Moodle. The GitHub Actions integration aims is to provide early warning to developers of any issues with their code.

Usage

GitHub Actions are available and enabled by default for all public repositories @ GitHub. You can enable or disable them going to your moodle.git clone page, then settings tab -> actions . Please use the "Allow all" option as far as the integration reuses actions from different sources.

Enabling and disabling GitHub Actions for your repos

For the purpose of this documentation, it is assumed that you are pushing to a public Moodle repository on GitHub. Other integrations are supported, but the service available from GitHub Actions is only available to github public repositories.

How do I start a build?

Whenever you push a change to any branch in your repository... a build will be queued and executed. You can see how all your builds are progressing by visiting your moodle.git clone page at GitHub, then selecting the actions tab. From there you can filter by branch, by status, access to every build, see failures, relaunch jobs...

GitHub Actions "dashboard"

You will receive notifications (by email or web) whenever a build finish (can be configured from your account notification settings). Also, if your branches match the branch names in any issue in the Tracker, you will get there the corresponding pass/fail badges GitHub passing badge. Clicking on them you will access straight to the job details @ GitHub.

And that's all, pretty nice, simple and effective.

Moodle plugins

See Moodle Plugin CI repository for setup instructions.

This integration is being worked out right now, see PR#55 and linked issues for more information. Hopefully available soon.

See also

  • Travis integration: For information about the, also supported, integration with Travis CI facilities.