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
47 stars 46 forks source link

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

Open aspark21 opened 6 months ago

aspark21 commented 6 months 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 6 months 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 6 months ago

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