diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1267819..52da3ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,128 +1,9 @@ -name: Moodle plugin CI for master +name: Run all tests for Moodle 39+ -# Controls when the action will run. on: [push, pull_request] jobs: - citest: - name: CI test - runs-on: 'ubuntu-latest' - - services: - postgres: - image: postgres - 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.5 - env: - MYSQL_USER: 'root' - MYSQL_ALLOW_EMPTY_PASSWORD: "true" - ports: - - 3306:3306 - options: >- - --health-cmd="mysqladmin ping" - --health-interval 10s - --health-timeout 5s - --health-retries 3 - strategy: - fail-fast: false - matrix: - database: ['pgsql', 'mariadb'] - moodle-branch: ['MOODLE_39_STABLE'] - node: ['14.15.1'] - php: ['7.2', '7.3'] - include: - - {moodle-branch: 'MOODLE_39_STABLE', php: '7.4', node: '14.15.1', database: 'mariadb'} - - {moodle-branch: 'MOODLE_39_STABLE', php: '7.4', node: '14.15.1', database: 'pgsql'} - - {moodle-branch: 'MOODLE_310_STABLE', php: '7.4', node: '14.15.1', database: 'mariadb'} - - {moodle-branch: 'MOODLE_311_STABLE', php: '7.4', node: '14.15.1', database: 'pgsql'} - - steps: - - name: Check out repository code - uses: actions/checkout@v2 - with: - path: plugin - - - name: Install node ${{ matrix.node }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node }} - - - name: Setup PHP ${{ matrix.php }} - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: pgsql, zip, gd, xmlrpc, soap - coverage: none - - - name: Initialise moodle-plugin-ci - run: | - composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3 - # 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 - - name: Install Moodle - run: | - mkdir ~/.npm-global - export PATH=~/.npm-global/bin:$PATH - source ~/.profile - moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1 - env: - DB: ${{ matrix.database }} - MOODLE_BRANCH: ${{ matrix.moodle-branch }} - - - name: Run phplint - if: ${{ always() }} - run: moodle-plugin-ci phplint - - - name: Run phpcpd - if: ${{ always() }} - run: moodle-plugin-ci phpcpd || true - - - name: Run phpmd - if: ${{ always() }} - run: moodle-plugin-ci phpmd - - - name: Run codechecker - if: ${{ always() }} - run: moodle-plugin-ci codechecker - - - name: Run validate - if: ${{ always() }} - run: moodle-plugin-ci validate - - - name: Run savepoints - if: ${{ always() }} - run: moodle-plugin-ci savepoints - - - name: Run mustache - if: ${{ always() }} - run: moodle-plugin-ci phpcpd - - - name: Run grunt - if: ${{ always() }} - run: moodle-plugin-ci grunt - - - name: Run phpdoc - if: ${{ always() }} - run: moodle-plugin-ci phpdoc - - - name: Run phpunit - if: ${{ always() }} - run: moodle-plugin-ci phpunit - -# - name: Run behat -# if: ${{ always() }} -# run: moodle-plugin-ci behat --profile chrome + workflow_group_39_plus_ci: + uses: catalyst/catalyst-moodle-workflows/.github/workflows/group-39-plus-ci.yml@main + with: + disable_behat: true diff --git a/.github/workflows/moodle-release.yml b/.github/workflows/moodle-release.yml new file mode 100644 index 0000000..e587278 --- /dev/null +++ b/.github/workflows/moodle-release.yml @@ -0,0 +1,21 @@ +# +# Whenever version.php is changed, add the latest version +# to the Moodle Plugins directory at https://moodle.org/plugins +# +name: Releasing in the Plugins directory + +on: + push: + branches: + - MOODLE_39_STABLE + paths: + - 'version.php' + +jobs: + workflow_group_39_plus_release: + uses: catalyst/catalyst-moodle-workflows/.github/workflows/group-39-plus-release.yml@main + with: + plugin_name: auth_outage + disable_behat: true + secrets: + moodle_org_token: ${{ secrets.MOODLE_ORG_TOKEN }} diff --git a/README.md b/README.md index b2cf949..a0f2cc1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Build Status](https://github.com/catalyst/moodle-auth_outage/actions/workflows/ci.yml/badge.svg?branch=MOODLE_39_STABLE) +![Build Status](https://github.com/catalyst/moodle-auth_outage/actions/workflows/ci.yml/badge.svg?branch=MOODLE_39_STABLE)(https://github.com/catalyst/moodle-auth_outage/actions) # Moodle Outage manager plugin * [Version Support](#version-support) diff --git a/classes/event/outage_created.php b/classes/event/outage_created.php index d2593e3..ab15994 100644 --- a/classes/event/outage_created.php +++ b/classes/event/outage_created.php @@ -28,8 +28,6 @@ namespace auth_outage\event; use core\event\base; use moodle_url; -defined('MOODLE_INTERNAL') || die(); - /** * outage_created class. * diff --git a/classes/event/outage_deleted.php b/classes/event/outage_deleted.php index 663c7f4..5f85fff 100644 --- a/classes/event/outage_deleted.php +++ b/classes/event/outage_deleted.php @@ -27,8 +27,6 @@ namespace auth_outage\event; use core\event\base; use moodle_url; -defined('MOODLE_INTERNAL') || die(); - /** * outage_deleted class. * diff --git a/classes/event/outage_updated.php b/classes/event/outage_updated.php index 06feda7..c61113e 100644 --- a/classes/event/outage_updated.php +++ b/classes/event/outage_updated.php @@ -28,8 +28,6 @@ namespace auth_outage\event; use core\event\base; use moodle_url; -defined('MOODLE_INTERNAL') || die(); - /** * outage_updated class. * diff --git a/classes/local/cli/cli_exception.php b/classes/local/cli/cli_exception.php index bb13d9f..297e043 100644 --- a/classes/local/cli/cli_exception.php +++ b/classes/local/cli/cli_exception.php @@ -27,8 +27,6 @@ namespace auth_outage\local\cli; use Exception; -defined('MOODLE_INTERNAL') || die(); - /** * cli_exception class. * diff --git a/classes/local/cli/clibase.php b/classes/local/cli/clibase.php index 91393bb..1df7668 100644 --- a/classes/local/cli/clibase.php +++ b/classes/local/cli/clibase.php @@ -29,8 +29,6 @@ use auth_outage\local\outagelib; use coding_exception; use core\session\manager; -defined('MOODLE_INTERNAL') || die(); - /** * clibase class. * diff --git a/classes/local/cli/create.php b/classes/local/cli/create.php index 754bdf9..1c548a4 100644 --- a/classes/local/cli/create.php +++ b/classes/local/cli/create.php @@ -29,8 +29,6 @@ use auth_outage\dml\outagedb; use auth_outage\local\outage; use coding_exception; -defined('MOODLE_INTERNAL') || die(); - /** * create class. * diff --git a/classes/local/cli/finish.php b/classes/local/cli/finish.php index ee8d832..9600b51 100644 --- a/classes/local/cli/finish.php +++ b/classes/local/cli/finish.php @@ -28,8 +28,6 @@ namespace auth_outage\local\cli; use auth_outage\dml\outagedb; use auth_outage\local\outage; -defined('MOODLE_INTERNAL') || die(); - /** * finish class. * diff --git a/classes/local/cli/waitforit.php b/classes/local/cli/waitforit.php index 0270fc5..10e5534 100644 --- a/classes/local/cli/waitforit.php +++ b/classes/local/cli/waitforit.php @@ -28,8 +28,6 @@ namespace auth_outage\local\cli; use auth_outage\dml\outagedb; use auth_outage\local\outage; -defined('MOODLE_INTERNAL') || die(); - /** * waitforit class. * diff --git a/classes/local/controllers/infopage.php b/classes/local/controllers/infopage.php index 760943f..ea1cdae 100644 --- a/classes/local/controllers/infopage.php +++ b/classes/local/controllers/infopage.php @@ -32,8 +32,6 @@ use coding_exception; use context_system; use moodle_url; -defined('MOODLE_INTERNAL') || die(); - /** * infopage class. * diff --git a/classes/local/controllers/maintenance_static_page.php b/classes/local/controllers/maintenance_static_page.php index 73a4a3d..6d073a5 100644 --- a/classes/local/controllers/maintenance_static_page.php +++ b/classes/local/controllers/maintenance_static_page.php @@ -29,8 +29,6 @@ use auth_outage\local\outage; use coding_exception; use DOMDocument; -defined('MOODLE_INTERNAL') || die(); - /** * maintenance_static_page class. * diff --git a/classes/local/controllers/maintenance_static_page_generator.php b/classes/local/controllers/maintenance_static_page_generator.php index fe23863..130c395 100644 --- a/classes/local/controllers/maintenance_static_page_generator.php +++ b/classes/local/controllers/maintenance_static_page_generator.php @@ -33,8 +33,6 @@ use DOMElement; use invalid_state_exception; use moodle_url; -defined('MOODLE_INTERNAL') || die(); - /** * maintenance_static_page_generator class. * diff --git a/classes/local/controllers/maintenance_static_page_io.php b/classes/local/controllers/maintenance_static_page_io.php index 5642522..572038d 100644 --- a/classes/local/controllers/maintenance_static_page_io.php +++ b/classes/local/controllers/maintenance_static_page_io.php @@ -31,8 +31,6 @@ use finfo; use invalid_parameter_exception; use moodle_url; -defined('MOODLE_INTERNAL') || die(); - /** * maintenance_static_page_io class. * diff --git a/classes/local/outage.php b/classes/local/outage.php index 852dc56..5fc6174 100644 --- a/classes/local/outage.php +++ b/classes/local/outage.php @@ -28,8 +28,6 @@ namespace auth_outage\local; use coding_exception; use stdClass; -defined('MOODLE_INTERNAL') || die(); - /** * outage class. * diff --git a/classes/output/renderer.php b/classes/output/renderer.php index ec8536c..7330f2c 100644 --- a/classes/output/renderer.php +++ b/classes/output/renderer.php @@ -33,8 +33,6 @@ use html_writer; use moodle_url; use plugin_renderer_base; -defined('MOODLE_INTERNAL') || die(); - /** * auth_outage_renderer class. * diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index 9acaaba..42c00d6 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -23,8 +23,6 @@ namespace auth_outage\privacy; -defined('MOODLE_INTERNAL') || die(); - use core_privacy\local\legacy_polyfill; /** diff --git a/classes/task/update_static_page.php b/classes/task/update_static_page.php index bf67067..e477f6c 100644 --- a/classes/task/update_static_page.php +++ b/classes/task/update_static_page.php @@ -29,8 +29,6 @@ use auth_outage\local\controllers\infopage; use auth_outage\local\outagelib; use core\task\scheduled_task; -defined('MOODLE_INTERNAL') || die(); - /** * update_static_page class. * diff --git a/db/uninstall.php b/db/uninstall.php index 49d6242..41912e3 100644 --- a/db/uninstall.php +++ b/db/uninstall.php @@ -24,8 +24,6 @@ */ use auth_outage\local\controllers\maintenance_static_page; -defined('MOODLE_INTERNAL') || die(); - /** * Auth Outage plugin uninstall code. * @return bool result diff --git a/db/upgrade.php b/db/upgrade.php index a7ec907..61b31f5 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -22,7 +22,6 @@ * @copyright 2016 Catalyst IT * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -defined('MOODLE_INTERNAL') || die(); /** * Outage plugin upgrade code diff --git a/lib.php b/lib.php index 6a06439..d2d2e09 100644 --- a/lib.php +++ b/lib.php @@ -25,8 +25,6 @@ use auth_outage\local\outagelib; -defined('MOODLE_INTERNAL') || die; - /** * Used for adminlib::set_updatedcallback which requires a string that resolves to a function. * diff --git a/renderer.php b/renderer.php index 7adcad2..27f0121 100644 --- a/renderer.php +++ b/renderer.php @@ -26,8 +26,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -defined('MOODLE_INTERNAL') || die(); - /** * auth_outage_renderer class. * diff --git a/tests/phpunit/base_testcase.php b/tests/phpunit/base_testcase.php index 9a33623..59e2884 100644 --- a/tests/phpunit/base_testcase.php +++ b/tests/phpunit/base_testcase.php @@ -34,8 +34,6 @@ use auth_outage\dml\outagedb; use auth_outage\local\outage; -defined('MOODLE_INTERNAL') || die(); - /** * auth_outage_base_testcase class. * diff --git a/tests/phpunit/calendar/calendar_test.php b/tests/phpunit/calendar/calendar_test.php index b72dd9b..222aaf9 100644 --- a/tests/phpunit/calendar/calendar_test.php +++ b/tests/phpunit/calendar/calendar_test.php @@ -26,8 +26,6 @@ use auth_outage\calendar\calendar; use auth_outage\local\outage; -defined('MOODLE_INTERNAL') || die(); - /** * calendar_test test class. * diff --git a/tests/phpunit/event/events_test.php b/tests/phpunit/event/events_test.php index e1ee294..61a52e9 100644 --- a/tests/phpunit/event/events_test.php +++ b/tests/phpunit/event/events_test.php @@ -26,8 +26,6 @@ use auth_outage\dml\outagedb; use auth_outage\local\outage; -defined('MOODLE_INTERNAL') || die(); - /** * events_test tests class. * diff --git a/version.php b/version.php index 8c1d486..c855974 100644 --- a/version.php +++ b/version.php @@ -28,7 +28,7 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = "auth_outage"; -$plugin->version = 2021062300; // The current plugin version (Date: YYYYMMDDXX). -$plugin->release = 2021062300; // Human-readable release information. +$plugin->version = 2022011200; // The current plugin version (Date: YYYYMMDDXX). +$plugin->release = 2022011200; // Human-readable release information. $plugin->requires = 2017111309; // 2017111309 = T13, but this really requires 3.9 and higher. $plugin->maturity = MATURITY_STABLE; // Suitable for PRODUCTION environments!