Note:

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

Github actions integration

From MoodleDocs
Revision as of 16:05, 27 November 2020 by Eloy Lafuente (stronk7) (talk | contribs) (Adding some more links to moodle-plugin-ci WIP)

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, some ongoing issues: - PR#55: About to make moodle-plugin-ci itself to start using GitHub for own CI tests. - #53: About to create a nice and reusable custom action simplifying all the setup for plugins. - #48: About to current attempts to build the very first GitHub Actions to be used by plugins. - ...

(hopefully we'll have a good candidate proposal soon)

See also

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