Skip to content

Commit

Permalink
Add option to enable phpmd and do not run by default #67
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanheywood committed Aug 2, 2022
1 parent 045196d commit bfcd6ae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/plugin/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ inputs:
description: 'Option to disable phpunit tests'
disable_grunt:
description: 'Option to disable grunt'
enable_phpmd:
description: 'Option to enable phpmd'

highest_moodle_branch:
description: 'Holds the value of the highest moodle-branch in the test matrix'
runs:
Expand Down Expand Up @@ -134,8 +137,8 @@ runs:
shell: bash

- name: PHP Mess Detector
if: ${{ always() }}
run: moodle-plugin-ci phpmd || true
if: ${{ always() && inputs.enable_phpmd == 'true' }}
run: moodle-plugin-ci phpmd
shell: bash

- name: Moodle PHPDoc Checker
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ on:
description: 'If true, this will skip the release job'
type: boolean
default: false
enable_phpmd:
type: boolean
default: false
release_branches:
description: 'Required if the branch that should process releases is in a non-standard format (e.g. main or MOODLE_XX_STABLE)'
type: string
Expand Down Expand Up @@ -175,6 +178,7 @@ jobs:
disable_mustache: ${{ inputs.disable_mustache }}
disable_phplint: ${{ inputs.disable_phplint }}
disable_phpunit: ${{ inputs.disable_phpunit }}
enable_phpmd: ${{ inputs.enable_phpmd }}
highest_moodle_branch: ${{ needs.prepare_matrix.outputs.highest_moodle_branch }}

release:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ Below lists the available inputs which are _all optional_:
| disable_grunt | Set `true` to disable grunt. |
| disable_mustache | Set `true` to disable mustache. |
| disable_master | If `true`, this will skip testing against moodle/master branch |
| disable_release | If `true`, this will skip the release job |
| disable_release | If `true`, this will skip the release job |
| enable_phpmd | If `true`, to enable phpmd |
| release_branches | Name of the non-standardly named branch which should run the release job |
| moodle_branches | Specify the MOODLE_XX_STABLE branch you specifically want to test against. This is _not_ recommended, and instead you should configuring a supported range. |

Expand Down

0 comments on commit bfcd6ae

Please sign in to comment.