From 367fa38f44895a5e4a4af7cbf6cc44dc686ec2c3 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Mon, 24 Aug 2026 00:21:28 +0400 Subject: [PATCH] ci: test Moodle 4.5 LTS --- .docker/ci/Dockerfile | 4 +++- .gitea/workflows/ci.yml | 25 ++++++++++++++++++++----- README.md | 17 ++++++++++++++++- compose.yaml | 26 ++++++++++++++++++++++++-- 4 files changed, 63 insertions(+), 9 deletions(-) diff --git a/.docker/ci/Dockerfile b/.docker/ci/Dockerfile index 746b6a3..797bf39 100644 --- a/.docker/ci/Dockerfile +++ b/.docker/ci/Dockerfile @@ -1,8 +1,10 @@ +ARG PHP_IMAGE=moodlehq/moodle-php-apache:8.4@sha256:07cac70e0ed3f96f334ffeece92075b98adfbe4110312a3a9308b95eab8e2080 + FROM composer:2.10.2@sha256:4d71c3c2109c61d5415544264b59ad4087e4c5b7244481723664138fd36d5040 AS composer FROM node:22.23.2-bookworm-slim@sha256:d649c27dae7ba0137b3cef5dd75baa422c08dc3d9e3fc0c23dfb172dc3cc6436 AS node -FROM moodlehq/moodle-php-apache:8.4@sha256:07cac70e0ed3f96f334ffeece92075b98adfbe4110312a3a9308b95eab8e2080 +FROM ${PHP_IMAGE} ARG MOODLE_PLUGIN_CI_COMMIT=9276f968746960275b12190b4ef8e47b1e6af674 ARG MOODLE_PLUGIN_CI_LOCK_SHA256=e5c8ce77b90f43a057ee717c52e856bf81d43387834dab36083a1c1b17a24be4 diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 4a1c51b..16103ce 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -13,26 +13,41 @@ permissions: jobs: test: - name: Test (${{ matrix.database }}) + name: Test (Moodle ${{ matrix.moodle }}, PHP ${{ matrix.php }}, ${{ matrix.database }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - - database: postgresql + - moodle: "5.2.2" + moodle_id: moodle52 + php: "8.4" + php_image: moodlehq/moodle-php-apache:8.4@sha256:07cac70e0ed3f96f334ffeece92075b98adfbe4110312a3a9308b95eab8e2080 + database: postgresql profile: "" service: ci - - database: mysql + - moodle: "5.2.2" + moodle_id: moodle52 + php: "8.4" + php_image: moodlehq/moodle-php-apache:8.4@sha256:07cac70e0ed3f96f334ffeece92075b98adfbe4110312a3a9308b95eab8e2080 + database: mysql profile: --profile mysql service: ci-mysql + - moodle: "4.5.13" + moodle_id: moodle45 + php: "8.1.34" + php_image: moodlehq/moodle-php-apache:8.1@sha256:13be2641be8883e79fd1e97374d0df759d80c81cce8331f3e85035923b7f4576 + database: postgresql + profile: --profile moodle45 + service: ci-moodle45 env: - COMPOSE_PROJECT_NAME: local_webhooks_${{ gitea.run_id }}_${{ gitea.run_attempt }}_${{ matrix.database }} + COMPOSE_PROJECT_NAME: local_webhooks_${{ gitea.run_id }}_${{ gitea.run_attempt }}_${{ matrix.moodle_id }}_${{ matrix.database }} steps: - name: Check out repository uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Build test image - run: docker compose ${{ matrix.profile }} build --pull ${{ matrix.service }} + run: docker compose ${{ matrix.profile }} build --pull --build-arg PHP_IMAGE=${{ matrix.php_image }} ${{ matrix.service }} - name: Test plugin run: docker compose ${{ matrix.profile }} up --abort-on-container-exit --exit-code-from ${{ matrix.service }} ${{ matrix.service }} diff --git a/README.md b/README.md index a5278b6..fcda76a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,13 @@ The `develop` branch is unreleased modernization work toward `6.0.0` and is not ## Current CI baseline -Gitea Actions currently tests Moodle `5.2.2` on PHP `8.4` with PostgreSQL `16` and MySQL `8.4`. This is a development baseline, not the final support matrix. +Gitea Actions currently runs three blocking compatibility checks: + +- Moodle `5.2.2` on PHP `8.4` with PostgreSQL `16`; +- Moodle `5.2.2` on PHP `8.4` with MySQL `8.4`; +- Moodle `4.5.13` LTS on PHP `8.1.34` with PostgreSQL `16`. + +This is an incremental development baseline, not the final support matrix. Run the same checks from the repository root with Docker: @@ -32,6 +38,15 @@ docker compose --profile mysql up --abort-on-container-exit --exit-code-from ci- docker compose --profile mysql down --volumes --remove-orphans --rmi local ``` +Moodle 4.5 LTS with PostgreSQL: + +```bash +export COMPOSE_PROJECT_NAME=local_webhooks_local_moodle45_postgresql +docker compose --profile moodle45 build --pull ci-moodle45 +docker compose --profile moodle45 up --abort-on-container-exit --exit-code-from ci-moodle45 ci-moodle45 +docker compose --profile moodle45 down --volumes --remove-orphans --rmi local +``` + ## License [GNU GPLv3](LICENSE.txt). Copyright (c) [Valentin Popov](mailto:info@valentineus.link). diff --git a/compose.yaml b/compose.yaml index 52f8fda..f1c6dff 100644 --- a/compose.yaml +++ b/compose.yaml @@ -11,8 +11,8 @@ x-ci: &ci composer --version node --version moodle-plugin-ci --version - moodle-plugin-ci install --plugin /plugin --branch v5.2.2 --db-host "$$DB_HOST" - test "$$(git -C /workspace/moodle rev-parse HEAD)" = "acfa383c13dd46c83ca82894a8e95fac273fda33" + moodle-plugin-ci install --plugin /plugin --branch "$$MOODLE_BRANCH" --db-host "$$DB_HOST" + test "$$(git -C /workspace/moodle rev-parse HEAD)" = "$$MOODLE_COMMIT" moodle-plugin-ci phplint moodle-plugin-ci phpcs --max-warnings 0 moodle-plugin-ci phpdoc --max-warnings 0 @@ -58,6 +58,7 @@ services: DB_HOST: postgres DB_USER: postgres MOODLE_BRANCH: v5.2.2 + MOODLE_COMMIT: acfa383c13dd46c83ca82894a8e95fac273fda33 NPM_CONFIG_FETCH_RETRIES: 5 ci-mysql: @@ -73,4 +74,25 @@ services: DB_PASS: moodle_ci DB_USER: root MOODLE_BRANCH: v5.2.2 + MOODLE_COMMIT: acfa383c13dd46c83ca82894a8e95fac273fda33 + NPM_CONFIG_FETCH_RETRIES: 5 + + ci-moodle45: + <<: *ci + profiles: + - moodle45 + build: + context: . + dockerfile: .docker/ci/Dockerfile + args: + PHP_IMAGE: moodlehq/moodle-php-apache:8.1@sha256:13be2641be8883e79fd1e97374d0df759d80c81cce8331f3e85035923b7f4576 + depends_on: + postgres: + condition: service_healthy + environment: + DB: pgsql + DB_HOST: postgres + DB_USER: postgres + MOODLE_BRANCH: v4.5.13 + MOODLE_COMMIT: 8cbae18a2898cfd8266ec91ac206e12004f0ff5f NPM_CONFIG_FETCH_RETRIES: 5