Skip to content
Open
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
88 changes: 88 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Tests

on: [push, pull_request]

jobs:
ci:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
moodle-branch: ['MOODLE_401_STABLE', 'MOODLE_402_STABLE']
php: ['8.1']
database: ['mysqli']

name: ${{ matrix.moodle-branch }} php ${{ matrix.php }} ${{ matrix.database }}

steps:
- name: checkout plugin
uses: actions/checkout@v3
with:
path: this-plugin

- name: setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, mysqli, gd, zip
ini-values: max_input_vars=5000
coverage: pcov

- name: composer
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
sudo locale-gen en_AU.UTF-8
sudo systemctl start mysql.service

- name: install Moodle
run: moodle-plugin-ci install -v --db-user=root --db-pass=root --db-host=127.0.0.1 --plugin this-plugin
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}

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

- name: phpcpd
if: ${{ always() }}
run: moodle-plugin-ci --ansi phpcpd

- name: phpmd
if: ${{ always() }}
run: moodle-plugin-ci --ansi phpmd

- name: phpdoc
if: ${{ always() }}
run: moodle-plugin-ci --ansi phpdoc

- name: codechecker
if: ${{ always() }}
run: moodle-plugin-ci --ansi codechecker

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

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

- name: grunt
if: ${{ always() }}
run: moodle-plugin-ci --ansi grunt

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

- name: phpunit
if: ${{ always() }}
run: moodle-plugin-ci --ansi phpunit --coverage-text

- name: behat
if: ${{ always() }}
run: moodle-plugin-ci --ansi behat --profile=chrome
4 changes: 3 additions & 1 deletion amd/build/appear.min.js

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

1 change: 1 addition & 0 deletions amd/build/appear.min.js.map

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

23 changes: 22 additions & 1 deletion amd/build/imageopt.min.js

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

1 change: 1 addition & 0 deletions amd/build/imageopt.min.js.map

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

1 change: 0 additions & 1 deletion amd/src/imageopt.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* You should have received a copy of the GNU General Public License
* along with Moodle. If not, see <http://www.gnu.org/licenses/>.
*
* @package filter_imgopt
* @copyright Copyright (c) 2017 Guy Thomas
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand Down
26 changes: 20 additions & 6 deletions classes/componentsupport/base_component.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,26 @@
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace filter_imageopt\componentsupport;

defined('MOODLE_INTERNAL') || die;
/**
* Abstract class.
*
* @package filter_imageopt
* @author Guy Thomas <brudinie@gmail.com>
* @copyright Copyright (c) 2017 Guy Thomas.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace filter_imageopt\componentsupport;

/**
* Abstract class.
*
* @package filter_imageopt
* @author Guy Thomas <brudinie@gmail.com>
* @copyright Copyright (c) 2017 Guy Thomas.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class base_component {

/**
Expand All @@ -36,11 +52,9 @@ abstract public static function get_optimised_path(array $pathcomponents, $maxwi

/**
* Return the optimised url for the specfied file and original src.
* @param \filter_imageopt\componentsupport\stored_file $file
* @param type $originalsrc
* @param \stored_file $file
* @param string $originalsrc
* @return \moodle_url
*/
abstract public static function get_optimised_src(\stored_file $file, $originalsrc);
}


Loading