Skip to content

Commit

Permalink
Update GHA matrix for PHP 8.2 & fix for coding standards updates (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
opitz authored Feb 5, 2024
1 parent 5c5148d commit fb927fe
Show file tree
Hide file tree
Showing 34 changed files with 276 additions and 268 deletions.
62 changes: 35 additions & 27 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3

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
Expand All @@ -31,22 +31,25 @@ jobs:
fail-fast: false
matrix:
include:
- php: '7.4'
moodle-branch: 'MOODLE_311_STABLE'
- php: '8.2'
moodle-branch: 'master'
database: 'mariadb'
- php: '8.2'
moodle-branch: 'master'
database: 'pgsql'
- php: '8.0'
moodle-branch: 'MOODLE_311_STABLE'
- php: '8.1'
moodle-branch: 'MOODLE_403_STABLE'
database: 'mariadb'
- php: '8.0'
moodle-branch: 'MOODLE_402_STABLE'
database: 'pgsql'
- php: '8.1'
moodle-branch: 'master'
- php: '8.0'
moodle-branch: 'MOODLE_401_STABLE'
database: 'mariadb'

steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: plugin

Expand All @@ -56,67 +59,72 @@ jobs:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
# none to use phpdbg fallback. Specify pcov (Moodle 3.10 and up) or xdebug to use them instead.
# If you are not using code coverage, keep "none". Otherwise, use "pcov" (Moodle 3.10 and up) or "xdebug".
# If you try to use code coverage with "none", it will fallback to phpdbg (which has known problems).
coverage: none

- name: Initialise moodle-plugin-ci
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
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
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
- name: Install moodle-plugin-ci
run: |
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
# Uncomment this to run Behat tests using the Moodle App.
# MOODLE_APP: 'true'

- name: PHP Lint
if: ${{ always() }}
if: ${{ !cancelled() }}
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() }}
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpcpd

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

- name: Moodle Code Checker
if: ${{ always() }}
run: moodle-plugin-ci codechecker --max-warnings 0
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpcs --max-warnings 0

- name: Moodle PHPDoc Checker
if: ${{ always() }}
run: moodle-plugin-ci phpdoc
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpdoc --max-warnings 0

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

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

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

- name: Grunt
# Only test grunt against branches other than MOODLE_311_STABLE
# as it will mark files grunted with latest version of npm and grunt as stale.
if: ${{ matrix.moodle-branch != 'MOODLE_311_STABLE' }}
if: ${{ !cancelled() }}
run: moodle-plugin-ci grunt --max-lint-warnings 0

- name: PHPUnit tests
if: ${{ always() }}
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpunit --fail-on-warning

- name: Behat features
if: ${{ always() }}
if: ${{ !cancelled() }}
run: moodle-plugin-ci behat --profile chrome

- name: Mark cancelled jobs as failed.
if: ${{ cancelled() }}
run: exit 1
2 changes: 1 addition & 1 deletion classes/event/myfeedbackreport_addfeedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/myfeedback/index.php', array('user' => $this->relateduserid));
return new \moodle_url('/report/myfeedback/index.php', ['user' => $this->relateduserid]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/event/myfeedbackreport_addnotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/myfeedback/index.php', array('user' => $this->relateduserid));
return new \moodle_url('/report/myfeedback/index.php', ['user' => $this->relateduserid]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/event/myfeedbackreport_download.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/myfeedback/index.php', array('user' => $this->relateduserid));
return new \moodle_url('/report/myfeedback/index.php', ['user' => $this->relateduserid]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/event/myfeedbackreport_downloaddeptadmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/myfeedback/index.php', array('user' => $this->relateduserid));
return new \moodle_url('/report/myfeedback/index.php', ['user' => $this->relateduserid]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/event/myfeedbackreport_downloadmtutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/myfeedback/index.php', array('user' => $this->relateduserid));
return new \moodle_url('/report/myfeedback/index.php', ['user' => $this->relateduserid]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/event/myfeedbackreport_downloadptutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/myfeedback/index.php', array('user' => $this->relateduserid));
return new \moodle_url('/report/myfeedback/index.php', ['user' => $this->relateduserid]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/event/myfeedbackreport_updatefeedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/myfeedback/index.php', array('user' => $this->relateduserid));
return new \moodle_url('/report/myfeedback/index.php', ['user' => $this->relateduserid]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/event/myfeedbackreport_updatenotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/myfeedback/index.php', array('user' => $this->relateduserid));
return new \moodle_url('/report/myfeedback/index.php', ['user' => $this->relateduserid]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/event/myfeedbackreport_viewed.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/myfeedback/index.php', array('user' => $this->relateduserid));
return new \moodle_url('/report/myfeedback/index.php', ['user' => $this->relateduserid]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/event/myfeedbackreport_viewed_deptdash.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/myfeedback/index.php', array('user' => $this->relateduserid));
return new \moodle_url('/report/myfeedback/index.php', ['user' => $this->relateduserid]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/event/myfeedbackreport_viewed_mtutordash.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/myfeedback/index.php', array('user' => $this->relateduserid));
return new \moodle_url('/report/myfeedback/index.php', ['user' => $this->relateduserid]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/event/myfeedbackreport_viewed_mystudents.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/myfeedback/index.php', array('user' => $this->relateduserid));
return new \moodle_url('/report/myfeedback/index.php', ['user' => $this->relateduserid]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/event/myfeedbackreport_viewed_ptutordash.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/myfeedback/index.php', array('user' => $this->relateduserid));
return new \moodle_url('/report/myfeedback/index.php', ['user' => $this->relateduserid]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/event/myfeedbackreport_viewed_usagedash.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/report/myfeedback/index.php', array('user' => $this->relateduserid));
return new \moodle_url('/report/myfeedback/index.php', ['user' => $this->relateduserid]);
}

/**
Expand Down
Loading

0 comments on commit fb927fe

Please sign in to comment.