Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
bbdf5af
initial attempt to move ci checks to their own jobs
jay-oswald Jan 13, 2026
d378331
always skip anchor job
jay-oswald Jan 13, 2026
e2e3b5e
remove anchor jobs, they didn't work as needed
jay-oswald Jan 13, 2026
61a404d
use newer version of artifacts
jay-oswald Jan 13, 2026
5c56672
remove phpunit check from single setup
jay-oswald Jan 13, 2026
6edd338
move behat into matrix, only install in matrix
jay-oswald Jan 13, 2026
4da880f
fix release needs
jay-oswald Jan 13, 2026
24dd3ce
build dockerfiles for moodle versions
jay-oswald Jan 13, 2026
53ea796
publish containers
jay-oswald Jan 13, 2026
7a4bb21
consume new containers
jay-oswald Jan 13, 2026
3e034de
fix container name
jay-oswald Jan 13, 2026
3bb30a7
move container name generator to php
jay-oswald Jan 13, 2026
b9e5e16
fixing privacy of containers
jay-oswald Jan 13, 2026
8a2e05b
remove login step, make single setup single run directly on container
jay-oswald Jan 13, 2026
254fc14
fix publish workflow
jay-oswald Jan 13, 2026
a4561b0
use proper container name
jay-oswald Jan 13, 2026
04ce235
use build action
jay-oswald Jan 13, 2026
e008593
branch to lower
jay-oswald Jan 13, 2026
f05228d
fix container name
jay-oswald Jan 13, 2026
3398f6e
fix python
jay-oswald Jan 13, 2026
d4ede6c
auctally use container name
jay-oswald Jan 13, 2026
cae5452
fix composer build
jay-oswald Jan 13, 2026
56f71ef
go back to composer installs
jay-oswald Jan 13, 2026
1e058d9
go back to cli to build
jay-oswald Jan 13, 2026
1df9083
add npm
jay-oswald Jan 13, 2026
265e59e
add workspace folder
jay-oswald Jan 13, 2026
0280e3d
remove woring directory from prepare matrix
jay-oswald Jan 13, 2026
6162e56
add auth to container
jay-oswald Jan 13, 2026
918efe0
fix container name
jay-oswald Jan 13, 2026
48ac85f
fix container runs on
jay-oswald Jan 13, 2026
b4a3307
change path of ci
jay-oswald Jan 13, 2026
4e4cd3f
fix container usage
jay-oswald Jan 13, 2026
2568bad
use proper moodle directory everywhere
jay-oswald Jan 13, 2026
ecfaf1f
run individual checks directly
jay-oswald Jan 13, 2026
0e96a42
remove last refrence to single-setup
jay-oswald Jan 13, 2026
e456a9a
try removing workspace
jay-oswald Jan 13, 2026
8628068
fix needs needs: prepare_matrix
jay-oswald Jan 13, 2026
b67a57a
hardcode container image
jay-oswald Jan 13, 2026
12cbc9e
fix output properly
jay-oswald Jan 13, 2026
514b82a
make all run in container, add plugin path
jay-oswald Jan 13, 2026
fff4fbe
init plugin ci every time
jay-oswald Jan 13, 2026
81acb34
remove cpd
jay-oswald Jan 13, 2026
9b3be4d
remove ignore-paths
jay-oswald Jan 13, 2026
3e54e22
adding db details even though were doing no-init
jay-oswald Jan 13, 2026
a1c8823
db type typo
jay-oswald Jan 13, 2026
1231da3
add db to codechecker
jay-oswald Jan 13, 2026
ac15942
add support for databases
jay-oswald Jan 13, 2026
9873f2a
dynamically get pgsql version
jay-oswald Jan 13, 2026
ba31b24
remove install, run directly
jay-oswald Jan 13, 2026
06d7c82
access db by name
jay-oswald Jan 13, 2026
d706d48
add more php extenstions
jay-oswald Jan 13, 2026
b1420b7
fix version in includes
jay-oswald Jan 13, 2026
d68d34e
fix node build/install
jay-oswald Jan 13, 2026
241ebb5
change node version, add pgsql to validate
jay-oswald Jan 13, 2026
9983688
set max input vars
jay-oswald Jan 13, 2026
3d81a28
seperate behat
jay-oswald Jan 14, 2026
4e4747b
fix release requirements
jay-oswald Jan 14, 2026
3fca485
install grunt, fix names, ci install for mustache
jay-oswald Jan 14, 2026
84c1b71
behat fixes
jay-oswald Jan 14, 2026
ea765e2
run mustache globally
jay-oswald Jan 14, 2026
205d2bb
remove docker groupadd
jay-oswald Jan 14, 2026
3c5736b
add behat root config
jay-oswald Jan 14, 2026
0a405ae
grunt debug
jay-oswald Jan 14, 2026
2b4924f
re-install grunt cli, path to moodle
jay-oswald Jan 14, 2026
a2a8952
behat and grunt fixes
jay-oswald Jan 14, 2026
07073ff
grunt npm install, mustache verbose
jay-oswald Jan 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 19 additions & 129 deletions .github/plugin/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,18 @@
name: 'Plugin setup'
description: 'Run plugin setup'
inputs:
codechecker_max_warnings:
description: 'Sets the value for --max-warnings on the moodle-plugin-ci codechecker step. Defaults to -1 which means no limit.'
default: '-1'
extra_php_extensions:
description: 'List of additional php packages to install'
extra_plugin_runners:
description: 'Command to install dependencies'
disable_behat:
description: 'Option to disable behat tests'
disable_mustache:
description: 'Option to disable mustache tests'
disable_phpdoc:
description: 'Option to disable phpdoc tests'
disable_phpcs:
description: 'Option to disable code standards (codechecker) tests'
disable_phplint:
description: 'Option to disable phplint tests'
disable_phpunit:
description: 'Option to disable phpunit tests'
disable_grunt:
description: 'Option to disable grunt'
enable_phpmd:
description: 'Option to enable phpmd'
disable_phpcpd:
description: 'Option to disable phpcpd'
disable_ci_validate:
description: 'Option to disable running moodle-plugin-ci validate'

highest_moodle_branch:
description: 'Holds the value of the highest moodle-branch in the test matrix'
php_version:
description: 'PHP version to use'
node_version:
description: 'Node version to use'
database:
description: 'Database type to use'
moodle_branch:
description: 'Moodle branch to use'
runs:
using: "composite"
steps:
Expand All @@ -39,28 +21,28 @@ runs:
with:
path: plugin
submodules: true
- name: Install node ${{ matrix.node }}
- name: Install node ${{ inputs.node_version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
node-version: ${{ inputs.node_version }}

- name: Setup PHP ${{ matrix.php }}
- name: Setup PHP ${{ inputs.php_version }}
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
with:
php-version: ${{ matrix.php }}
php-version: ${{ inputs.php_version }}
ini-values: max_input_vars=5000
extensions: pgsql, mysqli, zip, gd, xmlrpc, soap, ${{ inputs.extra_php_extensions }}
coverage: none

- name: Configure Required Composer Version
id: install-composer1
if: ${{ matrix.moodle-branch == 'MOODLE_32_STABLE' || matrix.moodle-branch == 'MOODLE_33_STABLE' }}
if: ${{ inputs.moodle_branch == 'MOODLE_32_STABLE' || inputs.moodle_branch == 'MOODLE_33_STABLE' }}
run: |
echo "::set-output name=COMPOSER_VERSION::--1"
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses the deprecated set-output command. Update to the newer syntax: echo \"COMPOSER_VERSION=--1\" >> $GITHUB_OUTPUT

Suggested change
echo "::set-output name=COMPOSER_VERSION::--1"
echo "COMPOSER_VERSION=--1" >> $GITHUB_OUTPUT

Copilot uses AI. Check for mistakes.
shell: bash

- name: Update Composer
if: ${{ matrix.moodle-branch == 'MOODLE_32_STABLE' || matrix.moodle-branch == 'MOODLE_33_STABLE' }}
if: ${{ inputs.moodle_branch == 'MOODLE_32_STABLE' || inputs.moodle_branch == 'MOODLE_33_STABLE' }}
run: |
composer self-update ${{ steps.install-composer1.outputs.COMPOSER_VERSION }}
shell: bash
Expand Down Expand Up @@ -101,16 +83,16 @@ runs:
echo "::endgroup::"
shell: bash
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
DB: ${{ inputs.database }}
MOODLE_BRANCH: ${{ inputs.moodle_branch }}

- name: Install Core Patches
if: ${{ always() }}
# Install core patches to moodle in temporary directory
run: |
git config --global user.email "test@test.com"
git config --global user.name "Test"
((test -f plugin/patch/${{ matrix.moodle-branch }}.diff && cd $GITHUB_WORKSPACE/moodletemp && git am --whitespace=nowarn < ../plugin/patch/${{ matrix.moodle-branch }}.diff) || echo No patch found;)
((test -f plugin/patch/${{ inputs.moodle_branch }}.diff && cd $GITHUB_WORKSPACE/moodletemp && git am --whitespace=nowarn < ../plugin/patch/${{ inputs.moodle_branch }}.diff) || echo No patch found;)
shell: bash

- name: Install Moodle and Plugin
Expand All @@ -127,98 +109,6 @@ runs:
echo "::endgroup::"
shell: bash
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
DB: ${{ inputs.database }}
MOODLE_BRANCH: ${{ inputs.moodle_branch }}

- name: Run phplint
if: ${{ always() && inputs.disable_phplint != 'true' }}
run: moodle-plugin-ci phplint
shell: bash

- name: Run codechecker
if: ${{ always() && inputs.disable_phpcs != 'true' }}
run: moodle-plugin-ci codechecker --max-warnings=${{ inputs.codechecker_max_warnings }}
shell: bash

- name: Run validate
if: ${{ always() && inputs.disable_ci_validate != 'true' }}
run: moodle-plugin-ci validate
shell: bash

- name: Run savepoints
if: ${{ always() }}
run: moodle-plugin-ci savepoints
shell: bash

- name: Run mustache
if: ${{ always() && inputs.disable_mustache != 'true' }}
run: moodle-plugin-ci mustache
shell: bash

- name: Run grunt
if: ${{ always() && inputs.disable_grunt != 'true' && inputs.highest_moodle_branch == matrix.moodle-branch }}
run: moodle-plugin-ci grunt
shell: bash

- name: Run phpunit
if: ${{ always() && inputs.disable_phpunit != 'true' }}
run: |
moodle-plugin-ci phpunit
cd moodle
vendor/bin/phpunit --fail-on-risky --disallow-test-output --filter tool_dataprivacy_metadata_registry_testcase
vendor/bin/phpunit --fail-on-risky --disallow-test-output --testsuite core_privacy_testsuite --filter provider_testcase
shell: bash

- name: Run behat
if: ${{ always() && inputs.disable_behat != 'true' }}
run: moodle-plugin-ci behat --profile chrome
shell: bash

- name: PHP Copy/Paste Detector
if: ${{ always() && inputs.disable_phpcpd != 'true' }}
run: moodle-plugin-ci phpcpd
shell: bash

- name: PHP Mess Detector
if: ${{ always() && inputs.enable_phpmd == 'true' }}
run: moodle-plugin-ci phpmd
shell: bash

- name: Moodle PHPDoc Checker
if: ${{ always() && inputs.disable_phpdoc != 'true' && inputs.highest_moodle_branch == matrix.moodle-branch }}
# Run this check and only fail CI if it's on 4.0+ / master
run: |
# phpdoc checks

# Don't stop on faiures
set +e

# Note this block whilst large, was made so that it can be pasted locally if needed and isn't CI specific
# Disclaimer: you'll need to adjust the main command but otherwise the handling of output remains the same.
output=`GITHUB_PATH=$GITHUB_PATH moodle-plugin-ci phpdoc`
haserrors=$?

# No errors? Print and return.
if [[ $haserrors -eq 0 ]]; then
echo "phpdoc checks - OK"
exit 0
fi

# Skip incorrect errors/warnings and retain the relevant lines.
output=`echo "$output" | grep -v 'Class ( is not documented' | grep -v 'Could not connect to debugging client.'`
output=`echo "$output" | grep -B1 'Line'`

# Filter out github actions paths from the output. It should only
# show the path relevant to the files in the plugin repo.
# For example:
# from /home/runner/work/moodle-tool_dataflows/moodle-tool_dataflows/moodle/admin/tool/dataflows/db/upgrade.php
# to db/upgrade.php at best,
# or admin/tool/dataflows/db/upgrade.php
currentdir=$(pwd)
if [[ "$output" ]]; then
echo "$output" | sed -e "s,$currentdir/,,g" | sed -e "s,^moodle/,,g" | tee $GITHUB_STEP_SUMMARY
exit 1
fi

echo "phpdoc checks - OK"
shell: bash
Loading