From bbdf5afa4eb752f03adac97004da6582ef7c0e0b Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 11:13:18 +1100 Subject: [PATCH 01/66] initial attempt to move ci checks to their own jobs --- .github/plugin/setup/action.yml | 148 ++++--------------------- .github/workflows/ci.yml | 188 +++++++++++++++++++++++++++++--- 2 files changed, 190 insertions(+), 146 deletions(-) diff --git a/.github/plugin/setup/action.yml b/.github/plugin/setup/action.yml index b26ffb5..22de322 100644 --- a/.github/plugin/setup/action.yml +++ b/.github/plugin/setup/action.yml @@ -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: @@ -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" 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 @@ -101,8 +83,8 @@ 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() }} @@ -110,7 +92,7 @@ runs: 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 @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c522a30..5191eab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,6 +73,17 @@ on: required: false jobs: + # Hidden job used only for YAML anchor inheritance, will not run + _ci_setup: &ci_setup + needs: setup-single + runs-on: ubuntu-latest + steps: + - name: Download canonical workspace + uses: actions/download-artifact@v3 + with: + name: canonical-workspace + path: ${{ github.workspace }} + pre_job: name: check if job needs to run runs-on: ubuntu-latest @@ -119,7 +130,7 @@ jobs: ) ) }} - echo "::set-output name=publishable::$publishable" + echo "publishable=$publishable" >> $GITHUB_OUTPUT - uses: actions/checkout@v3 - name: Check out CI code uses: actions/checkout@v3 @@ -161,10 +172,10 @@ jobs: filter: ${{ inputs.moodle_branches }} min_php: ${{ inputs.min_php }} - setup: + matrix: name: ${{ matrix.moodle-branch }} - ${{ matrix.database }} - php ${{ matrix.php }} - ${{ needs.prepare_matrix.outputs.component }} needs: prepare_matrix - if: needs.pre_job.outputs.should_skip != 'true' + if: needs.pre_job.outputs.should_skip != 'true' && inputs.disable_phpunit != true strategy: fail-fast: false matrix: ${{ fromJson(needs.prepare_matrix.outputs.matrix) }} @@ -219,24 +230,167 @@ jobs: - name: Run plugin setup uses: ./ci/.github/plugin/setup with: - codechecker_max_warnings: ${{ inputs.codechecker_max_warnings }} extra_php_extensions: ${{ inputs.extra_php_extensions }} extra_plugin_runners: ${{ inputs.extra_plugin_runners }} - disable_behat: ${{ inputs.disable_behat }} - disable_grunt: ${{ inputs.disable_grunt }} - disable_mustache: ${{ inputs.disable_mustache }} - disable_phpdoc: ${{ inputs.disable_phpdoc }} - disable_phpcs: ${{ inputs.disable_phpcs }} - disable_phplint: ${{ inputs.disable_phplint }} - disable_phpunit: ${{ inputs.disable_phpunit }} - enable_phpmd: ${{ inputs.enable_phpmd }} - disable_phpcpd: ${{ inputs.disable_phpcpd }} - disable_ci_validate: ${{ inputs.disable_ci_validate }} - highest_moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} + php_version: ${{ matrix.php }} + node_version: ${{ matrix.node }} + database: ${{ matrix.database }} + moodle_branch: ${{ matrix.moodle-branch }} + - name: Run phpunit + 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 + setup-single: + name: Canonical setup for single checks + needs: prepare_matrix + if: needs.pre_job.outputs.should_skip != 'true' && inputs.disable_phpunit != true + runs-on: ubuntu-latest + steps: + - name: Check out CI code + uses: actions/checkout@v3 + with: + path: ci + repository: catalyst/catalyst-moodle-workflows + ref: ${{ inputs.internal_workflow_branch }} + token: ${{ github.token }} + - name: Run plugin setup (canonical) + uses: ./ci/.github/plugin/setup + with: + extra_php_extensions: ${{ inputs.extra_php_extensions }} + extra_plugin_runners: ${{ inputs.extra_plugin_runners }} + php_version: '8.3' + node_version: '20.11' + database: 'pgsql' + moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} + - name: Upload canonical workspace + uses: actions/upload-artifact@v3 + with: + name: canonical-workspace + path: ${{ github.workspace }} + + codechecker: + <<: *ci_setup + name: Codechecker + if: ${{ inputs.disable_phpcs != true }} + steps: + - name: Run codechecker + run: moodle-plugin-ci codechecker --max-warnings=${{ inputs.codechecker_max_warnings }} + shell: bash + + phplint: + <<: *ci_setup + name: PHPLint + if: ${{ inputs.disable_phplint != true }} + steps: + - name: Run phplint + run: moodle-plugin-ci phplint + shell: bash + + validate: + <<: *ci_setup + name: Validate + if: ${{ inputs.disable_ci_validate != true }} + steps: + - name: Run validate + run: moodle-plugin-ci validate + shell: bash + + savepoints: + <<: *ci_setup + name: Savepoints + steps: + - name: Run savepoints + run: moodle-plugin-ci savepoints + shell: bash + + mustache: + <<: *ci_setup + name: Mustache + if: ${{ inputs.disable_mustache != true }} + steps: + - name: Run mustache + run: moodle-plugin-ci mustache + shell: bash + + grunt: + <<: *ci_setup + name: Grunt + if: ${{ inputs.disable_grunt != true }} + steps: + - name: Run grunt + run: moodle-plugin-ci grunt + shell: bash + + phpcpd: + <<: *ci_setup + name: PHPCPD + if: ${{ inputs.disable_phpcpd != true }} + steps: + - name: Run phpcpd + run: moodle-plugin-ci phpcpd + shell: bash + + phpmd: + <<: *ci_setup + name: PHPMD + if: ${{ inputs.enable_phpmd == true }} + steps: + - name: Run phpmd + run: moodle-plugin-ci phpmd + shell: bash + behat: + <<: *ci_setup + name: Behat + if: ${{ inputs.disable_behat != true }} + steps: + - name: Run behat + run: moodle-plugin-ci behat --profile chrome + shell: bash + + phpdoc: + <<: *ci_setup + name: PHPDoc + if: ${{ inputs.disable_phpdoc != true }} + steps: + - name: Run phpdoc + run: | + set +e + output=`GITHUB_PATH=$GITHUB_PATH moodle-plugin-ci phpdoc` + haserrors=$? + if [[ $haserrors -eq 0 ]]; then + echo "phpdoc checks - OK" + exit 0 + fi + output=`echo "$output" | grep -v 'Class ( is not documented' | grep -v 'Could not connect to debugging client.'` + output=`echo "$output" | grep -B1 'Line'` + 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 release: name: Release to the Moodle plugin directory - needs: [setup, prepare_matrix] + needs: + - pre_job + - prepare_matrix + - matrix + - setup-single + - codechecker + - phplint + - validate + - savepoints + - mustache + - grunt + - phpcpd + - phpmd + - behat + - phpdoc # If it matches a standard branch naming convention, it should permit a # release to happen, otherwise this step should be skipped. # Patterns allowed: @@ -253,7 +407,7 @@ jobs: env: SECRET_TO_CHECK: '${{ secrets.moodle_org_token }}' if: ${{ env.SECRET_TO_CHECK != '' }} - run: echo "::set-output name=has-secrets::true" + run: echo "has-secrets=true" >> $GITHUB_OUTPUT - name: Check out CI code uses: actions/checkout@v3 From d3783312d519e6bb51edd3bccc56d60d0b26cbef Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 11:21:03 +1100 Subject: [PATCH 02/66] always skip anchor job Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5191eab..d6d3158 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,6 +75,7 @@ on: jobs: # Hidden job used only for YAML anchor inheritance, will not run _ci_setup: &ci_setup + if: false needs: setup-single runs-on: ubuntu-latest steps: From e2e3b5e2a685edb2dd6526b10cee67b39e1067a2 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 11:24:28 +1100 Subject: [PATCH 03/66] remove anchor jobs, they didn't work as needed --- .github/workflows/ci.yml | 92 +++++++++++++++++++++++++++++++--------- 1 file changed, 71 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6d3158..2a69c27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,17 +73,7 @@ on: required: false jobs: - # Hidden job used only for YAML anchor inheritance, will not run - _ci_setup: &ci_setup - if: false - needs: setup-single - runs-on: ubuntu-latest - steps: - - name: Download canonical workspace - uses: actions/download-artifact@v3 - with: - name: canonical-workspace - path: ${{ github.workspace }} + pre_job: name: check if job needs to run @@ -273,89 +263,149 @@ jobs: path: ${{ github.workspace }} codechecker: - <<: *ci_setup name: Codechecker if: ${{ inputs.disable_phpcs != true }} + runs-on: ubuntu-latest + needs: setup-single steps: + - name: Download canonical workspace + uses: actions/download-artifact@v3 + with: + name: canonical-workspace + path: ${{ github.workspace }} - name: Run codechecker run: moodle-plugin-ci codechecker --max-warnings=${{ inputs.codechecker_max_warnings }} shell: bash phplint: - <<: *ci_setup name: PHPLint if: ${{ inputs.disable_phplint != true }} + runs-on: ubuntu-latest + needs: setup-single steps: + - name: Download canonical workspace + uses: actions/download-artifact@v3 + with: + name: canonical-workspace + path: ${{ github.workspace }} - name: Run phplint run: moodle-plugin-ci phplint shell: bash validate: - <<: *ci_setup name: Validate if: ${{ inputs.disable_ci_validate != true }} + runs-on: ubuntu-latest + needs: setup-single steps: + - name: Download canonical workspace + uses: actions/download-artifact@v3 + with: + name: canonical-workspace + path: ${{ github.workspace }} - name: Run validate run: moodle-plugin-ci validate shell: bash savepoints: - <<: *ci_setup name: Savepoints + runs-on: ubuntu-latest + needs: setup-single steps: + - name: Download canonical workspace + uses: actions/download-artifact@v3 + with: + name: canonical-workspace + path: ${{ github.workspace }} - name: Run savepoints run: moodle-plugin-ci savepoints shell: bash mustache: - <<: *ci_setup name: Mustache if: ${{ inputs.disable_mustache != true }} + runs-on: ubuntu-latest + needs: setup-single steps: + - name: Download canonical workspace + uses: actions/download-artifact@v3 + with: + name: canonical-workspace + path: ${{ github.workspace }} - name: Run mustache run: moodle-plugin-ci mustache shell: bash grunt: - <<: *ci_setup name: Grunt if: ${{ inputs.disable_grunt != true }} + runs-on: ubuntu-latest + needs: setup-single steps: + - name: Download canonical workspace + uses: actions/download-artifact@v3 + with: + name: canonical-workspace + path: ${{ github.workspace }} - name: Run grunt run: moodle-plugin-ci grunt shell: bash phpcpd: - <<: *ci_setup name: PHPCPD if: ${{ inputs.disable_phpcpd != true }} + runs-on: ubuntu-latest + needs: setup-single steps: + - name: Download canonical workspace + uses: actions/download-artifact@v3 + with: + name: canonical-workspace + path: ${{ github.workspace }} - name: Run phpcpd run: moodle-plugin-ci phpcpd shell: bash phpmd: - <<: *ci_setup name: PHPMD if: ${{ inputs.enable_phpmd == true }} + runs-on: ubuntu-latest + needs: setup-single steps: + - name: Download canonical workspace + uses: actions/download-artifact@v3 + with: + name: canonical-workspace + path: ${{ github.workspace }} - name: Run phpmd run: moodle-plugin-ci phpmd shell: bash behat: - <<: *ci_setup name: Behat if: ${{ inputs.disable_behat != true }} + runs-on: ubuntu-latest + needs: setup-single steps: + - name: Download canonical workspace + uses: actions/download-artifact@v3 + with: + name: canonical-workspace + path: ${{ github.workspace }} - name: Run behat run: moodle-plugin-ci behat --profile chrome shell: bash phpdoc: - <<: *ci_setup name: PHPDoc if: ${{ inputs.disable_phpdoc != true }} + runs-on: ubuntu-latest + needs: setup-single steps: + - name: Download canonical workspace + uses: actions/download-artifact@v3 + with: + name: canonical-workspace + path: ${{ github.workspace }} - name: Run phpdoc run: | set +e From 61a404d86750d1c9681e655d50ec81db2bab3dd5 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 11:33:50 +1100 Subject: [PATCH 04/66] use newer version of artifacts --- .github/workflows/ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a69c27..c1537e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -257,7 +257,7 @@ jobs: database: 'pgsql' moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Upload canonical workspace - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: canonical-workspace path: ${{ github.workspace }} @@ -269,7 +269,7 @@ jobs: needs: setup-single steps: - name: Download canonical workspace - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: canonical-workspace path: ${{ github.workspace }} @@ -284,7 +284,7 @@ jobs: needs: setup-single steps: - name: Download canonical workspace - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: canonical-workspace path: ${{ github.workspace }} @@ -299,7 +299,7 @@ jobs: needs: setup-single steps: - name: Download canonical workspace - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: canonical-workspace path: ${{ github.workspace }} @@ -313,7 +313,7 @@ jobs: needs: setup-single steps: - name: Download canonical workspace - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: canonical-workspace path: ${{ github.workspace }} @@ -328,7 +328,7 @@ jobs: needs: setup-single steps: - name: Download canonical workspace - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: canonical-workspace path: ${{ github.workspace }} @@ -343,7 +343,7 @@ jobs: needs: setup-single steps: - name: Download canonical workspace - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: canonical-workspace path: ${{ github.workspace }} @@ -358,7 +358,7 @@ jobs: needs: setup-single steps: - name: Download canonical workspace - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: canonical-workspace path: ${{ github.workspace }} @@ -373,7 +373,7 @@ jobs: needs: setup-single steps: - name: Download canonical workspace - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: canonical-workspace path: ${{ github.workspace }} @@ -387,7 +387,7 @@ jobs: needs: setup-single steps: - name: Download canonical workspace - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: canonical-workspace path: ${{ github.workspace }} @@ -402,7 +402,7 @@ jobs: needs: setup-single steps: - name: Download canonical workspace - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: canonical-workspace path: ${{ github.workspace }} From 5c56672c39ece5e90adc2169e5a2cb299b79a09d Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 11:41:23 +1100 Subject: [PATCH 05/66] remove phpunit check from single setup Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1537e2..ef13166 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -237,7 +237,7 @@ jobs: setup-single: name: Canonical setup for single checks needs: prepare_matrix - if: needs.pre_job.outputs.should_skip != 'true' && inputs.disable_phpunit != true + if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest steps: - name: Check out CI code From 6edd338f3582133911d1ecd1bd8444a704b11cf0 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 12:07:34 +1100 Subject: [PATCH 06/66] move behat into matrix, only install in matrix --- .github/plugin/setup/action.yml | 16 --------------- .github/workflows/ci.yml | 36 +++++++++++++++++++-------------- 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/.github/plugin/setup/action.yml b/.github/plugin/setup/action.yml index 22de322..5adb447 100644 --- a/.github/plugin/setup/action.yml +++ b/.github/plugin/setup/action.yml @@ -95,20 +95,4 @@ runs: ((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 - # Install moodle, but use our temporary directory to include any potential core patches that have been applied. - run: | - # Install moodle commands - echo "::group::Moodle install output" - - # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. - sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' $GITHUB_WORKSPACE/m-ci/src/Validate.php - - moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 --repo $GITHUB_WORKSPACE/moodletemp - - echo "::endgroup::" - shell: bash - env: - DB: ${{ inputs.database }} - MOODLE_BRANCH: ${{ inputs.moodle_branch }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef13166..4a4c455 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -227,6 +227,22 @@ jobs: node_version: ${{ matrix.node }} database: ${{ matrix.database }} moodle_branch: ${{ matrix.moodle-branch }} + - name: Install Moodle and Plugin + # Install moodle, but use our temporary directory to include any potential core patches that have been applied. + run: | + # Install moodle commands + echo "::group::Moodle install output" + + # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. + sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' $GITHUB_WORKSPACE/m-ci/src/Validate.php + + moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 --repo $GITHUB_WORKSPACE/moodletemp + + echo "::endgroup::" + shell: bash + env: + DB: ${{ inputs.database }} + MOODLE_BRANCH: ${{ inputs.moodle_branch }} - name: Run phpunit run: | moodle-plugin-ci phpunit @@ -234,8 +250,12 @@ jobs: 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: ${{ inputs.disable_behat != true }} + run: moodle-plugin-ci behat --profile chrome + shell: bash setup-single: - name: Canonical setup for single checks + name: Common setup for CI checks needs: prepare_matrix if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest @@ -380,20 +400,6 @@ jobs: - name: Run phpmd run: moodle-plugin-ci phpmd shell: bash - behat: - name: Behat - if: ${{ inputs.disable_behat != true }} - runs-on: ubuntu-latest - needs: setup-single - steps: - - name: Download canonical workspace - uses: actions/download-artifact@v4 - with: - name: canonical-workspace - path: ${{ github.workspace }} - - name: Run behat - run: moodle-plugin-ci behat --profile chrome - shell: bash phpdoc: name: PHPDoc From 4da880f3f530ce760caee38dbada1642bbcf9362 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 12:12:40 +1100 Subject: [PATCH 07/66] fix release needs --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a4c455..fc562a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -446,7 +446,6 @@ jobs: - grunt - phpcpd - phpmd - - behat - phpdoc # If it matches a standard branch naming convention, it should permit a # release to happen, otherwise this step should be skipped. From 24dd3cefc6b5ec0516d707695b09ffb63667dac3 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 12:47:44 +1100 Subject: [PATCH 08/66] build dockerfiles for moodle versions --- .github/workflows/build-dockerfiles.yml | 61 +++++++++++++++++++++++++ .github/workflows/ci.yml | 25 ++++------ docker/Dockerfile | 45 ++++++++++++++++++ 3 files changed, 115 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/build-dockerfiles.yml create mode 100644 docker/Dockerfile diff --git a/.github/workflows/build-dockerfiles.yml b/.github/workflows/build-dockerfiles.yml new file mode 100644 index 0000000..46cf9a4 --- /dev/null +++ b/.github/workflows/build-dockerfiles.yml @@ -0,0 +1,61 @@ +name: Build Dockerfiles + +on: + workflow_dispatch: + push: + branches: + - ci-individual-jobs + paths: + - '.github/actions/matrix/matrix_includes.yml' + - 'docker/**' + - '.github/workflows/build-dockerfiles.yml' + +jobs: + build-dockerfiles: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python (for YAML parsing) + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install PyYAML + run: pip install pyyaml + + - name: Extract unique moodle-branch/php matrix + id: set-matrix + run: | + import yaml + import json + with open('.github/actions/matrix/matrix_includes.yml') as f: + data = yaml.safe_load(f) + pairs = set((row['moodle-branch'], row['php']) for row in data['include']) + matrix = [{'moodle-branch': b, 'php': p} for b, p in sorted(pairs)] + print('::set-output name=matrix::' + json.dumps(matrix)) + shell: python + + build: + needs: build-dockerfiles + runs-on: ubuntu-latest + strategy: + matrix: + include: ${{fromJson(needs.build-dockerfiles.outputs.matrix)}} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build Docker image + run: | + repo_name=catalyst-moodle-workflows-${{ matrix.moodle-branch }}-${{ matrix.php }} + repo_name=$(echo "$repo_name" | tr '[:upper:]' '[:lower:]' | tr '_' '-') + docker build \ + --build-arg MOODLE_BRANCH=${{ matrix.moodle-branch }} \ + --build-arg PHP_VERSION=${{ matrix.php }} \ + --build-arg NODE_VERSION=20 \ + -t $repo_name:latest \ + -f docker/Dockerfile . diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc562a6..3750e2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -283,8 +283,6 @@ jobs: path: ${{ github.workspace }} codechecker: - name: Codechecker - if: ${{ inputs.disable_phpcs != true }} runs-on: ubuntu-latest needs: setup-single steps: @@ -294,12 +292,12 @@ jobs: name: canonical-workspace path: ${{ github.workspace }} - name: Run codechecker + if: ${{ inputs.disable_phpcs != true }} run: moodle-plugin-ci codechecker --max-warnings=${{ inputs.codechecker_max_warnings }} shell: bash + phplint: - name: PHPLint - if: ${{ inputs.disable_phplint != true }} runs-on: ubuntu-latest needs: setup-single steps: @@ -309,12 +307,11 @@ jobs: name: canonical-workspace path: ${{ github.workspace }} - name: Run phplint + if: ${{ inputs.disable_phplint != true }} run: moodle-plugin-ci phplint shell: bash validate: - name: Validate - if: ${{ inputs.disable_ci_validate != true }} runs-on: ubuntu-latest needs: setup-single steps: @@ -324,6 +321,7 @@ jobs: name: canonical-workspace path: ${{ github.workspace }} - name: Run validate + if: ${{ inputs.disable_ci_validate != true }} run: moodle-plugin-ci validate shell: bash @@ -342,8 +340,6 @@ jobs: shell: bash mustache: - name: Mustache - if: ${{ inputs.disable_mustache != true }} runs-on: ubuntu-latest needs: setup-single steps: @@ -353,12 +349,11 @@ jobs: name: canonical-workspace path: ${{ github.workspace }} - name: Run mustache + if: ${{ inputs.disable_mustache != true }} run: moodle-plugin-ci mustache shell: bash grunt: - name: Grunt - if: ${{ inputs.disable_grunt != true }} runs-on: ubuntu-latest needs: setup-single steps: @@ -368,12 +363,11 @@ jobs: name: canonical-workspace path: ${{ github.workspace }} - name: Run grunt + if: ${{ inputs.disable_grunt != true }} run: moodle-plugin-ci grunt shell: bash phpcpd: - name: PHPCPD - if: ${{ inputs.disable_phpcpd != true }} runs-on: ubuntu-latest needs: setup-single steps: @@ -383,12 +377,11 @@ jobs: name: canonical-workspace path: ${{ github.workspace }} - name: Run phpcpd + if: ${{ inputs.disable_phpcpd != true }} run: moodle-plugin-ci phpcpd shell: bash phpmd: - name: PHPMD - if: ${{ inputs.enable_phpmd == true }} runs-on: ubuntu-latest needs: setup-single steps: @@ -398,12 +391,11 @@ jobs: name: canonical-workspace path: ${{ github.workspace }} - name: Run phpmd + if: ${{ inputs.enable_phpmd == true }} run: moodle-plugin-ci phpmd shell: bash phpdoc: - name: PHPDoc - if: ${{ inputs.disable_phpdoc != true }} runs-on: ubuntu-latest needs: setup-single steps: @@ -413,6 +405,7 @@ jobs: name: canonical-workspace path: ${{ github.workspace }} - name: Run phpdoc + if: ${{ inputs.disable_phpdoc != true }} run: | set +e output=`GITHUB_PATH=$GITHUB_PATH moodle-plugin-ci phpdoc` diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..7933d4a --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,45 @@ +FROM ubuntu:24.04 + +ARG MOODLE_BRANCH +ARG PHP_VERSION +ARG NODE_VERSION + +# Install dependencies +RUN apt-get update && \ + apt-get install -y lsb-release ca-certificates apt-transport-https software-properties-common curl + +# Add the official PHP repository +RUN add-apt-repository ppa:ondrej/php + +# Install the specified PHP version and common extensions +RUN apt-get update && \ + apt-get install -y php${PHP_VERSION} php${PHP_VERSION}-cli php${PHP_VERSION}-xml php${PHP_VERSION}-mbstring php${PHP_VERSION}-zip php${PHP_VERSION}-pgsql php${PHP_VERSION}-mysql php${PHP_VERSION}-gd php${PHP_VERSION}-soap php${PHP_VERSION}-xmlrpc + +# Symlink for default 'php' command +RUN update-alternatives --set php /usr/bin/php${PHP_VERSION} + + +# Install Node.js (specific version) and other dependencies +RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \ + apt-get install -y nodejs git unzip curl locales && \ + locale-gen en_AU.UTF-8 + +# Install Composer (official recommended method) +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +# Clone Moodle core (example: main branch) +RUN git clone --depth 1 --branch ${MOODLE_BRANCH} https://github.com/moodle/moodle.git /moodle + +# Install moodle-plugin-ci +RUN composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci /ci ^4 + +# Add ci/bin and ci/vendor/bin to PATH +ENV PATH="/ci/bin:/ci/vendor/bin:${PATH}" + +# Set working directory +WORKDIR /workspace + +# Example: Set build args as environment variables +ENV MOODLE_BRANCH=${MOODLE_BRANCH} +ENV PHP_VERSION=${PHP_VERSION} +ENV NODE_VERSION=${NODE_VERSION} \ No newline at end of file From 53ea7967faf105ed50414d4102dffa4c7ddd590c Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 12:51:48 +1100 Subject: [PATCH 09/66] publish containers --- .github/workflows/build-dockerfiles.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/build-dockerfiles.yml b/.github/workflows/build-dockerfiles.yml index 46cf9a4..6c4fae3 100644 --- a/.github/workflows/build-dockerfiles.yml +++ b/.github/workflows/build-dockerfiles.yml @@ -59,3 +59,18 @@ jobs: --build-arg NODE_VERSION=20 \ -t $repo_name:latest \ -f docker/Dockerfile . + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Tag and push Docker image to GHCR + run: | + repo_name=catalyst-moodle-workflows-${{ matrix.moodle-branch }}-${{ matrix.php }} + repo_name=$(echo "$repo_name" | tr '[:upper:]' '[:lower:]' | tr '_' '-') + ghcr_repo=ghcr.io/${{ github.repository_owner }}/$repo_name:latest + docker tag $repo_name:latest $ghcr_repo + docker push $ghcr_repo From 7a4bb210e859902fdd07d8eac3b9cc01773cdabe Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 13:00:02 +1100 Subject: [PATCH 10/66] consume new containers --- .github/plugin/setup/action.yml | 66 +-------------------------------- .github/workflows/ci.yml | 12 +++--- 2 files changed, 7 insertions(+), 71 deletions(-) diff --git a/.github/plugin/setup/action.yml b/.github/plugin/setup/action.yml index 5adb447..b2a2327 100644 --- a/.github/plugin/setup/action.yml +++ b/.github/plugin/setup/action.yml @@ -5,14 +5,8 @@ inputs: description: 'List of additional php packages to install' extra_plugin_runners: description: 'Command to install dependencies' - 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' + description: 'Moodle branch to use (for patching)' runs: using: "composite" steps: @@ -21,74 +15,16 @@ runs: with: path: plugin submodules: true - - name: Install node ${{ inputs.node_version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ inputs.node_version }} - - - name: Setup PHP ${{ inputs.php_version }} - uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0 - with: - 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: ${{ inputs.moodle_branch == 'MOODLE_32_STABLE' || inputs.moodle_branch == 'MOODLE_33_STABLE' }} - run: | - echo "::set-output name=COMPOSER_VERSION::--1" - shell: bash - - - name: Update Composer - 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 - - - name: Initialise moodle-plugin-ci - run: | - # Initialise moodle-plugin-ci (install via composer) - echo "::group::Initialise moodle-plugin-ci" - - composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci m-ci ^4 - # Add dirs to $PATH - echo $(cd m-ci/bin; pwd) >> $GITHUB_PATH - echo $(cd m-ci/vendor/bin; pwd) >> $GITHUB_PATH - # PHPUnit depends on en_AU.UTF-8 locale - sudo locale-gen en_AU.UTF-8 - - echo "::endgroup::" - shell: bash - - name: Install dependencies if: ${{ inputs.extra_plugin_runners }} run: | # Install dependencies echo "::group::Install dependencies" - ${{ inputs.extra_plugin_runners }} - - echo "::endgroup::" - shell: bash - - - name: Clone Moodle - # Clone to a temporary directory - run: | - echo "::group::Moodle clone output" - - git clone https://github.com/moodle/moodle.git --branch $MOODLE_BRANCH $GITHUB_WORKSPACE/moodletemp - echo "::endgroup::" shell: bash - env: - 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" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3750e2e..30ddc79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -176,6 +176,9 @@ jobs: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.moodle-branch }}-${{ matrix.database }}-${{ matrix.php }}-${{ needs.prepare_matrix.outputs.component }} cancel-in-progress: true runs-on: 'ubuntu-latest' + container: + image: ghcr.io/${{ github.repository_owner }}/catalyst-moodle-workflows-${{ matrix.moodle-branch }}-${{ matrix.php }}:latest + options: --user root services: postgres: image: "postgres:${{ matrix.pgsql-ver }}" @@ -223,9 +226,6 @@ jobs: with: extra_php_extensions: ${{ inputs.extra_php_extensions }} extra_plugin_runners: ${{ inputs.extra_plugin_runners }} - php_version: ${{ matrix.php }} - node_version: ${{ matrix.node }} - database: ${{ matrix.database }} moodle_branch: ${{ matrix.moodle-branch }} - name: Install Moodle and Plugin # Install moodle, but use our temporary directory to include any potential core patches that have been applied. @@ -259,6 +259,9 @@ jobs: needs: prepare_matrix if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest + container: + image: ghcr.io/${{ github.repository_owner }}/catalyst-moodle-workflows-${{ needs.prepare_matrix.outputs.highest_moodle_branch }}-8.3:latest + options: --user root steps: - name: Check out CI code uses: actions/checkout@v3 @@ -272,9 +275,6 @@ jobs: with: extra_php_extensions: ${{ inputs.extra_php_extensions }} extra_plugin_runners: ${{ inputs.extra_plugin_runners }} - php_version: '8.3' - node_version: '20.11' - database: 'pgsql' moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Upload canonical workspace uses: actions/upload-artifact@v4 From 3e034ded1f3e5e86a90949568e17ecf08fc1a3b7 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 13:04:11 +1100 Subject: [PATCH 11/66] fix container name --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30ddc79..0461bbc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -177,7 +177,7 @@ jobs: cancel-in-progress: true runs-on: 'ubuntu-latest' container: - image: ghcr.io/${{ github.repository_owner }}/catalyst-moodle-workflows-${{ matrix.moodle-branch }}-${{ matrix.php }}:latest + image: ${{ format('ghcr.io/{0}/catalyst-moodle-workflows-{1}-{2}:latest', github.repository_owner, replace(toLower(matrix.moodle-branch), '_', '-'), replace(toLower(matrix.php), '_', '-')) }} options: --user root services: postgres: @@ -260,7 +260,7 @@ jobs: if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest container: - image: ghcr.io/${{ github.repository_owner }}/catalyst-moodle-workflows-${{ needs.prepare_matrix.outputs.highest_moodle_branch }}-8.3:latest + image: ${{ format('ghcr.io/{0}/catalyst-moodle-workflows-{1}-8.3:latest', github.repository_owner, replace(toLower(needs.prepare_matrix.outputs.highest_moodle_branch), '_', '-')) }} options: --user root steps: - name: Check out CI code From 3bb30a75cef9aafd58b76265858bc733eb20d852 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 13:08:42 +1100 Subject: [PATCH 12/66] move container name generator to php --- .github/actions/parse-version/script.php | 47 +++++++++++++++++++++++- .github/workflows/ci.yml | 4 +- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/.github/actions/parse-version/script.php b/.github/actions/parse-version/script.php index ced1688..f1219e4 100644 --- a/.github/actions/parse-version/script.php +++ b/.github/actions/parse-version/script.php @@ -63,6 +63,18 @@ function output(string $name, string $value) { $updates = json_decode(file_get_contents('https://download.moodle.org/api/1.3/updates.php?format=json&version=0.0&branch=3.8'), true); $updates = $updates['updates']['core'] ?? []; + +// Helper to normalize container name +function container_image_name($owner, $moodle_branch, $php) { + $repo = 'catalyst-moodle-workflows-' + . str_replace('_', '-', strtolower($moodle_branch)) + . '-' + . str_replace('_', '-', strtolower($php)); + return "ghcr.io/$owner/$repo:latest"; +} + +$owner = getenv('GITHUB_REPOSITORY_OWNER') ?: 'catalyst'; + $preparedMatrix = array_filter($matrix['include'], function($entry) use($plugin, $updates, $matrix) { if (!isset($entry)) { @@ -161,12 +173,43 @@ function output(string $name, string $value) { return false; }); -$jsonMatrix = json_encode(['include' => array_values($preparedMatrix)], JSON_UNESCAPED_SLASHES); + +// Add container image name to each entry +$finalMatrix = array_map(function($entry) use ($owner) { + $entry['container'] = container_image_name($owner, $entry['moodle-branch'], $entry['php']); + return $entry; +}, array_values($preparedMatrix)); + +$jsonMatrix = json_encode(['include' => $finalMatrix], JSON_UNESCAPED_SLASHES); output('matrix', $jsonMatrix); // Output the component / plugin name (which would be useful e.g. for a release) output('component', $plugin->component); + // Output the highest available moodle branch in this set, which will be used to // determine whether or not various tests/tasks will run, such as grunt. -output('highest_moodle_branch', reset($preparedMatrix)['moodle-branch'] ?? ''); +$highestMoodleBranch = reset($preparedMatrix)['moodle-branch'] ?? ''; +output('highest_moodle_branch', $highestMoodleBranch); + +// Find the highest PHP version for the highest moodle branch +$phpVersions = []; +foreach ($finalMatrix as $entry) { + if ($entry['moodle-branch'] === $highestMoodleBranch) { + $phpVersions[] = $entry['php']; + } +} +if (!empty($phpVersions)) { + // Use version_compare to find the highest PHP version + usort($phpVersions, 'version_compare'); + $highestPhp = end($phpVersions); + // Find the container for this combo + foreach ($finalMatrix as $entry) { + if ($entry['moodle-branch'] === $highestMoodleBranch && $entry['php'] === $highestPhp) { + output('latest_container', $entry['container']); + break; + } + } +} else { + output('latest_container', ''); +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0461bbc..a4c3990 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -177,7 +177,7 @@ jobs: cancel-in-progress: true runs-on: 'ubuntu-latest' container: - image: ${{ format('ghcr.io/{0}/catalyst-moodle-workflows-{1}-{2}:latest', github.repository_owner, replace(toLower(matrix.moodle-branch), '_', '-'), replace(toLower(matrix.php), '_', '-')) }} + image: ${{ matrix.container }} options: --user root services: postgres: @@ -260,7 +260,7 @@ jobs: if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest container: - image: ${{ format('ghcr.io/{0}/catalyst-moodle-workflows-{1}-8.3:latest', github.repository_owner, replace(toLower(needs.prepare_matrix.outputs.highest_moodle_branch), '_', '-')) }} + image: ${{ needs.prepare_matrix.outputs.latest_container }} options: --user root steps: - name: Check out CI code From b9e5e168c962a4abfe072231c07feffffa62bc43 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 13:20:48 +1100 Subject: [PATCH 13/66] fixing privacy of containers --- .github/workflows/build-dockerfiles.yml | 12 ++++++++++++ .github/workflows/ci.yml | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/.github/workflows/build-dockerfiles.yml b/.github/workflows/build-dockerfiles.yml index 6c4fae3..e03b34a 100644 --- a/.github/workflows/build-dockerfiles.yml +++ b/.github/workflows/build-dockerfiles.yml @@ -74,3 +74,15 @@ jobs: ghcr_repo=ghcr.io/${{ github.repository_owner }}/$repo_name:latest docker tag $repo_name:latest $ghcr_repo docker push $ghcr_repo + - name: Install GitHub CLI + run: sudo apt-get update && sudo apt-get install -y gh + + - name: Make GHCR image public + run: | + repo_name=catalyst-moodle-workflows-${{ matrix.moodle-branch }}-${{ matrix.php }} + repo_name=$(echo "$repo_name" | tr '[:upper:]' '[:lower:]' | tr '_' '-') + ghcr_repo=${{ github.repository_owner }}/$repo_name + echo "Making $ghcr_repo public" + gh api -X PATCH "/users/${{ github.repository_owner }}/packages/container/$repo_name/visibility" -f visibility=public + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4c3990..6e3a3a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,6 +98,9 @@ jobs: group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.moodle_branches }}-${{ inputs.extra_plugin_runners }} cancel-in-progress: true runs-on: 'ubuntu-latest' + defaults: + run: + working-directory: /workspace outputs: matrix: ${{ steps.parse-version.outputs.matrix }} component: ${{ steps.parse-version.outputs.component }} @@ -108,6 +111,12 @@ jobs: steps.check-branch.outputs.publishable == 'true' ) }} steps: + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Check if currently on a publishable branch id: check-branch run: | @@ -207,6 +216,12 @@ jobs: --health-timeout 5s --health-retries 3 steps: + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Set custom environment variables run: | USER_IGNORE_PATHS="${{ inputs.ignore_paths }}" @@ -259,6 +274,9 @@ jobs: needs: prepare_matrix if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest + defaults: + run: + working-directory: /workspace container: image: ${{ needs.prepare_matrix.outputs.latest_container }} options: --user root From 8a2e05b4f866474226e2e6104deab40293491634 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 13:22:49 +1100 Subject: [PATCH 14/66] remove login step, make single setup single run directly on container --- .github/workflows/ci.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e3a3a4..25af326 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,12 +111,6 @@ jobs: steps.check-branch.outputs.publishable == 'true' ) }} steps: - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Check if currently on a publishable branch id: check-branch run: | @@ -216,12 +210,6 @@ jobs: --health-timeout 5s --health-retries 3 steps: - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - name: Set custom environment variables run: | USER_IGNORE_PATHS="${{ inputs.ignore_paths }}" @@ -273,13 +261,10 @@ jobs: name: Common setup for CI checks needs: prepare_matrix if: needs.pre_job.outputs.should_skip != 'true' - runs-on: ubuntu-latest + runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} defaults: run: working-directory: /workspace - container: - image: ${{ needs.prepare_matrix.outputs.latest_container }} - options: --user root steps: - name: Check out CI code uses: actions/checkout@v3 From 254fc140ca74843ecc1beedb323d03dd7aaec5f5 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 13:31:23 +1100 Subject: [PATCH 15/66] fix publish workflow --- .github/workflows/build-dockerfiles.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-dockerfiles.yml b/.github/workflows/build-dockerfiles.yml index e03b34a..648b10d 100644 --- a/.github/workflows/build-dockerfiles.yml +++ b/.github/workflows/build-dockerfiles.yml @@ -83,6 +83,6 @@ jobs: repo_name=$(echo "$repo_name" | tr '[:upper:]' '[:lower:]' | tr '_' '-') ghcr_repo=${{ github.repository_owner }}/$repo_name echo "Making $ghcr_repo public" - gh api -X PATCH "/users/${{ github.repository_owner }}/packages/container/$repo_name/visibility" -f visibility=public + gh api -X PATCH "/orgs/${{ github.repository_owner }}/packages/container/$repo_name/visibility" -f visibility=public env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a4561b028a14d1fdade2fc21988839d9299e4a0c Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 13:35:04 +1100 Subject: [PATCH 16/66] use proper container name --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25af326..ccd7c1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,7 +180,7 @@ jobs: cancel-in-progress: true runs-on: 'ubuntu-latest' container: - image: ${{ matrix.container }} + image: ghcr.io/catalyst/${{ matrix.container }} options: --user root services: postgres: @@ -261,7 +261,7 @@ jobs: name: Common setup for CI checks needs: prepare_matrix if: needs.pre_job.outputs.should_skip != 'true' - runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} + runs-on: ghcr.io/catalyst/${{ needs.prepare_matrix.outputs.latest_container }} defaults: run: working-directory: /workspace From 04ce235bcdbff9ddbe2c9d6701a007a48ea9601b Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 13:42:18 +1100 Subject: [PATCH 17/66] use build action --- .github/workflows/build-dockerfiles.yml | 41 ++++++------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build-dockerfiles.yml b/.github/workflows/build-dockerfiles.yml index 648b10d..21cf018 100644 --- a/.github/workflows/build-dockerfiles.yml +++ b/.github/workflows/build-dockerfiles.yml @@ -48,41 +48,20 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - - name: Build Docker image - run: | - repo_name=catalyst-moodle-workflows-${{ matrix.moodle-branch }}-${{ matrix.php }} - repo_name=$(echo "$repo_name" | tr '[:upper:]' '[:lower:]' | tr '_' '-') - docker build \ - --build-arg MOODLE_BRANCH=${{ matrix.moodle-branch }} \ - --build-arg PHP_VERSION=${{ matrix.php }} \ - --build-arg NODE_VERSION=20 \ - -t $repo_name:latest \ - -f docker/Dockerfile . - - name: Log in to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Push Docker image to GHCR + uses: docker/build-push-action@v5 + with: + context: ./docker/ + push: true + tags: ghcr.io/${{ github.repository_owner }}/catalyst-moodle-workflows-${{ matrix.moodle-branch }}-${{ matrix.php }}:latest + build-args: | + MOODLE_BRANCH=${{ matrix.moodle-branch }} + PHP_VERSION=${{ matrix.php }} + NODE_VERSION=${{ matrix.node }} - - name: Tag and push Docker image to GHCR - run: | - repo_name=catalyst-moodle-workflows-${{ matrix.moodle-branch }}-${{ matrix.php }} - repo_name=$(echo "$repo_name" | tr '[:upper:]' '[:lower:]' | tr '_' '-') - ghcr_repo=ghcr.io/${{ github.repository_owner }}/$repo_name:latest - docker tag $repo_name:latest $ghcr_repo - docker push $ghcr_repo - - name: Install GitHub CLI - run: sudo apt-get update && sudo apt-get install -y gh - - - name: Make GHCR image public - run: | - repo_name=catalyst-moodle-workflows-${{ matrix.moodle-branch }}-${{ matrix.php }} - repo_name=$(echo "$repo_name" | tr '[:upper:]' '[:lower:]' | tr '_' '-') - ghcr_repo=${{ github.repository_owner }}/$repo_name - echo "Making $ghcr_repo public" - gh api -X PATCH "/orgs/${{ github.repository_owner }}/packages/container/$repo_name/visibility" -f visibility=public - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e0085938c31d2a6bc9a87b15da64b346a35a7bdd Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 13:45:11 +1100 Subject: [PATCH 18/66] branch to lower --- .github/workflows/build-dockerfiles.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-dockerfiles.yml b/.github/workflows/build-dockerfiles.yml index 21cf018..75f1ae1 100644 --- a/.github/workflows/build-dockerfiles.yml +++ b/.github/workflows/build-dockerfiles.yml @@ -34,7 +34,7 @@ jobs: import json with open('.github/actions/matrix/matrix_includes.yml') as f: data = yaml.safe_load(f) - pairs = set((row['moodle-branch'], row['php']) for row in data['include']) + pairs = set((row['moodle-branch'].lower(), row['php']) for row in data['include']) matrix = [{'moodle-branch': b, 'php': p} for b, p in sorted(pairs)] print('::set-output name=matrix::' + json.dumps(matrix)) shell: python From f05228dd42b682ca86d8dd8e9dcf0120ee95b625 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 13:48:42 +1100 Subject: [PATCH 19/66] fix container name --- .github/workflows/build-dockerfiles.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-dockerfiles.yml b/.github/workflows/build-dockerfiles.yml index 75f1ae1..f839dd6 100644 --- a/.github/workflows/build-dockerfiles.yml +++ b/.github/workflows/build-dockerfiles.yml @@ -34,8 +34,19 @@ jobs: import json with open('.github/actions/matrix/matrix_includes.yml') as f: data = yaml.safe_load(f) - pairs = set((row['moodle-branch'].lower(), row['php']) for row in data['include']) - matrix = [{'moodle-branch': b, 'php': p} for b, p in sorted(pairs)] + pairs = set((row['moodle-branch'], row['php']) for row in data['include']) + def container_name(branch, php): + name = f"catalyst-moodle-workflows-{branch}-{php}" + name = name.replace('_', '-').lower() + return f"ghcr.io/catalyst/{name}:latest" + matrix = [ + { + 'moodle-branch': b, + 'php': p, + 'container': container_name(b, p) + } + for b, p in sorted(pairs) + ] print('::set-output name=matrix::' + json.dumps(matrix)) shell: python From 3398f6e78e5f761371016ba40ddb8dddf0eec74d Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 13:50:37 +1100 Subject: [PATCH 20/66] fix python --- .github/workflows/build-dockerfiles.yml | 29 ++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-dockerfiles.yml b/.github/workflows/build-dockerfiles.yml index f839dd6..fb5a793 100644 --- a/.github/workflows/build-dockerfiles.yml +++ b/.github/workflows/build-dockerfiles.yml @@ -34,19 +34,28 @@ jobs: import json with open('.github/actions/matrix/matrix_includes.yml') as f: data = yaml.safe_load(f) - pairs = set((row['moodle-branch'], row['php']) for row in data['include']) - def container_name(branch, php): - name = f"catalyst-moodle-workflows-{branch}-{php}" - name = name.replace('_', '-').lower() - return f"ghcr.io/catalyst/{name}:latest" - matrix = [ + pairs = set((row['moodle-branch'], row['php']) for row in data['include']) + + def container_name(branch, php): + name = f"catalyst-moodle-workflows-{branch}-{php}" + name = name.replace('_', '-').lower() + return f"ghcr.io/catalyst/{name}:latest" + + def find_node(branch, php): + for row in data['include']: + if row['moodle-branch'] == branch and row['php'] == php: + return row.get('node', 20) + return 20 + + matrix = [ { - 'moodle-branch': b, - 'php': p, - 'container': container_name(b, p) + 'moodle-branch': b, + 'php': p, + 'node': find_node(b, p), + 'container': container_name(b, p) } for b, p in sorted(pairs) - ] + ] print('::set-output name=matrix::' + json.dumps(matrix)) shell: python From d4ede6cea8b8b0fcc1710fc054d8551f8229e309 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 13:52:52 +1100 Subject: [PATCH 21/66] auctally use container name --- .github/workflows/build-dockerfiles.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-dockerfiles.yml b/.github/workflows/build-dockerfiles.yml index fb5a793..dc183dc 100644 --- a/.github/workflows/build-dockerfiles.yml +++ b/.github/workflows/build-dockerfiles.yml @@ -60,6 +60,7 @@ jobs: shell: python build: + name: ${{ matrix.container }} needs: build-dockerfiles runs-on: ubuntu-latest strategy: @@ -79,7 +80,7 @@ jobs: with: context: ./docker/ push: true - tags: ghcr.io/${{ github.repository_owner }}/catalyst-moodle-workflows-${{ matrix.moodle-branch }}-${{ matrix.php }}:latest + tags: ${{ matrix.container }} build-args: | MOODLE_BRANCH=${{ matrix.moodle-branch }} PHP_VERSION=${{ matrix.php }} From cae5452c49cf3c28cd5ecc7e4995b9c9bf2dbd45 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 13:56:17 +1100 Subject: [PATCH 22/66] fix composer build --- docker/Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 7933d4a..7b60ea1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,3 +1,7 @@ +# Stage 1: Get composer binary +FROM composer:latest AS composer + +# Stage 2: Main build FROM ubuntu:24.04 ARG MOODLE_BRANCH @@ -24,8 +28,8 @@ RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \ apt-get install -y nodejs git unzip curl locales && \ locale-gen en_AU.UTF-8 -# Install Composer (official recommended method) -COPY --from=composer:latest /usr/bin/composer /usr/bin/composer +# Copy Composer from the composer stage +COPY --from=composer /usr/bin/composer /usr/bin/composer # Clone Moodle core (example: main branch) RUN git clone --depth 1 --branch ${MOODLE_BRANCH} https://github.com/moodle/moodle.git /moodle From 56f71efffeae368f34e7a2309e986636bbf27dc8 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 13:58:52 +1100 Subject: [PATCH 23/66] go back to composer installs --- docker/Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 7b60ea1..aca4d50 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,4 @@ -# Stage 1: Get composer binary -FROM composer:latest AS composer -# Stage 2: Main build FROM ubuntu:24.04 ARG MOODLE_BRANCH @@ -28,8 +25,9 @@ RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \ apt-get install -y nodejs git unzip curl locales && \ locale-gen en_AU.UTF-8 -# Copy Composer from the composer stage -COPY --from=composer /usr/bin/composer /usr/bin/composer + +# Install Composer (official recommended method) +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer # Clone Moodle core (example: main branch) RUN git clone --depth 1 --branch ${MOODLE_BRANCH} https://github.com/moodle/moodle.git /moodle From 1e058d91c8e0e74b14efe50f2cb1018aa504f5e7 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 14:03:39 +1100 Subject: [PATCH 24/66] go back to cli to build --- .github/workflows/build-dockerfiles.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-dockerfiles.yml b/.github/workflows/build-dockerfiles.yml index dc183dc..ed415da 100644 --- a/.github/workflows/build-dockerfiles.yml +++ b/.github/workflows/build-dockerfiles.yml @@ -75,14 +75,15 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Build Docker image + run: | + docker build \ + --build-arg MOODLE_BRANCH=${{ matrix.moodle-branch }} \ + --build-arg PHP_VERSION=${{ matrix.php }} \ + --build-arg NODE_VERSION=${{ matrix.node }} \ + -t ${{ matrix.container }} \ + -f docker/Dockerfile docker/ + - name: Push Docker image to GHCR - uses: docker/build-push-action@v5 - with: - context: ./docker/ - push: true - tags: ${{ matrix.container }} - build-args: | - MOODLE_BRANCH=${{ matrix.moodle-branch }} - PHP_VERSION=${{ matrix.php }} - NODE_VERSION=${{ matrix.node }} + run: docker push ${{ matrix.container }} From 1df90831755b30b40971e5dd78c028bc01d18a1c Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 14:09:33 +1100 Subject: [PATCH 25/66] add npm --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index aca4d50..c6568fd 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -22,7 +22,7 @@ RUN update-alternatives --set php /usr/bin/php${PHP_VERSION} # Install Node.js (specific version) and other dependencies RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \ - apt-get install -y nodejs git unzip curl locales && \ + apt-get install -y nodejs npm git unzip curl locales && \ locale-gen en_AU.UTF-8 From 265e59ee2f853a6a7f6af8a8f1bde8dcc5dfbdd8 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 14:22:20 +1100 Subject: [PATCH 26/66] add workspace folder --- docker/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index c6568fd..2576f84 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -38,6 +38,8 @@ RUN composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci # Add ci/bin and ci/vendor/bin to PATH ENV PATH="/ci/bin:/ci/vendor/bin:${PATH}" +RUN mkdir -p /workspace + # Set working directory WORKDIR /workspace From 0280e3d58ad6d8a812487656118415f9d2330eb6 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 14:29:13 +1100 Subject: [PATCH 27/66] remove woring directory from prepare matrix --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ccd7c1b..88fcbe9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,9 +98,6 @@ jobs: group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.moodle_branches }}-${{ inputs.extra_plugin_runners }} cancel-in-progress: true runs-on: 'ubuntu-latest' - defaults: - run: - working-directory: /workspace outputs: matrix: ${{ steps.parse-version.outputs.matrix }} component: ${{ steps.parse-version.outputs.component }} From 6162e56d708e540bf4d353ffefbca6fe38e61c5b Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 14:36:46 +1100 Subject: [PATCH 28/66] add auth to container --- .github/workflows/ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 88fcbe9..7eca6c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -179,6 +179,9 @@ jobs: container: image: ghcr.io/catalyst/${{ matrix.container }} options: --user root + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} services: postgres: image: "postgres:${{ matrix.pgsql-ver }}" @@ -258,7 +261,13 @@ jobs: name: Common setup for CI checks needs: prepare_matrix if: needs.pre_job.outputs.should_skip != 'true' - runs-on: ghcr.io/catalyst/${{ needs.prepare_matrix.outputs.latest_container }} + runs-on: 'ubuntu-latest' + container: + image: ghcr.io/catalyst/${{ needs.prepare_matrix.outputs.latest_container }} + options: --user root + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} defaults: run: working-directory: /workspace From 918efe0725a592f1ed61c7cf6bb7aedfca0e6347 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 14:39:43 +1100 Subject: [PATCH 29/66] fix container name --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7eca6c5..851ebb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -177,7 +177,7 @@ jobs: cancel-in-progress: true runs-on: 'ubuntu-latest' container: - image: ghcr.io/catalyst/${{ matrix.container }} + image: ${{ matrix.container }} options: --user root credentials: username: ${{ github.actor }} @@ -263,7 +263,7 @@ jobs: if: needs.pre_job.outputs.should_skip != 'true' runs-on: 'ubuntu-latest' container: - image: ghcr.io/catalyst/${{ needs.prepare_matrix.outputs.latest_container }} + image: ${{ needs.prepare_matrix.outputs.latest_container }} options: --user root credentials: username: ${{ github.actor }} From 48ac85f9d09f47b8d0e0181afa4dd358a9bdf0a2 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 14:49:17 +1100 Subject: [PATCH 30/66] fix container runs on --- .github/workflows/ci.yml | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 851ebb5..fd02a01 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -175,13 +175,7 @@ jobs: concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.moodle-branch }}-${{ matrix.database }}-${{ matrix.php }}-${{ needs.prepare_matrix.outputs.component }} cancel-in-progress: true - runs-on: 'ubuntu-latest' - container: - image: ${{ matrix.container }} - options: --user root - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + runs-on: ${{ matrix.container }} services: postgres: image: "postgres:${{ matrix.pgsql-ver }}" @@ -261,13 +255,7 @@ jobs: name: Common setup for CI checks needs: prepare_matrix if: needs.pre_job.outputs.should_skip != 'true' - runs-on: 'ubuntu-latest' - container: - image: ${{ needs.prepare_matrix.outputs.latest_container }} - options: --user root - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} defaults: run: working-directory: /workspace @@ -292,7 +280,7 @@ jobs: path: ${{ github.workspace }} codechecker: - runs-on: ubuntu-latest + runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -307,7 +295,7 @@ jobs: phplint: - runs-on: ubuntu-latest + runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -321,7 +309,7 @@ jobs: shell: bash validate: - runs-on: ubuntu-latest + runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -336,7 +324,7 @@ jobs: savepoints: name: Savepoints - runs-on: ubuntu-latest + runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -349,7 +337,7 @@ jobs: shell: bash mustache: - runs-on: ubuntu-latest + runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -363,7 +351,7 @@ jobs: shell: bash grunt: - runs-on: ubuntu-latest + runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -377,7 +365,7 @@ jobs: shell: bash phpcpd: - runs-on: ubuntu-latest + runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -391,7 +379,7 @@ jobs: shell: bash phpmd: - runs-on: ubuntu-latest + runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -405,7 +393,7 @@ jobs: shell: bash phpdoc: - runs-on: ubuntu-latest + runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace From b4a330738a75d6921c7024c89651e6eff8d95ec8 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 14:57:30 +1100 Subject: [PATCH 31/66] change path of ci --- .github/workflows/ci.yml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd02a01..de675ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,7 +162,6 @@ jobs: disable_master: ${{ inputs.disable_master }} filter: ${{ inputs.moodle_branches }} min_php: ${{ inputs.min_php }} - matrix: name: ${{ matrix.moodle-branch }} - ${{ matrix.database }} - php ${{ matrix.php }} - ${{ needs.prepare_matrix.outputs.component }} needs: prepare_matrix @@ -231,7 +230,7 @@ jobs: echo "::group::Moodle install output" # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. - sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' $GITHUB_WORKSPACE/m-ci/src/Validate.php + sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 --repo $GITHUB_WORKSPACE/moodletemp @@ -278,7 +277,6 @@ jobs: with: name: canonical-workspace path: ${{ github.workspace }} - codechecker: runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single @@ -292,8 +290,6 @@ jobs: if: ${{ inputs.disable_phpcs != true }} run: moodle-plugin-ci codechecker --max-warnings=${{ inputs.codechecker_max_warnings }} shell: bash - - phplint: runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single @@ -307,7 +303,6 @@ jobs: if: ${{ inputs.disable_phplint != true }} run: moodle-plugin-ci phplint shell: bash - validate: runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single @@ -321,7 +316,6 @@ jobs: if: ${{ inputs.disable_ci_validate != true }} run: moodle-plugin-ci validate shell: bash - savepoints: name: Savepoints runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} @@ -335,7 +329,6 @@ jobs: - name: Run savepoints run: moodle-plugin-ci savepoints shell: bash - mustache: runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single @@ -349,7 +342,6 @@ jobs: if: ${{ inputs.disable_mustache != true }} run: moodle-plugin-ci mustache shell: bash - grunt: runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single @@ -363,7 +355,6 @@ jobs: if: ${{ inputs.disable_grunt != true }} run: moodle-plugin-ci grunt shell: bash - phpcpd: runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single @@ -377,7 +368,6 @@ jobs: if: ${{ inputs.disable_phpcpd != true }} run: moodle-plugin-ci phpcpd shell: bash - phpmd: runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single @@ -391,7 +381,6 @@ jobs: if: ${{ inputs.enable_phpmd == true }} run: moodle-plugin-ci phpmd shell: bash - phpdoc: runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single @@ -420,7 +409,6 @@ jobs: fi echo "phpdoc checks - OK" shell: bash - release: name: Release to the Moodle plugin directory needs: From 4e4cd3f519ca116ed1448fd9102641819f9ebe8e Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 15:24:02 +1100 Subject: [PATCH 32/66] fix container usage --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de675ca..2e23220 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -174,7 +174,9 @@ jobs: concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.moodle-branch }}-${{ matrix.database }}-${{ matrix.php }}-${{ needs.prepare_matrix.outputs.component }} cancel-in-progress: true - runs-on: ${{ matrix.container }} + runs-on: ubuntu-latest + container: + image: ${{ matrix.container }} services: postgres: image: "postgres:${{ matrix.pgsql-ver }}" @@ -254,7 +256,9 @@ jobs: name: Common setup for CI checks needs: prepare_matrix if: needs.pre_job.outputs.should_skip != 'true' - runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} + runs-on: ubuntu-latest + container: + image: ${{ needs.prepare_matrix.outputs.latest_container }} defaults: run: working-directory: /workspace @@ -278,7 +282,9 @@ jobs: name: canonical-workspace path: ${{ github.workspace }} codechecker: - runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} + runs-on: ubuntu-latest + container: + image: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -291,7 +297,9 @@ jobs: run: moodle-plugin-ci codechecker --max-warnings=${{ inputs.codechecker_max_warnings }} shell: bash phplint: - runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} + runs-on: ubuntu-latest + container: + image: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -304,7 +312,9 @@ jobs: run: moodle-plugin-ci phplint shell: bash validate: - runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} + runs-on: ubuntu-latest + container: + image: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -318,7 +328,9 @@ jobs: shell: bash savepoints: name: Savepoints - runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} + runs-on: ubuntu-latest + container: + image: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -330,7 +342,9 @@ jobs: run: moodle-plugin-ci savepoints shell: bash mustache: - runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} + runs-on: ubuntu-latest + container: + image: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -343,7 +357,9 @@ jobs: run: moodle-plugin-ci mustache shell: bash grunt: - runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} + runs-on: ubuntu-latest + container: + image: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -356,7 +372,9 @@ jobs: run: moodle-plugin-ci grunt shell: bash phpcpd: - runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} + runs-on: ubuntu-latest + container: + image: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -369,7 +387,9 @@ jobs: run: moodle-plugin-ci phpcpd shell: bash phpmd: - runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} + runs-on: ubuntu-latest + container: + image: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace @@ -382,7 +402,9 @@ jobs: run: moodle-plugin-ci phpmd shell: bash phpdoc: - runs-on: ${{ needs.prepare_matrix.outputs.latest_container }} + runs-on: ubuntu-latest + container: + image: ${{ needs.prepare_matrix.outputs.latest_container }} needs: setup-single steps: - name: Download canonical workspace From 2568badcf9d993c27181801d97b7021f5a8ac41d Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 15:44:47 +1100 Subject: [PATCH 33/66] use proper moodle directory everywhere --- .github/plugin/setup/action.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/plugin/setup/action.yml b/.github/plugin/setup/action.yml index b2a2327..6e0d63e 100644 --- a/.github/plugin/setup/action.yml +++ b/.github/plugin/setup/action.yml @@ -28,7 +28,7 @@ runs: run: | git config --global user.email "test@test.com" git config --global user.name "Test" - ((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;) + ((test -f plugin/patch/${{ inputs.moodle_branch }}.diff && cd /moodle && git am --whitespace=nowarn < ../plugin/patch/${{ inputs.moodle_branch }}.diff) || echo No patch found;) shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e23220..f66b663 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -234,7 +234,7 @@ jobs: # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php - moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 --repo $GITHUB_WORKSPACE/moodletemp + moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 --repo /moodle echo "::endgroup::" shell: bash From ecfaf1fa6e40e5466a061c801f9048bc0535f5de Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 15:59:10 +1100 Subject: [PATCH 34/66] run individual checks directly --- .github/workflows/ci.yml | 190 ++++++++++++++++++++++++++------------- 1 file changed, 130 insertions(+), 60 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f66b663..fb0cc91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -252,13 +252,12 @@ jobs: if: ${{ inputs.disable_behat != true }} run: moodle-plugin-ci behat --profile chrome shell: bash - setup-single: - name: Common setup for CI checks - needs: prepare_matrix + codechecker: if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} + needs: setup-single defaults: run: working-directory: /workspace @@ -276,142 +275,214 @@ jobs: extra_php_extensions: ${{ inputs.extra_php_extensions }} extra_plugin_runners: ${{ inputs.extra_plugin_runners }} moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - - name: Upload canonical workspace - uses: actions/upload-artifact@v4 - with: - name: canonical-workspace - path: ${{ github.workspace }} - codechecker: - runs-on: ubuntu-latest - container: - image: ${{ needs.prepare_matrix.outputs.latest_container }} - needs: setup-single - steps: - - name: Download canonical workspace - uses: actions/download-artifact@v4 - with: - name: canonical-workspace - path: ${{ github.workspace }} - name: Run codechecker if: ${{ inputs.disable_phpcs != true }} run: moodle-plugin-ci codechecker --max-warnings=${{ inputs.codechecker_max_warnings }} shell: bash phplint: + if: needs.prepare_matrix.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - needs: setup-single + defaults: + run: + working-directory: /workspace steps: - - name: Download canonical workspace - uses: actions/download-artifact@v4 + - name: Check out CI code + uses: actions/checkout@v3 with: - name: canonical-workspace - path: ${{ github.workspace }} + path: ci + repository: catalyst/catalyst-moodle-workflows + ref: ${{ inputs.internal_workflow_branch }} + token: ${{ github.token }} + - name: Run plugin setup (canonical) + uses: ./ci/.github/plugin/setup + with: + extra_php_extensions: ${{ inputs.extra_php_extensions }} + extra_plugin_runners: ${{ inputs.extra_plugin_runners }} + moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run phplint if: ${{ inputs.disable_phplint != true }} run: moodle-plugin-ci phplint shell: bash validate: + if: needs.prepare_matrix.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - needs: setup-single + defaults: + run: + working-directory: /workspace steps: - - name: Download canonical workspace - uses: actions/download-artifact@v4 + - name: Check out CI code + uses: actions/checkout@v3 + with: + path: ci + repository: catalyst/catalyst-moodle-workflows + ref: ${{ inputs.internal_workflow_branch }} + token: ${{ github.token }} + - name: Run plugin setup (canonical) + uses: ./ci/.github/plugin/setup with: - name: canonical-workspace - path: ${{ github.workspace }} + extra_php_extensions: ${{ inputs.extra_php_extensions }} + extra_plugin_runners: ${{ inputs.extra_plugin_runners }} + moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run validate if: ${{ inputs.disable_ci_validate != true }} run: moodle-plugin-ci validate shell: bash savepoints: name: Savepoints + if: needs.prepare_matrix.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - needs: setup-single + defaults: + run: + working-directory: /workspace steps: - - name: Download canonical workspace - uses: actions/download-artifact@v4 + - name: Check out CI code + uses: actions/checkout@v3 with: - name: canonical-workspace - path: ${{ github.workspace }} + path: ci + repository: catalyst/catalyst-moodle-workflows + ref: ${{ inputs.internal_workflow_branch }} + token: ${{ github.token }} + - name: Run plugin setup (canonical) + uses: ./ci/.github/plugin/setup + with: + extra_php_extensions: ${{ inputs.extra_php_extensions }} + extra_plugin_runners: ${{ inputs.extra_plugin_runners }} + moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run savepoints run: moodle-plugin-ci savepoints shell: bash mustache: + if: needs.prepare_matrix.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - needs: setup-single + defaults: + run: + working-directory: /workspace steps: - - name: Download canonical workspace - uses: actions/download-artifact@v4 + - name: Check out CI code + uses: actions/checkout@v3 with: - name: canonical-workspace - path: ${{ github.workspace }} + path: ci + repository: catalyst/catalyst-moodle-workflows + ref: ${{ inputs.internal_workflow_branch }} + token: ${{ github.token }} + - name: Run plugin setup (canonical) + uses: ./ci/.github/plugin/setup + with: + extra_php_extensions: ${{ inputs.extra_php_extensions }} + extra_plugin_runners: ${{ inputs.extra_plugin_runners }} + moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run mustache if: ${{ inputs.disable_mustache != true }} run: moodle-plugin-ci mustache shell: bash grunt: + if: needs.prepare_matrix.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - needs: setup-single + defaults: + run: + working-directory: /workspace steps: - - name: Download canonical workspace - uses: actions/download-artifact@v4 + - name: Check out CI code + uses: actions/checkout@v3 + with: + path: ci + repository: catalyst/catalyst-moodle-workflows + ref: ${{ inputs.internal_workflow_branch }} + token: ${{ github.token }} + - name: Run plugin setup (canonical) + uses: ./ci/.github/plugin/setup with: - name: canonical-workspace - path: ${{ github.workspace }} + extra_php_extensions: ${{ inputs.extra_php_extensions }} + extra_plugin_runners: ${{ inputs.extra_plugin_runners }} + moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run grunt if: ${{ inputs.disable_grunt != true }} run: moodle-plugin-ci grunt shell: bash phpcpd: + if: needs.prepare_matrix.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - needs: setup-single + defaults: + run: + working-directory: /workspace steps: - - name: Download canonical workspace - uses: actions/download-artifact@v4 + - name: Check out CI code + uses: actions/checkout@v3 with: - name: canonical-workspace - path: ${{ github.workspace }} + path: ci + repository: catalyst/catalyst-moodle-workflows + ref: ${{ inputs.internal_workflow_branch }} + token: ${{ github.token }} + - name: Run plugin setup (canonical) + uses: ./ci/.github/plugin/setup + with: + extra_php_extensions: ${{ inputs.extra_php_extensions }} + extra_plugin_runners: ${{ inputs.extra_plugin_runners }} + moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run phpcpd if: ${{ inputs.disable_phpcpd != true }} run: moodle-plugin-ci phpcpd shell: bash phpmd: + if: needs.prepare_matrix.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - needs: setup-single + defaults: + run: + working-directory: /workspace steps: - - name: Download canonical workspace - uses: actions/download-artifact@v4 + - name: Check out CI code + uses: actions/checkout@v3 with: - name: canonical-workspace - path: ${{ github.workspace }} + path: ci + repository: catalyst/catalyst-moodle-workflows + ref: ${{ inputs.internal_workflow_branch }} + token: ${{ github.token }} + - name: Run plugin setup (canonical) + uses: ./ci/.github/plugin/setup + with: + extra_php_extensions: ${{ inputs.extra_php_extensions }} + extra_plugin_runners: ${{ inputs.extra_plugin_runners }} + moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run phpmd if: ${{ inputs.enable_phpmd == true }} run: moodle-plugin-ci phpmd shell: bash phpdoc: + if: needs.prepare_matrix.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - needs: setup-single + defaults: + run: + working-directory: /workspace steps: - - name: Download canonical workspace - uses: actions/download-artifact@v4 + - name: Check out CI code + uses: actions/checkout@v3 with: - name: canonical-workspace - path: ${{ github.workspace }} + path: ci + repository: catalyst/catalyst-moodle-workflows + ref: ${{ inputs.internal_workflow_branch }} + token: ${{ github.token }} + - name: Run plugin setup (canonical) + uses: ./ci/.github/plugin/setup + with: + extra_php_extensions: ${{ inputs.extra_php_extensions }} + extra_plugin_runners: ${{ inputs.extra_plugin_runners }} + moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run phpdoc if: ${{ inputs.disable_phpdoc != true }} run: | @@ -437,7 +508,6 @@ jobs: - pre_job - prepare_matrix - matrix - - setup-single - codechecker - phplint - validate From 0e96a4297701aa8d56a79d035dc7d353c95a3198 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 16:00:07 +1100 Subject: [PATCH 35/66] remove last refrence to single-setup --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb0cc91..5474c86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -257,7 +257,6 @@ jobs: runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - needs: setup-single defaults: run: working-directory: /workspace From e456a9a290f2385de347415f22e2e21516de8777 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 16:11:07 +1100 Subject: [PATCH 36/66] try removing workspace --- .github/workflows/ci.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5474c86..b7a722e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -234,13 +234,10 @@ jobs: # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php - moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 --repo /moodle + moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 --repo /moodle --branch ${{ matrix.moodle-branch }} --db-type ${{ matrix.database }} --ignore-paths "${IGNORE_PATHS}" echo "::endgroup::" shell: bash - env: - DB: ${{ inputs.database }} - MOODLE_BRANCH: ${{ inputs.moodle_branch }} - name: Run phpunit run: | moodle-plugin-ci phpunit @@ -257,9 +254,6 @@ jobs: runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - defaults: - run: - working-directory: /workspace steps: - name: Check out CI code uses: actions/checkout@v3 @@ -283,9 +277,6 @@ jobs: runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - defaults: - run: - working-directory: /workspace steps: - name: Check out CI code uses: actions/checkout@v3 From 862806802b791d9854a9cebd6e19c78f412f9288 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 16:12:52 +1100 Subject: [PATCH 37/66] fix needs needs: prepare_matrix --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7a722e..df50165 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -254,6 +254,7 @@ jobs: runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} + needs: prepare_matrix steps: - name: Check out CI code uses: actions/checkout@v3 From b67a57aa9bd9aa517e6e46bf2635583bdcf0b028 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 16:16:42 +1100 Subject: [PATCH 38/66] hardcode container image --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df50165..47ba8b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -253,8 +253,7 @@ jobs: if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest container: - image: ${{ needs.prepare_matrix.outputs.latest_container }} - needs: prepare_matrix + image: ghcr.io/catalyst/catalyst-moodle-workflows-moodle-405-stable-8.3:latest steps: - name: Check out CI code uses: actions/checkout@v3 From 12cbc9e7b4d5cd3dfa9c8746d047ce042ca0d56b Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 16:17:45 +1100 Subject: [PATCH 39/66] fix output properly --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47ba8b1..f4db652 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,6 +102,7 @@ jobs: matrix: ${{ steps.parse-version.outputs.matrix }} component: ${{ steps.parse-version.outputs.component }} highest_moodle_branch: ${{ steps.parse-version.outputs.highest_moodle_branch }} + latest_container: ${{ steps.parse-version.outputs.latest_container }} release_required: ${{ ( contains(github.event_name, 'push') && steps.check-version.outputs.any_changed == 'true' && @@ -253,7 +254,8 @@ jobs: if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest container: - image: ghcr.io/catalyst/catalyst-moodle-workflows-moodle-405-stable-8.3:latest + image: ${{ needs.prepare_matrix.outputs.latest_container }} + needs: prepare_matrix steps: - name: Check out CI code uses: actions/checkout@v3 From 514b82ab51943d32453525bd9d587a2c53c20ca9 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 16:23:43 +1100 Subject: [PATCH 40/66] make all run in container, add plugin path --- .github/workflows/ci.yml | 81 +++++++++++----------------------------- 1 file changed, 22 insertions(+), 59 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4db652..7bcddf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -272,13 +272,14 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run codechecker if: ${{ inputs.disable_phpcs != true }} - run: moodle-plugin-ci codechecker --max-warnings=${{ inputs.codechecker_max_warnings }} + run: moodle-plugin-ci codechecker --max-warnings=${{ inputs.codechecker_max_warnings }} ./plugin shell: bash phplint: - if: needs.prepare_matrix.outputs.should_skip != 'true' + if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} + needs: prepare_matrix steps: - name: Check out CI code uses: actions/checkout@v3 @@ -295,16 +296,14 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run phplint if: ${{ inputs.disable_phplint != true }} - run: moodle-plugin-ci phplint + run: moodle-plugin-ci phplint ./plugin shell: bash validate: - if: needs.prepare_matrix.outputs.should_skip != 'true' + if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - defaults: - run: - working-directory: /workspace + needs: prepare_matrix steps: - name: Check out CI code uses: actions/checkout@v3 @@ -321,17 +320,15 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run validate if: ${{ inputs.disable_ci_validate != true }} - run: moodle-plugin-ci validate + run: moodle-plugin-ci validate ./plugin shell: bash savepoints: name: Savepoints - if: needs.prepare_matrix.outputs.should_skip != 'true' + if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - defaults: - run: - working-directory: /workspace + needs: prepare_matrix steps: - name: Check out CI code uses: actions/checkout@v3 @@ -347,16 +344,14 @@ jobs: extra_plugin_runners: ${{ inputs.extra_plugin_runners }} moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run savepoints - run: moodle-plugin-ci savepoints + run: moodle-plugin-ci savepoints ./plugin shell: bash mustache: - if: needs.prepare_matrix.outputs.should_skip != 'true' + if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - defaults: - run: - working-directory: /workspace + needs: prepare_matrix steps: - name: Check out CI code uses: actions/checkout@v3 @@ -373,16 +368,14 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run mustache if: ${{ inputs.disable_mustache != true }} - run: moodle-plugin-ci mustache + run: moodle-plugin-ci mustache ./plugin shell: bash grunt: - if: needs.prepare_matrix.outputs.should_skip != 'true' + if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - defaults: - run: - working-directory: /workspace + needs: prepare_matrix steps: - name: Check out CI code uses: actions/checkout@v3 @@ -399,42 +392,14 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run grunt if: ${{ inputs.disable_grunt != true }} - run: moodle-plugin-ci grunt - shell: bash - phpcpd: - if: needs.prepare_matrix.outputs.should_skip != 'true' - runs-on: ubuntu-latest - container: - image: ${{ needs.prepare_matrix.outputs.latest_container }} - defaults: - run: - working-directory: /workspace - steps: - - name: Check out CI code - uses: actions/checkout@v3 - with: - path: ci - repository: catalyst/catalyst-moodle-workflows - ref: ${{ inputs.internal_workflow_branch }} - token: ${{ github.token }} - - name: Run plugin setup (canonical) - uses: ./ci/.github/plugin/setup - with: - extra_php_extensions: ${{ inputs.extra_php_extensions }} - extra_plugin_runners: ${{ inputs.extra_plugin_runners }} - moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - - name: Run phpcpd - if: ${{ inputs.disable_phpcpd != true }} - run: moodle-plugin-ci phpcpd + run: moodle-plugin-ci grunt ./plugin shell: bash phpmd: - if: needs.prepare_matrix.outputs.should_skip != 'true' + if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - defaults: - run: - working-directory: /workspace + needs: prepare_matrix steps: - name: Check out CI code uses: actions/checkout@v3 @@ -451,16 +416,14 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run phpmd if: ${{ inputs.enable_phpmd == true }} - run: moodle-plugin-ci phpmd + run: moodle-plugin-ci phpmd ./plugin shell: bash phpdoc: - if: needs.prepare_matrix.outputs.should_skip != 'true' + if: needs.pre_job.outputs.should_skip != 'true' runs-on: ubuntu-latest container: image: ${{ needs.prepare_matrix.outputs.latest_container }} - defaults: - run: - working-directory: /workspace + needs: prepare_matrix steps: - name: Check out CI code uses: actions/checkout@v3 @@ -479,7 +442,7 @@ jobs: if: ${{ inputs.disable_phpdoc != true }} run: | set +e - output=`GITHUB_PATH=$GITHUB_PATH moodle-plugin-ci phpdoc` + output=`GITHUB_PATH=$GITHUB_PATH moodle-plugin-ci phpdoc ./plugin` haserrors=$? if [[ $haserrors -eq 0 ]]; then echo "phpdoc checks - OK" From fff4fbe3f22345a2ed62a70f9561abf11be9066b Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 16:28:50 +1100 Subject: [PATCH 41/66] init plugin ci every time --- .github/plugin/setup/action.yml | 13 +++++++++++++ .github/workflows/ci.yml | 19 ++++++++----------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/plugin/setup/action.yml b/.github/plugin/setup/action.yml index 6e0d63e..97cb391 100644 --- a/.github/plugin/setup/action.yml +++ b/.github/plugin/setup/action.yml @@ -30,5 +30,18 @@ runs: git config --global user.name "Test" ((test -f plugin/patch/${{ inputs.moodle_branch }}.diff && cd /moodle && git am --whitespace=nowarn < ../plugin/patch/${{ inputs.moodle_branch }}.diff) || echo No patch found;) shell: bash + - name: Install Moodle and Plugin + # Install moodle, but use our temporary directory to include any potential core patches that have been applied. + shell: bash + run: | + # Install moodle commands + echo "::group::Moodle install output" + + # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. + sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php + + moodle-plugin-ci install -vvv --plugin ./plugin --no-init --repo /moodle --ignore-paths "${IGNORE_PATHS}" + + echo "::endgroup::" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7bcddf4..1a3798a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,9 +232,6 @@ jobs: # Install moodle commands echo "::group::Moodle install output" - # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. - sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php - moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 --repo /moodle --branch ${{ matrix.moodle-branch }} --db-type ${{ matrix.database }} --ignore-paths "${IGNORE_PATHS}" echo "::endgroup::" @@ -272,7 +269,7 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run codechecker if: ${{ inputs.disable_phpcs != true }} - run: moodle-plugin-ci codechecker --max-warnings=${{ inputs.codechecker_max_warnings }} ./plugin + run: moodle-plugin-ci codechecker --max-warnings=${{ inputs.codechecker_max_warnings }} shell: bash phplint: if: needs.pre_job.outputs.should_skip != 'true' @@ -296,7 +293,7 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run phplint if: ${{ inputs.disable_phplint != true }} - run: moodle-plugin-ci phplint ./plugin + run: moodle-plugin-ci phplint shell: bash validate: if: needs.pre_job.outputs.should_skip != 'true' @@ -320,7 +317,7 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run validate if: ${{ inputs.disable_ci_validate != true }} - run: moodle-plugin-ci validate ./plugin + run: moodle-plugin-ci validate shell: bash savepoints: name: Savepoints @@ -344,7 +341,7 @@ jobs: extra_plugin_runners: ${{ inputs.extra_plugin_runners }} moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run savepoints - run: moodle-plugin-ci savepoints ./plugin + run: moodle-plugin-ci savepoints shell: bash mustache: if: needs.pre_job.outputs.should_skip != 'true' @@ -368,7 +365,7 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run mustache if: ${{ inputs.disable_mustache != true }} - run: moodle-plugin-ci mustache ./plugin + run: moodle-plugin-ci mustache shell: bash grunt: if: needs.pre_job.outputs.should_skip != 'true' @@ -392,7 +389,7 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run grunt if: ${{ inputs.disable_grunt != true }} - run: moodle-plugin-ci grunt ./plugin + run: moodle-plugin-ci grunt shell: bash phpmd: if: needs.pre_job.outputs.should_skip != 'true' @@ -416,7 +413,7 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run phpmd if: ${{ inputs.enable_phpmd == true }} - run: moodle-plugin-ci phpmd ./plugin + run: moodle-plugin-ci phpmd shell: bash phpdoc: if: needs.pre_job.outputs.should_skip != 'true' @@ -442,7 +439,7 @@ jobs: if: ${{ inputs.disable_phpdoc != true }} run: | set +e - output=`GITHUB_PATH=$GITHUB_PATH moodle-plugin-ci phpdoc ./plugin` + output=`GITHUB_PATH=$GITHUB_PATH moodle-plugin-ci phpdoc` haserrors=$? if [[ $haserrors -eq 0 ]]; then echo "phpdoc checks - OK" From 81acb34026c4d21734228cad3bab3e4c35c014d7 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 16:29:49 +1100 Subject: [PATCH 42/66] remove cpd --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a3798a..592a586 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -466,7 +466,6 @@ jobs: - savepoints - mustache - grunt - - phpcpd - phpmd - phpdoc # If it matches a standard branch naming convention, it should permit a From 9b3be4d0f0b19b52360809ad04ca4820a1f05a8b Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 16:32:10 +1100 Subject: [PATCH 43/66] remove ignore-paths --- .github/plugin/setup/action.yml | 2 +- .github/workflows/ci.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/plugin/setup/action.yml b/.github/plugin/setup/action.yml index 97cb391..45ba4bc 100644 --- a/.github/plugin/setup/action.yml +++ b/.github/plugin/setup/action.yml @@ -40,7 +40,7 @@ runs: # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php - moodle-plugin-ci install -vvv --plugin ./plugin --no-init --repo /moodle --ignore-paths "${IGNORE_PATHS}" + moodle-plugin-ci install -vvv --plugin ./plugin --no-init --repo /moodle echo "::endgroup::" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 592a586..6448fca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,7 +232,7 @@ jobs: # Install moodle commands echo "::group::Moodle install output" - moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 --repo /moodle --branch ${{ matrix.moodle-branch }} --db-type ${{ matrix.database }} --ignore-paths "${IGNORE_PATHS}" + moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 --repo /moodle --branch ${{ matrix.moodle-branch }} --db-type ${{ matrix.database }} echo "::endgroup::" shell: bash From 3e54e22e204dd564f754cdf74b889728a5f03334 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 16:34:51 +1100 Subject: [PATCH 44/66] adding db details even though were doing no-init --- .github/plugin/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/plugin/setup/action.yml b/.github/plugin/setup/action.yml index 45ba4bc..3c6f80e 100644 --- a/.github/plugin/setup/action.yml +++ b/.github/plugin/setup/action.yml @@ -40,7 +40,7 @@ runs: # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php - moodle-plugin-ci install -vvv --plugin ./plugin --no-init --repo /moodle + moodle-plugin-ci install -vvv --plugin ./plugin --no-init --repo /moodle --db-host=127.0.0.1 -db-type pgsql echo "::endgroup::" From a1c8823e2f046d6f755decd9d4c1f7118f3f4308 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 16:39:00 +1100 Subject: [PATCH 45/66] db type typo --- .github/plugin/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/plugin/setup/action.yml b/.github/plugin/setup/action.yml index 3c6f80e..1a7d48b 100644 --- a/.github/plugin/setup/action.yml +++ b/.github/plugin/setup/action.yml @@ -40,7 +40,7 @@ runs: # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php - moodle-plugin-ci install -vvv --plugin ./plugin --no-init --repo /moodle --db-host=127.0.0.1 -db-type pgsql + moodle-plugin-ci install -vvv --plugin ./plugin --no-init --repo /moodle --db-host=127.0.0.1 --db-type pgsql echo "::endgroup::" From 1231da31469e00e17918d70d49b6ad1f73521fb2 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 16:43:13 +1100 Subject: [PATCH 46/66] add db to codechecker --- .github/workflows/ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6448fca..148b0f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -253,6 +253,19 @@ jobs: container: image: ${{ needs.prepare_matrix.outputs.latest_container }} needs: prepare_matrix + services: + postgres: + image: "postgres:${{ matrix.pgsql-ver }}" + env: + POSTGRES_USER: 'postgres' + POSTGRES_HOST_AUTH_METHOD: 'trust' + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 3 + ports: + - 5432:5432 steps: - name: Check out CI code uses: actions/checkout@v3 From ac15942f476abfe842ef9d1bea005f988bc7762e Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 16:45:37 +1100 Subject: [PATCH 47/66] add support for databases --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 2576f84..f4b94f6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -22,7 +22,7 @@ RUN update-alternatives --set php /usr/bin/php${PHP_VERSION} # Install Node.js (specific version) and other dependencies RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \ - apt-get install -y nodejs npm git unzip curl locales && \ + apt-get install -y nodejs npm git unzip curl locales postgresql mariadb-client && \ locale-gen en_AU.UTF-8 From 9873f2abdde4acc50c7ae0db24d8025280f876a4 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 16:54:48 +1100 Subject: [PATCH 48/66] dynamically get pgsql version --- .github/actions/parse-version/script.php | 6 ++++++ .github/workflows/ci.yml | 3 ++- docker/Dockerfile | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/actions/parse-version/script.php b/.github/actions/parse-version/script.php index f1219e4..dfbe07b 100644 --- a/.github/actions/parse-version/script.php +++ b/.github/actions/parse-version/script.php @@ -207,9 +207,15 @@ function container_image_name($owner, $moodle_branch, $php) { foreach ($finalMatrix as $entry) { if ($entry['moodle-branch'] === $highestMoodleBranch && $entry['php'] === $highestPhp) { output('latest_container', $entry['container']); + if (isset($entry['pgsql-ver'])) { + output('latest_pgsql_ver', $entry['pgsql-ver']); + } else { + output('latest_pgsql_ver', ''); + } break; } } } else { output('latest_container', ''); + output('latest_pgsql_ver', ''); } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 148b0f9..d099d34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,6 +103,7 @@ jobs: component: ${{ steps.parse-version.outputs.component }} highest_moodle_branch: ${{ steps.parse-version.outputs.highest_moodle_branch }} latest_container: ${{ steps.parse-version.outputs.latest_container }} + latest_pgsql_ver: ${{ steps.parse-version.outputs.latest_pgsql_ver }} release_required: ${{ ( contains(github.event_name, 'push') && steps.check-version.outputs.any_changed == 'true' && @@ -255,7 +256,7 @@ jobs: needs: prepare_matrix services: postgres: - image: "postgres:${{ matrix.pgsql-ver }}" + image: "postgres:${{ needs.prepare_matrix.outputs.latest_pgsql_ver }}" env: POSTGRES_USER: 'postgres' POSTGRES_HOST_AUTH_METHOD: 'trust' diff --git a/docker/Dockerfile b/docker/Dockerfile index f4b94f6..efbf52b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -25,7 +25,6 @@ RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \ apt-get install -y nodejs npm git unzip curl locales postgresql mariadb-client && \ locale-gen en_AU.UTF-8 - # Install Composer (official recommended method) RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer From ba31b24c8f167a63a307fb2c2697fb7cf5e7442d Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 17:00:49 +1100 Subject: [PATCH 49/66] remove install, run directly --- .github/plugin/setup/action.yml | 13 ------------- .github/workflows/ci.yml | 19 ++++--------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/.github/plugin/setup/action.yml b/.github/plugin/setup/action.yml index 1a7d48b..6e0d63e 100644 --- a/.github/plugin/setup/action.yml +++ b/.github/plugin/setup/action.yml @@ -30,18 +30,5 @@ runs: git config --global user.name "Test" ((test -f plugin/patch/${{ inputs.moodle_branch }}.diff && cd /moodle && git am --whitespace=nowarn < ../plugin/patch/${{ inputs.moodle_branch }}.diff) || echo No patch found;) shell: bash - - name: Install Moodle and Plugin - # Install moodle, but use our temporary directory to include any potential core patches that have been applied. - shell: bash - run: | - # Install moodle commands - echo "::group::Moodle install output" - - # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. - sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php - - moodle-plugin-ci install -vvv --plugin ./plugin --no-init --repo /moodle --db-host=127.0.0.1 --db-type pgsql - - echo "::endgroup::" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d099d34..804523f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,7 +232,9 @@ jobs: run: | # Install moodle commands echo "::group::Moodle install output" - + # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. + sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php + moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 --repo /moodle --branch ${{ matrix.moodle-branch }} --db-type ${{ matrix.database }} echo "::endgroup::" @@ -254,19 +256,6 @@ jobs: container: image: ${{ needs.prepare_matrix.outputs.latest_container }} needs: prepare_matrix - services: - postgres: - image: "postgres:${{ needs.prepare_matrix.outputs.latest_pgsql_ver }}" - env: - POSTGRES_USER: 'postgres' - POSTGRES_HOST_AUTH_METHOD: 'trust' - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 3 - ports: - - 5432:5432 steps: - name: Check out CI code uses: actions/checkout@v3 @@ -283,7 +272,7 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run codechecker if: ${{ inputs.disable_phpcs != true }} - run: moodle-plugin-ci codechecker --max-warnings=${{ inputs.codechecker_max_warnings }} + run: moodle-plugin-ci codechecker --max-warnings=${{ inputs.codechecker_max_warnings }} ./plugin shell: bash phplint: if: needs.pre_job.outputs.should_skip != 'true' From 06d7c82d1908fbfad7d8675d684da73e239ae617 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 17:09:28 +1100 Subject: [PATCH 50/66] access db by name --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 804523f..18dba34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,7 +180,7 @@ jobs: container: image: ${{ matrix.container }} services: - postgres: + pgsql: image: "postgres:${{ matrix.pgsql-ver }}" env: POSTGRES_USER: 'postgres' @@ -234,8 +234,8 @@ jobs: echo "::group::Moodle install output" # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php - - moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 --repo /moodle --branch ${{ matrix.moodle-branch }} --db-type ${{ matrix.database }} + + moodle-plugin-ci install -vvv --plugin ./plugin --db-host=${{ matrix.database }} --repo /moodle --branch ${{ matrix.moodle-branch }} --db-type ${{ matrix.database }} echo "::endgroup::" shell: bash @@ -296,7 +296,7 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run phplint if: ${{ inputs.disable_phplint != true }} - run: moodle-plugin-ci phplint + run: moodle-plugin-ci phplint ./plugin shell: bash validate: if: needs.pre_job.outputs.should_skip != 'true' @@ -320,7 +320,7 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run validate if: ${{ inputs.disable_ci_validate != true }} - run: moodle-plugin-ci validate + run: moodle-plugin-ci validate ./plugin shell: bash savepoints: name: Savepoints @@ -344,7 +344,7 @@ jobs: extra_plugin_runners: ${{ inputs.extra_plugin_runners }} moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run savepoints - run: moodle-plugin-ci savepoints + run: moodle-plugin-ci savepoints ./plugin shell: bash mustache: if: needs.pre_job.outputs.should_skip != 'true' @@ -368,7 +368,7 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run mustache if: ${{ inputs.disable_mustache != true }} - run: moodle-plugin-ci mustache + run: moodle-plugin-ci mustache ./plugin shell: bash grunt: if: needs.pre_job.outputs.should_skip != 'true' @@ -392,7 +392,7 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run grunt if: ${{ inputs.disable_grunt != true }} - run: moodle-plugin-ci grunt + run: moodle-plugin-ci grunt ./plugin shell: bash phpmd: if: needs.pre_job.outputs.should_skip != 'true' @@ -416,7 +416,7 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run phpmd if: ${{ inputs.enable_phpmd == true }} - run: moodle-plugin-ci phpmd + run: moodle-plugin-ci phpmd ./plugin shell: bash phpdoc: if: needs.pre_job.outputs.should_skip != 'true' @@ -442,7 +442,7 @@ jobs: if: ${{ inputs.disable_phpdoc != true }} run: | set +e - output=`GITHUB_PATH=$GITHUB_PATH moodle-plugin-ci phpdoc` + output=`GITHUB_PATH=$GITHUB_PATH moodle-plugin-ci phpdoc ./plugin` haserrors=$? if [[ $haserrors -eq 0 ]]; then echo "phpdoc checks - OK" From d706d484c8002420746372d24fe2e71e238a8241 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 17:13:02 +1100 Subject: [PATCH 51/66] add more php extenstions --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index efbf52b..d93ceb8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -14,7 +14,7 @@ RUN add-apt-repository ppa:ondrej/php # Install the specified PHP version and common extensions RUN apt-get update && \ - apt-get install -y php${PHP_VERSION} php${PHP_VERSION}-cli php${PHP_VERSION}-xml php${PHP_VERSION}-mbstring php${PHP_VERSION}-zip php${PHP_VERSION}-pgsql php${PHP_VERSION}-mysql php${PHP_VERSION}-gd php${PHP_VERSION}-soap php${PHP_VERSION}-xmlrpc + apt-get install -y php${PHP_VERSION} php${PHP_VERSION}-cli php${PHP_VERSION}-xml php${PHP_VERSION}-mbstring php${PHP_VERSION}-zip php${PHP_VERSION}-pgsql php${PHP_VERSION}-mysql php${PHP_VERSION}-gd php${PHP_VERSION}-soap php${PHP_VERSION}-xmlrpc php${PHP_VERSION}-curl php${PHP_VERSION}-intl # Symlink for default 'php' command RUN update-alternatives --set php /usr/bin/php${PHP_VERSION} From b1420b7e6d395af605d7bbb5a02ecbf25b12b528 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 17:29:26 +1100 Subject: [PATCH 52/66] fix version in includes --- .github/actions/matrix/matrix_includes.yml | 39 ++++++++++------------ 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/actions/matrix/matrix_includes.yml b/.github/actions/matrix/matrix_includes.yml index b32f0e0..d615c65 100644 --- a/.github/actions/matrix/matrix_includes.yml +++ b/.github/actions/matrix/matrix_includes.yml @@ -1,28 +1,23 @@ include: # Always include main (issue #18) - disable-able by config by setting 'disable_master' to true - - {moodle-branch: 'main', php: '8.4', node: '22.11', mariadb-ver: '10.11', pgsql-ver: '14', database: 'pgsql'} + - {moodle-branch: 'main', php: '8.4', node: '22', mariadb-ver: '10.11', pgsql-ver: '15', database: 'pgsql'} # Test all variants of 5.1 - - { moodle-branch: 'MOODLE_501_STABLE', php: '8.4', node: '22.11', mariadb-ver: '10.11', pgsql-ver: '15', database: 'mariadb' } - - { moodle-branch: 'MOODLE_501_STABLE', php: '8.4', node: '22.11', mariadb-ver: '10.11', pgsql-ver: '15', database: 'pgsql' } - - { moodle-branch: 'MOODLE_501_STABLE', php: '8.2', node: '22.11', mariadb-ver: '10.11', pgsql-ver: '15', database: 'mariadb' } - - { moodle-branch: 'MOODLE_501_STABLE', php: '8.2', node: '22.11', mariadb-ver: '10.11', pgsql-ver: '15', database: 'pgsql' } + - { moodle-branch: 'MOODLE_501_STABLE', php: '8.4', node: '22', mariadb-ver: '10.11', pgsql-ver: '15', database: 'mariadb' } + - { moodle-branch: 'MOODLE_501_STABLE', php: '8.4', node: '22', mariadb-ver: '10.11', pgsql-ver: '15', database: 'pgsql' } + - { moodle-branch: 'MOODLE_501_STABLE', php: '8.2', node: '22', mariadb-ver: '10.11', pgsql-ver: '15', database: 'mariadb' } + - { moodle-branch: 'MOODLE_501_STABLE', php: '8.2', node: '22', mariadb-ver: '10.11', pgsql-ver: '15', database: 'pgsql' } # Test all variants of 5.0 - - { moodle-branch: 'MOODLE_500_STABLE', php: '8.4', node: '22.11', mariadb-ver: '10.11', pgsql-ver: '14', database: 'mariadb' } - - { moodle-branch: 'MOODLE_500_STABLE', php: '8.4', node: '22.11', mariadb-ver: '10.11', pgsql-ver: '14', database: 'pgsql' } - - { moodle-branch: 'MOODLE_500_STABLE', php: '8.2', node: '22.11', mariadb-ver: '10.11', pgsql-ver: '14', database: 'mariadb' } - - { moodle-branch: 'MOODLE_500_STABLE', php: '8.2', node: '22.11', mariadb-ver: '10.11', pgsql-ver: '14', database: 'pgsql' } + - { moodle-branch: 'MOODLE_500_STABLE', php: '8.4', node: '22', mariadb-ver: '10.11', pgsql-ver: '14', database: 'mariadb' } + - { moodle-branch: 'MOODLE_500_STABLE', php: '8.4', node: '22', mariadb-ver: '10.11', pgsql-ver: '14', database: 'pgsql' } + - { moodle-branch: 'MOODLE_500_STABLE', php: '8.2', node: '22', mariadb-ver: '10.11', pgsql-ver: '14', database: 'mariadb' } + - { moodle-branch: 'MOODLE_500_STABLE', php: '8.2', node: '22', mariadb-ver: '10.11', pgsql-ver: '14', database: 'pgsql' } # Test all variants of 4.5. - - { moodle-branch: 'MOODLE_405_STABLE', php: '8.3', node: '20.11', mariadb-ver: '10.6', pgsql-ver: '13', database: 'mariadb' } - - { moodle-branch: 'MOODLE_405_STABLE', php: '8.3', node: '20.11', mariadb-ver: '10.6', pgsql-ver: '13', database: 'pgsql' } - - { moodle-branch: 'MOODLE_405_STABLE', php: '8.1', node: '20.11', mariadb-ver: '10.6', pgsql-ver: '13', database: 'mariadb' } - - { moodle-branch: 'MOODLE_405_STABLE', php: '8.1', node: '20.11', mariadb-ver: '10.6', pgsql-ver: '13', database: 'pgsql' } + - { moodle-branch: 'MOODLE_405_STABLE', php: '8.3', node: '20', mariadb-ver: '10.6', pgsql-ver: '13', database: 'mariadb' } + - { moodle-branch: 'MOODLE_405_STABLE', php: '8.3', node: '20', mariadb-ver: '10.6', pgsql-ver: '13', database: 'pgsql' } + - { moodle-branch: 'MOODLE_405_STABLE', php: '8.1', node: '20', mariadb-ver: '10.6', pgsql-ver: '13', database: 'mariadb' } + - { moodle-branch: 'MOODLE_405_STABLE', php: '8.1', node: '20', mariadb-ver: '10.6', pgsql-ver: '13', database: 'pgsql' } # Test all variants of 4.1 (LTS). - - { moodle-branch: 'MOODLE_401_STABLE', php: '7.4', node: '20.11', mariadb-ver: '10.5', pgsql-ver: '12', database: 'mariadb' } - - { moodle-branch: 'MOODLE_401_STABLE', php: '7.4', node: '20.11', mariadb-ver: '10.5', pgsql-ver: '12', database: 'pgsql' } - - { moodle-branch: 'MOODLE_401_STABLE', php: '8.0', node: '20.11', mariadb-ver: '10.5', pgsql-ver: '12', database: 'mariadb' } - - { moodle-branch: 'MOODLE_401_STABLE', php: '8.0', node: '20.11', mariadb-ver: '10.5', pgsql-ver: '12', database: 'pgsql' } - # Also test all variants of 3.9 (LTS). - - {moodle-branch: 'MOODLE_39_STABLE', php: '7.4', node: '16.20', mariadb-ver: '10.5', pgsql-ver: '10', database: 'mariadb'} - - {moodle-branch: 'MOODLE_39_STABLE', php: '7.4', node: '16.20', mariadb-ver: '10.5', pgsql-ver: '10', database: 'pgsql'} - - {moodle-branch: 'MOODLE_39_STABLE', php: '7.4', node: '16.20', mariadb-ver: '10.5', pgsql-ver: '10', database: 'mariadb'} - - {moodle-branch: 'MOODLE_39_STABLE', php: '7.4', node: '16.20', mariadb-ver: '10.5', pgsql-ver: '10', database: 'pgsql'} + - { moodle-branch: 'MOODLE_401_STABLE', php: '7.4', node: '20', mariadb-ver: '10.5', pgsql-ver: '12', database: 'mariadb' } + - { moodle-branch: 'MOODLE_401_STABLE', php: '7.4', node: '20', mariadb-ver: '10.5', pgsql-ver: '12', database: 'pgsql' } + - { moodle-branch: 'MOODLE_401_STABLE', php: '8.0', node: '20', mariadb-ver: '10.5', pgsql-ver: '12', database: 'mariadb' } + - { moodle-branch: 'MOODLE_401_STABLE', php: '8.0', node: '20', mariadb-ver: '10.5', pgsql-ver: '12', database: 'pgsql' } From d68d34e52a3e9923fa6829c26120b5d623d39f0d Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 17:33:47 +1100 Subject: [PATCH 53/66] fix node build/install --- docker/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index d93ceb8..415d7d3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -21,9 +21,9 @@ RUN update-alternatives --set php /usr/bin/php${PHP_VERSION} # Install Node.js (specific version) and other dependencies -RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - && \ - apt-get install -y nodejs npm git unzip curl locales postgresql mariadb-client && \ - locale-gen en_AU.UTF-8 +RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - +RUN apt-get install -y nodejs git unzip curl locales postgresql mariadb-client +RUN locale-gen en_AU.UTF-8 # Install Composer (official recommended method) RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer From 241ebb599790ab337f9481d60a7753fa1ca5c056 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 17:47:48 +1100 Subject: [PATCH 54/66] change node version, add pgsql to validate --- .github/actions/matrix/matrix_includes.yml | 16 +++++++-------- .github/workflows/ci.yml | 24 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/actions/matrix/matrix_includes.yml b/.github/actions/matrix/matrix_includes.yml index d615c65..38d86b4 100644 --- a/.github/actions/matrix/matrix_includes.yml +++ b/.github/actions/matrix/matrix_includes.yml @@ -12,12 +12,12 @@ include: - { moodle-branch: 'MOODLE_500_STABLE', php: '8.2', node: '22', mariadb-ver: '10.11', pgsql-ver: '14', database: 'mariadb' } - { moodle-branch: 'MOODLE_500_STABLE', php: '8.2', node: '22', mariadb-ver: '10.11', pgsql-ver: '14', database: 'pgsql' } # Test all variants of 4.5. - - { moodle-branch: 'MOODLE_405_STABLE', php: '8.3', node: '20', mariadb-ver: '10.6', pgsql-ver: '13', database: 'mariadb' } - - { moodle-branch: 'MOODLE_405_STABLE', php: '8.3', node: '20', mariadb-ver: '10.6', pgsql-ver: '13', database: 'pgsql' } - - { moodle-branch: 'MOODLE_405_STABLE', php: '8.1', node: '20', mariadb-ver: '10.6', pgsql-ver: '13', database: 'mariadb' } - - { moodle-branch: 'MOODLE_405_STABLE', php: '8.1', node: '20', mariadb-ver: '10.6', pgsql-ver: '13', database: 'pgsql' } + - { moodle-branch: 'MOODLE_405_STABLE', php: '8.3', node: '22', mariadb-ver: '10.6', pgsql-ver: '13', database: 'mariadb' } + - { moodle-branch: 'MOODLE_405_STABLE', php: '8.3', node: '22', mariadb-ver: '10.6', pgsql-ver: '13', database: 'pgsql' } + - { moodle-branch: 'MOODLE_405_STABLE', php: '8.1', node: '22', mariadb-ver: '10.6', pgsql-ver: '13', database: 'mariadb' } + - { moodle-branch: 'MOODLE_405_STABLE', php: '8.1', node: '22', mariadb-ver: '10.6', pgsql-ver: '13', database: 'pgsql' } # Test all variants of 4.1 (LTS). - - { moodle-branch: 'MOODLE_401_STABLE', php: '7.4', node: '20', mariadb-ver: '10.5', pgsql-ver: '12', database: 'mariadb' } - - { moodle-branch: 'MOODLE_401_STABLE', php: '7.4', node: '20', mariadb-ver: '10.5', pgsql-ver: '12', database: 'pgsql' } - - { moodle-branch: 'MOODLE_401_STABLE', php: '8.0', node: '20', mariadb-ver: '10.5', pgsql-ver: '12', database: 'mariadb' } - - { moodle-branch: 'MOODLE_401_STABLE', php: '8.0', node: '20', mariadb-ver: '10.5', pgsql-ver: '12', database: 'pgsql' } + - { moodle-branch: 'MOODLE_401_STABLE', php: '7.4', node: '22', mariadb-ver: '10.5', pgsql-ver: '12', database: 'mariadb' } + - { moodle-branch: 'MOODLE_401_STABLE', php: '7.4', node: '22', mariadb-ver: '10.5', pgsql-ver: '12', database: 'pgsql' } + - { moodle-branch: 'MOODLE_401_STABLE', php: '8.0', node: '22', mariadb-ver: '10.5', pgsql-ver: '12', database: 'mariadb' } + - { moodle-branch: 'MOODLE_401_STABLE', php: '8.0', node: '22', mariadb-ver: '10.5', pgsql-ver: '12', database: 'pgsql' } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18dba34..a31d39e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -304,6 +304,19 @@ jobs: container: image: ${{ needs.prepare_matrix.outputs.latest_container }} needs: prepare_matrix + services: + pgsql: + image: "postgres:${{ needs.prepare_matrix.outputs.latest_pgsql_ver }}" + env: + POSTGRES_USER: 'postgres' + POSTGRES_HOST_AUTH_METHOD: 'trust' + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 3 + ports: + - 5432:5432 steps: - name: Check out CI code uses: actions/checkout@v3 @@ -318,6 +331,17 @@ jobs: extra_php_extensions: ${{ inputs.extra_php_extensions }} extra_plugin_runners: ${{ inputs.extra_plugin_runners }} moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} + - name: Install Moodle and Plugin + # Install moodle, but use our temporary directory to include any potential core patches that have been applied. + run: | + # Install moodle commands + echo "::group::Moodle install output" + # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. + sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php + + moodle-plugin-ci install -vvv --plugin ./plugin --db-host=pgsql --repo /moodle --branch ${{ matrix.moodle-branch }} --db-type pgsql + + echo "::endgroup::" - name: Run validate if: ${{ inputs.disable_ci_validate != true }} run: moodle-plugin-ci validate ./plugin From 9983688f90a34bdcd5f1c423e1872df3a8b84186 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Tue, 13 Jan 2026 17:55:26 +1100 Subject: [PATCH 55/66] set max input vars --- docker/Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 415d7d3..618def0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -16,9 +16,16 @@ RUN add-apt-repository ppa:ondrej/php RUN apt-get update && \ apt-get install -y php${PHP_VERSION} php${PHP_VERSION}-cli php${PHP_VERSION}-xml php${PHP_VERSION}-mbstring php${PHP_VERSION}-zip php${PHP_VERSION}-pgsql php${PHP_VERSION}-mysql php${PHP_VERSION}-gd php${PHP_VERSION}-soap php${PHP_VERSION}-xmlrpc php${PHP_VERSION}-curl php${PHP_VERSION}-intl + # Symlink for default 'php' command RUN update-alternatives --set php /usr/bin/php${PHP_VERSION} +# Set PHP max_input_vars to at least 5000 for CLI and FPM (if installed) +RUN echo 'max_input_vars=5000' > /etc/php/${PHP_VERSION}/cli/conf.d/99-max-input-vars.ini \ + && if [ -d "/etc/php/${PHP_VERSION}/fpm/conf.d" ]; then \ + cp /etc/php/${PHP_VERSION}/cli/conf.d/99-max-input-vars.ini /etc/php/${PHP_VERSION}/fpm/conf.d/; \ + fi + # Install Node.js (specific version) and other dependencies RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - From 3d81a284179bbc214e092304df01277da8f11147 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Wed, 14 Jan 2026 12:06:22 +1100 Subject: [PATCH 56/66] seperate behat --- .github/actions/parse-version/script.php | 10 ++- .github/workflows/ci.yml | 83 ++++++++++++++++++++++-- 2 files changed, 83 insertions(+), 10 deletions(-) diff --git a/.github/actions/parse-version/script.php b/.github/actions/parse-version/script.php index dfbe07b..37d39dd 100644 --- a/.github/actions/parse-version/script.php +++ b/.github/actions/parse-version/script.php @@ -65,16 +65,14 @@ function output(string $name, string $value) { // Helper to normalize container name -function container_image_name($owner, $moodle_branch, $php) { +function container_image_name($moodle_branch, $php) { $repo = 'catalyst-moodle-workflows-' . str_replace('_', '-', strtolower($moodle_branch)) . '-' . str_replace('_', '-', strtolower($php)); - return "ghcr.io/$owner/$repo:latest"; + return "ghcr.io/catalyst/$repo:latest"; } -$owner = getenv('GITHUB_REPOSITORY_OWNER') ?: 'catalyst'; - $preparedMatrix = array_filter($matrix['include'], function($entry) use($plugin, $updates, $matrix) { if (!isset($entry)) { @@ -175,8 +173,8 @@ function container_image_name($owner, $moodle_branch, $php) { // Add container image name to each entry -$finalMatrix = array_map(function($entry) use ($owner) { - $entry['container'] = container_image_name($owner, $entry['moodle-branch'], $entry['php']); +$finalMatrix = array_map(function($entry) { + $entry['container'] = container_image_name($entry['moodle-branch'], $entry['php']); return $entry; }, array_values($preparedMatrix)); diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a31d39e..919d35a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,8 +164,8 @@ jobs: disable_master: ${{ inputs.disable_master }} filter: ${{ inputs.moodle_branches }} min_php: ${{ inputs.min_php }} - matrix: - name: ${{ matrix.moodle-branch }} - ${{ matrix.database }} - php ${{ matrix.php }} - ${{ needs.prepare_matrix.outputs.component }} + matrix-unit-tests: + name: ${{ matrix.branch }} - ${{ matrix.php }} - ${{ matrix.database }} - unit tests needs: prepare_matrix if: needs.pre_job.outputs.should_skip != 'true' && inputs.disable_phpunit != true strategy: @@ -174,7 +174,7 @@ jobs: env: IGNORE_PATHS: tests/fixtures concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.moodle-branch }}-${{ matrix.database }}-${{ matrix.php }}-${{ needs.prepare_matrix.outputs.component }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.moodle-branch }}-${{ matrix.database }}-${{ matrix.php }}-${{ needs.prepare_matrix.outputs.component }}-unit cancel-in-progress: true runs-on: ubuntu-latest container: @@ -246,6 +246,81 @@ jobs: 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 + matrix-behat: + name: ${{ matrix.branch }} - ${{ matrix.php }} - ${{ matrix.database }} - behat tests + needs: prepare_matrix + if: needs.pre_job.outputs.should_skip != 'true' && inputs.disable_phpunit != true + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.prepare_matrix.outputs.matrix) }} + env: + IGNORE_PATHS: tests/fixtures + concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.moodle-branch }}-${{ matrix.database }}-${{ matrix.php }}-${{ needs.prepare_matrix.outputs.component }}-behat + cancel-in-progress: true + runs-on: ubuntu-latest + container: + image: ${{ matrix.container }} + services: + pgsql: + image: "postgres:${{ matrix.pgsql-ver }}" + env: + POSTGRES_USER: 'postgres' + POSTGRES_HOST_AUTH_METHOD: 'trust' + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 3 + ports: + - 5432:5432 + mariadb: + image: "mariadb:${{ matrix.mariadb-ver }}" + env: + MYSQL_USER: 'root' + MYSQL_ALLOW_EMPTY_PASSWORD: "true" + MYSQL_CHARACTER_SET_SERVER: "utf8mb4" + MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci" + ports: + - 3306:3306 + options: >- + --health-cmd="mysqladmin ping" + --health-interval 10s + --health-timeout 5s + --health-retries 3 + steps: + - name: Set custom environment variables + run: | + USER_IGNORE_PATHS="${{ inputs.ignore_paths }}" + if [ -n "${USER_IGNORE_PATHS}" ]; then + IGNORE_PATHS="${IGNORE_PATHS},${USER_IGNORE_PATHS}" + echo "IGNORE_PATHS=${IGNORE_PATHS}" >> $GITHUB_ENV + fi + - name: Check out CI code + uses: actions/checkout@v3 + with: + path: ci + repository: catalyst/catalyst-moodle-workflows + ref: ${{ inputs.internal_workflow_branch }} + token: ${{ github.token }} + - name: Run plugin setup + uses: ./ci/.github/plugin/setup + with: + extra_php_extensions: ${{ inputs.extra_php_extensions }} + extra_plugin_runners: ${{ inputs.extra_plugin_runners }} + moodle_branch: ${{ matrix.moodle-branch }} + - name: Install Moodle and Plugin + # Install moodle, but use our temporary directory to include any potential core patches that have been applied. + run: | + # Install moodle commands + echo "::group::Moodle install output" + # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. + sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php + + moodle-plugin-ci install -vvv --plugin ./plugin --db-host=${{ matrix.database }} --repo /moodle --branch ${{ matrix.moodle-branch }} --db-type ${{ matrix.database }} + + echo "::endgroup::" + shell: bash - name: Run behat if: ${{ inputs.disable_behat != true }} run: moodle-plugin-ci behat --profile chrome @@ -339,7 +414,7 @@ jobs: # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php - moodle-plugin-ci install -vvv --plugin ./plugin --db-host=pgsql --repo /moodle --branch ${{ matrix.moodle-branch }} --db-type pgsql + moodle-plugin-ci install -vvv --plugin ./plugin --db-host=pgsql --repo /moodle --branch ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} --db-type pgsql echo "::endgroup::" - name: Run validate From 4e4747b19bf887a2e831f0bd511febfd63ad0e93 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Wed, 14 Jan 2026 12:07:36 +1100 Subject: [PATCH 57/66] fix release requirements --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 919d35a..c9f4328 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,7 +164,7 @@ jobs: disable_master: ${{ inputs.disable_master }} filter: ${{ inputs.moodle_branches }} min_php: ${{ inputs.min_php }} - matrix-unit-tests: + matrix-unit: name: ${{ matrix.branch }} - ${{ matrix.php }} - ${{ matrix.database }} - unit tests needs: prepare_matrix if: needs.pre_job.outputs.should_skip != 'true' && inputs.disable_phpunit != true @@ -561,7 +561,8 @@ jobs: needs: - pre_job - prepare_matrix - - matrix + - matrix-unit + - matrix-behat - codechecker - phplint - validate From 3fca4850777dcb6f25b7bcdce98464217816c152 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Wed, 14 Jan 2026 12:22:05 +1100 Subject: [PATCH 58/66] install grunt, fix names, ci install for mustache --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++-- docker/Dockerfile | 3 +++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9f4328..6359497 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -165,7 +165,7 @@ jobs: filter: ${{ inputs.moodle_branches }} min_php: ${{ inputs.min_php }} matrix-unit: - name: ${{ matrix.branch }} - ${{ matrix.php }} - ${{ matrix.database }} - unit tests + name: ${{ matrix.moodle-branch }} - ${{ matrix.php }} - ${{ matrix.database }} - unit tests needs: prepare_matrix if: needs.pre_job.outputs.should_skip != 'true' && inputs.disable_phpunit != true strategy: @@ -247,7 +247,7 @@ jobs: vendor/bin/phpunit --fail-on-risky --disallow-test-output --testsuite core_privacy_testsuite --filter provider_testcase shell: bash matrix-behat: - name: ${{ matrix.branch }} - ${{ matrix.php }} - ${{ matrix.database }} - behat tests + name: ${{ matrix.moodle-branch }} - ${{ matrix.php }} - ${{ matrix.database }} - behat tests needs: prepare_matrix if: needs.pre_job.outputs.should_skip != 'true' && inputs.disable_phpunit != true strategy: @@ -261,6 +261,8 @@ jobs: runs-on: ubuntu-latest container: image: ${{ matrix.container }} + volumes: + - /var/run/docker.sock:/var/run/docker.sock # Mount the Docker socket services: pgsql: image: "postgres:${{ matrix.pgsql-ver }}" @@ -451,6 +453,19 @@ jobs: container: image: ${{ needs.prepare_matrix.outputs.latest_container }} needs: prepare_matrix + services: + pgsql: + image: "postgres:${{ needs.prepare_matrix.outputs.latest_pgsql_ver }}" + env: + POSTGRES_USER: 'postgres' + POSTGRES_HOST_AUTH_METHOD: 'trust' + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 3 + ports: + - 5432:5432 steps: - name: Check out CI code uses: actions/checkout@v3 @@ -465,6 +480,17 @@ jobs: extra_php_extensions: ${{ inputs.extra_php_extensions }} extra_plugin_runners: ${{ inputs.extra_plugin_runners }} moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} + - name: Install Moodle and Plugin + # Install moodle, but use our temporary directory to include any potential core patches that have been applied. + run: | + # Install moodle commands + echo "::group::Moodle install output" + # This is a workaround for https://github.com/moodlehq/moodle-plugin-ci/issues/306 - we disable the git repository validation to allow folder cloning. + sed -i '/public function gitUrl($url)/{n; s/{/& return $url;/}' /ci/src/Validate.php + + moodle-plugin-ci install -vvv --plugin ./plugin --db-host=pgsql --repo /moodle --branch ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} --db-type pgsql + + echo "::endgroup::" - name: Run mustache if: ${{ inputs.disable_mustache != true }} run: moodle-plugin-ci mustache ./plugin diff --git a/docker/Dockerfile b/docker/Dockerfile index 618def0..9b43699 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -41,6 +41,9 @@ RUN git clone --depth 1 --branch ${MOODLE_BRANCH} https://github.com/moodle/mood # Install moodle-plugin-ci RUN composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci /ci ^4 +# Install Grunt CLI globally +RUN npm install -g grunt-cli + # Add ci/bin and ci/vendor/bin to PATH ENV PATH="/ci/bin:/ci/vendor/bin:${PATH}" From 84c1b71ae4f0a1b5dc05918b97ac517ea816404d Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Wed, 14 Jan 2026 12:40:19 +1100 Subject: [PATCH 59/66] behat fixes --- .github/workflows/ci.yml | 1 + docker/Dockerfile | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6359497..a48dca8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -261,6 +261,7 @@ jobs: runs-on: ubuntu-latest container: image: ${{ matrix.container }} + options: --user root volumes: - /var/run/docker.sock:/var/run/docker.sock # Mount the Docker socket services: diff --git a/docker/Dockerfile b/docker/Dockerfile index 9b43699..a62a111 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -44,6 +44,12 @@ RUN composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci # Install Grunt CLI globally RUN npm install -g grunt-cli +# Install Docker CLI for behat +RUN apt-get update && apt-get install -y docker.io + +# Optionally, add your user to the docker group +RUN groupadd -for docker && usermod -aG docker www-data + # Add ci/bin and ci/vendor/bin to PATH ENV PATH="/ci/bin:/ci/vendor/bin:${PATH}" From ea765e2d9d7626d0ffdcc3746325e29c0fe17cf3 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Wed, 14 Jan 2026 12:42:02 +1100 Subject: [PATCH 60/66] run mustache globally --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a48dca8..0ac4b6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -494,7 +494,7 @@ jobs: echo "::endgroup::" - name: Run mustache if: ${{ inputs.disable_mustache != true }} - run: moodle-plugin-ci mustache ./plugin + run: moodle-plugin-ci mustache shell: bash grunt: if: needs.pre_job.outputs.should_skip != 'true' From 205d2bb1c92b6c0504ef2b161bc69083f3b503d6 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Wed, 14 Jan 2026 12:46:24 +1100 Subject: [PATCH 61/66] remove docker groupadd --- docker/Dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index a62a111..a04da81 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -47,9 +47,6 @@ RUN npm install -g grunt-cli # Install Docker CLI for behat RUN apt-get update && apt-get install -y docker.io -# Optionally, add your user to the docker group -RUN groupadd -for docker && usermod -aG docker www-data - # Add ci/bin and ci/vendor/bin to PATH ENV PATH="/ci/bin:/ci/vendor/bin:${PATH}" From 3c5736b767001b1432b7d5e5d5b615b4d65761a8 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Wed, 14 Jan 2026 13:12:45 +1100 Subject: [PATCH 62/66] add behat root config --- .github/workflows/build-dockerfiles.yml | 2 +- .github/workflows/ci.yml | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-dockerfiles.yml b/.github/workflows/build-dockerfiles.yml index ed415da..cbf7083 100644 --- a/.github/workflows/build-dockerfiles.yml +++ b/.github/workflows/build-dockerfiles.yml @@ -11,7 +11,7 @@ on: - '.github/workflows/build-dockerfiles.yml' jobs: - build-dockerfiles: + build-matrix: runs-on: ubuntu-latest outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ac4b6f..1788749 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,7 +74,6 @@ on: jobs: - pre_job: name: check if job needs to run runs-on: ubuntu-latest @@ -165,7 +164,7 @@ jobs: filter: ${{ inputs.moodle_branches }} min_php: ${{ inputs.min_php }} matrix-unit: - name: ${{ matrix.moodle-branch }} - ${{ matrix.php }} - ${{ matrix.database }} - unit tests + name: ${{ matrix.moodle-branch }} - ${{ matrix.php }} - ${{ matrix.database }} - unit needs: prepare_matrix if: needs.pre_job.outputs.should_skip != 'true' && inputs.disable_phpunit != true strategy: @@ -247,7 +246,7 @@ jobs: vendor/bin/phpunit --fail-on-risky --disallow-test-output --testsuite core_privacy_testsuite --filter provider_testcase shell: bash matrix-behat: - name: ${{ matrix.moodle-branch }} - ${{ matrix.php }} - ${{ matrix.database }} - behat tests + name: ${{ matrix.moodle-branch }} - ${{ matrix.php }} - ${{ matrix.database }} - behat needs: prepare_matrix if: needs.pre_job.outputs.should_skip != 'true' && inputs.disable_phpunit != true strategy: @@ -324,6 +323,10 @@ jobs: echo "::endgroup::" shell: bash + - name: Setup behat + shell: bash + run: | + moodle-plugin-ci add-config behat_wwwroot "http://selenium:4444" - name: Run behat if: ${{ inputs.disable_behat != true }} run: moodle-plugin-ci behat --profile chrome From 0a405aefeaa41c9f398271395761c4afdff886b9 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Wed, 14 Jan 2026 13:16:50 +1100 Subject: [PATCH 63/66] grunt debug --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1788749..cf64e09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -521,7 +521,10 @@ jobs: moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }} - name: Run grunt if: ${{ inputs.disable_grunt != true }} - run: moodle-plugin-ci grunt ./plugin + run: | + cd ./plugin + ls + moodle-plugin-ci grunt --no-interaction . shell: bash phpmd: if: needs.pre_job.outputs.should_skip != 'true' From 2b4924f2d73b8d5b0d3f3cc78e9002739912a332 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Wed, 14 Jan 2026 13:20:54 +1100 Subject: [PATCH 64/66] re-install grunt cli, path to moodle --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf64e09..e6b7439 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -522,9 +522,10 @@ jobs: - name: Run grunt if: ${{ inputs.disable_grunt != true }} run: | + npm install -g grunt-cli cd ./plugin ls - moodle-plugin-ci grunt --no-interaction . + moodle-plugin-ci grunt --moodle /moodle --no-interaction . shell: bash phpmd: if: needs.pre_job.outputs.should_skip != 'true' From a2a8952e1a00301cc8f70273eadd697c11fa48e6 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Wed, 14 Jan 2026 13:23:10 +1100 Subject: [PATCH 65/66] behat and grunt fixes --- .github/workflows/ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6b7439..3d593d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -326,7 +326,7 @@ jobs: - name: Setup behat shell: bash run: | - moodle-plugin-ci add-config behat_wwwroot "http://selenium:4444" + moodle-plugin-ci add-config '$CFG->behat_wwwroot = "http://selenium:4444";' - name: Run behat if: ${{ inputs.disable_behat != true }} run: moodle-plugin-ci behat --profile chrome @@ -523,9 +523,7 @@ jobs: if: ${{ inputs.disable_grunt != true }} run: | npm install -g grunt-cli - cd ./plugin - ls - moodle-plugin-ci grunt --moodle /moodle --no-interaction . + moodle-plugin-ci grunt --moodle /moodle --no-interaction ./plugin shell: bash phpmd: if: needs.pre_job.outputs.should_skip != 'true' From 07073ff3817159331a18e8856cc2f250c200ad75 Mon Sep 17 00:00:00 2001 From: Jay Oswald Date: Wed, 14 Jan 2026 13:34:36 +1100 Subject: [PATCH 66/66] grunt npm install, mustache verbose --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d593d0..56c16ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -522,8 +522,10 @@ jobs: - name: Run grunt if: ${{ inputs.disable_grunt != true }} run: | - npm install -g grunt-cli - moodle-plugin-ci grunt --moodle /moodle --no-interaction ./plugin + cd /moodle + npm install + cd - + moodle-plugin-ci grunt --moodle /moodle --no-interaction -vvv ./plugin shell: bash phpmd: if: needs.pre_job.outputs.should_skip != 'true'