Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"moodle-plugin-ci": "4.5.9",
"main-moodle": "MOODLE_502_STABLE",
"main-php": "8.3",
"main-db": "pgsql",
"moodle-testmatrix": {
"MOODLE_405_STABLE": {
"php": [
"8.1",
"8.3"
],
"db": [
"pgsql"
]
},
"MOODLE_500_STABLE": {
"php": [
"8.2",
"8.4"
],
"db": [
"pgsql"
]
},
"MOODLE_501_STABLE": {
"php": [
"8.2",
"8.4"
],
"db": [
"pgsql"
]
},
"MOODLE_502_STABLE": {
"php": [
"8.3",
"8.4"
],
"db": [
"pgsql",
"mariadb",
"mysqli"
]
}
}
}
129 changes: 12 additions & 117 deletions .github/workflows/moodle-plugin-ci.yml
Original file line number Diff line number Diff line change
@@ -1,119 +1,14 @@
name: Moodle plugin CI
on: [push, pull_request]
name: Moodle Plugin CI

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php: '8.1'
moodle-branch: 'MOODLE_403_STABLE'
database: 'pgsql'
- php: '8.1'
moodle-branch: 'MOODLE_403_STABLE'
database: 'mariadb'

services:
postgres:
image: postgres:14
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:10
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: Checkout
uses: actions/checkout@v4
with:
path: plugin

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
coverage: none

- name: Deploy moodle-plugin-ci
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
# Add dirs to $PATH
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
# PHPUnit depends on en_AU.UTF-8 locale
sudo locale-gen en_AU.UTF-8
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV

- name: Install Moodle
# Need explicit IP to stop mysql client fail on attempt to use unix socket.
run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
IGNORE_PATHS: 'templates/local/mobile'

- name: PHP Lint
if: ${{ always() }}
run: moodle-plugin-ci phplint

- name: PHP Copy/Paste Detector
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci phpcpd
on:
push:
branches:
- main
pull_request:
branches:
- main

- name: PHP Mess Detector
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci phpmd

- name: Moodle Code Checker
if: ${{ always() }}
run: moodle-plugin-ci codechecker

- name: Moodle PHPDoc Checker
if: ${{ always() }}
run: moodle-plugin-ci phpdoc

- name: Validating
if: ${{ always() }}
run: moodle-plugin-ci validate

- name: Check upgrade savepoints
if: ${{ always() }}
run: moodle-plugin-ci savepoints

- name: Mustache Lint
if: ${{ always() }}
run: moodle-plugin-ci mustache

- name: Grunt
if: ${{ always() }}
run: moodle-plugin-ci grunt --max-lint-warnings 0

- name: PHPUnit tests
if: ${{ always() }}
run: moodle-plugin-ci phpunit

- name: Behat features
if: ${{ always() }}
run: moodle-plugin-ci behat --profile chrome
jobs:
call-moodle-ci:
name: "Run CI workflow for Learnweb plugins"
uses: learnweb/moodle-workflows-learnweb/.github/workflows/moodle-ci.yml@main
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CHANGELOG
=========

Changes in v5.2-r1
----------------------------------

- support for Moodle 5.0, 5.1, 5.2
- add CHANGES.md for user-visible changes
- Migrated CI testing to the shared Learnweb Moodle workflow
- Added a test matrix covering Moodle 4.5, 5.0, 5.1, and 5.2 with multiple supported PHP versions and database systems
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ moodle-mod_scheduler
====================


[![Latest Release](https://img.shields.io/github/v/release/bostelm/moodle-mod_scheduler?sort=semver&color=orange)](https://github.com/bostelm/moodle-mod_scheduler/releases)
[![Moodle Plugin CI](https://github.com/bostelm/moodle-mod_scheduler/workflows/Moodle%20plugin%20CI/badge.svg?branch=master)](https://github.com/bostelm/moodle-mod_scheduler/actions?query=workflow%3A%22Moodle+plugin+CI%22+branch%3Amaster)
[![Latest Release](https://img.shields.io/github/v/release/learnweb/moodle-mod_scheduler?sort=semver&color=orange)](https://github.com/learnweb/moodle-mod_scheduler/releases)
[![Moodle plugin CI](https://github.com/learnweb/moodle-mod_scheduler/actions/workflows/moodle-plugin-ci.yml/badge.svg)](https://github.com/learnweb/moodle-mod_scheduler/actions/workflows/moodle-plugin-ci.yml)

Appointment
Scheduler for Moodle
Expand Down
11 changes: 5 additions & 6 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@

define('AJAX_SCRIPT', true);

use \mod_scheduler\model\scheduler;
use \mod_scheduler\permission\scheduler_permissions;
use mod_scheduler\model\scheduler;
use mod_scheduler\permission\scheduler_permissions;

require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
require_once('locallib.php');

$id = required_param('id', PARAM_INT);
$action = required_param('action', PARAM_ALPHA);

$cm = get_coursemodule_from_id('scheduler', $id, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
$course = $DB->get_record('course', ['id' => $cm->course], '*', MUST_EXIST);
$scheduler = scheduler::load_by_coursemodule_id($id);

require_login($course, true, $cm);
Expand All @@ -46,9 +46,8 @@

switch ($action) {
case 'saveseen':

$appid = required_param('appointmentid', PARAM_INT);
list($slot, $app) = $scheduler->get_slot_appointment($appid);
[$slot, $app] = $scheduler->get_slot_appointment($appid);
$newseen = required_param('seen', PARAM_BOOL);

$permissions->ensure($permissions->can_edit_attended($app));
Expand Down
4 changes: 2 additions & 2 deletions amd/build/delselected.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amd/build/delselected.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amd/build/saveseen.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading