Skip to content

Commit

Permalink
Update CI config and fix coding style.
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Oct 27, 2023
1 parent d67c26f commit c75d531
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
41 changes: 22 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Moodle plugin CI

on: [push, pull_request]

jobs:
Expand All @@ -8,9 +9,12 @@ jobs:
fail-fast: false
matrix:
include:
- php: '8.0'
- php: '8.1'
moodle-branch: 'master'
database: 'pgsql'
- php: '8.2'
moodle-branch: 'MOODLE_403_STABLE'
database: 'pgsql'
- php: '8.1'
moodle-branch: 'MOODLE_402_STABLE'
database: 'pgsql'
Expand All @@ -27,13 +31,9 @@ jobs:
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
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3

mariadb:
image: mariadb:10
Expand Down Expand Up @@ -76,47 +76,50 @@ jobs:
MOODLE_BRANCH: ${{ matrix.moodle-branch }}

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

- name: PHP Copy/Paste Detector
if: ${{ always() }}
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpcpd

- name: PHP Mess Detector
if: ${{ always() }}
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpmd

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

- name: Moodle PHPDoc Checker
continue-on-error: true # This step will show errors but will not fail.
if: ${{ always() }}
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpdoc

- 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
if: ${{ always() }}
# if: ${{ matrix.moodle-branch == 'MOODLE_401_STABLE' }}
if: ${{ !cancelled() }}
# if: ${{ matrix.moodle-branch == 'MOODLE_402_STABLE' }}
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
7 changes: 5 additions & 2 deletions classes/import_as_version_action_column.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ protected function get_url_icon_and_label(\stdClass $question): array {
$params['courseid'] = $context->instanceid;
}

return [new moodle_url('/question/bank/importasversion/import.php', $params),
't/restore', $this->actionname];
return [
new moodle_url('/question/bank/importasversion/import.php', $params),
't/restore',
$this->actionname,
];
}
}
2 changes: 1 addition & 1 deletion classes/plugin_feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class plugin_feature extends plugin_features_base {

public function get_question_columns($qbank): array {
return [
new import_as_version_action_column($qbank)
new import_as_version_action_column($qbank),
];
}
}

0 comments on commit c75d531

Please sign in to comment.