moodlehq / moodle-plugin-ci

Helps running Moodle plugins analysis checks and tests under various CI environments.
https://moodlehq.github.io/moodle-plugin-ci/
GNU General Public License v3.0
41 stars 43 forks source link

Create a GHA reusable workflow rather than cloning the gha dist everywhere #303

Open aspark21 opened 1 month ago

aspark21 commented 1 month ago

Every time there are changes to the gha.dist.yml we have to copy it across 50 repos and reconcile the repo specific config (matrix, additional plugins) with the template. It's quite a faff to have to keep doing https://github.com/moodlehq/moodle-plugin-ci/blob/main/gha.dist.yml

I wonder wether we could move this around so there is a github actions reusable workflow in the moodle-plugin-ci repo that is kept up to date within here, and in our plugin repos we can just call this reusable workflow, while having the matrix & additional plugins specifically setup thus effortlessly always keeping up to date with all of the improvements to moodle-plugin-ci

Happy to work on it if there is appetite for a pull request.

kabalin commented 1 month ago

Hi @aspark21, that is great suggestion. It would be good to have it as GH action, so PR is welcomed :)

For inspiration, this is a snippet by @andrewnicols outlining how this may look like:

- name: Plugin CI Checks
  uses: moodlehq/moodle-plugin-ci@v3
  with:
    moodle-branch: ${{ matrix.moodle-branch }}
    DB: ${{ matrix.database }}
    # All tests are run by default unless otherwise specified, for example:
    lint: false
    # Or arguments may be specified, for example:
    phpmd:
      args: --max-warnings 0
    behat:
      profile: chrome
      suite: classic
stronk7 commented 1 month ago

Just noting that, if we go the GH Action (vs reusable workflow) way, there is also #53, created long ago.