|
| 1 | +name: PHPMD (php-actions) |
| 2 | +description: Run your PHP Mess Detector tests in your Github Actions. |
| 3 | + |
| 4 | +inputs: |
| 5 | + version: |
| 6 | + description: What version of PHPMD to use |
| 7 | + default: latest |
| 8 | + required: false |
| 9 | + |
| 10 | + php_version: |
| 11 | + description: What version of PHP to use |
| 12 | + default: latest |
| 13 | + required: false |
| 14 | + |
| 15 | + vendored_phpmd_path: |
| 16 | + description: Path to a vendored phpmd binary |
| 17 | + required: false |
| 18 | + |
| 19 | + path: |
| 20 | + description: A php source code filename or directory. Can be a comma-separated string |
| 21 | + required: true |
| 22 | + |
| 23 | + ruleset: |
| 24 | + description: A ruleset filename or a comma-separated string of rulesetfilenames |
| 25 | + required: true |
| 26 | + |
| 27 | + output: |
| 28 | + description: A report format |
| 29 | + default: text |
| 30 | + required: false |
| 31 | + |
| 32 | + minimumpriority: |
| 33 | + description: rule priority threshold; rules with lower priority than this will not be used |
| 34 | + required: false |
| 35 | + |
| 36 | + reportfile: |
| 37 | + description: send report output to a file; default to STDOUT |
| 38 | + required: false |
| 39 | + |
| 40 | + suffixes: |
| 41 | + description: comma-separated string of valid source code filename extensions, e.g. php,phtml |
| 42 | + required: false |
| 43 | + |
| 44 | + exclude: |
| 45 | + description: comma-separated string of patterns that are used to ignore directories. Use asterisks to exclude by pattern. For example *src/foo/*.php or *src/foo/* |
| 46 | + required: false |
| 47 | + |
| 48 | + strict: |
| 49 | + description: also report those nodes with a @SuppressWarnings annotation |
| 50 | + required: false |
| 51 | + |
| 52 | + args: |
| 53 | + description: Extra arguments to pass to the phpmd binary |
| 54 | + required: false |
| 55 | + |
| 56 | +runs: |
| 57 | + using: "composite" |
| 58 | + steps: |
| 59 | + - env: |
| 60 | + ACTION_TOKEN: ${{ github.token }} |
| 61 | + ACTION_VERSION: ${{ inputs.version }} |
| 62 | + ACTION_PHP_VERSION: ${{ inputs.php_version }} |
| 63 | + ACTION_PHPMD_PATH: ${{ inputs.vendored_phpmd_path }} |
| 64 | + ACTION_PATH: ${{ inputs.path }} |
| 65 | + ACTION_RULESET: ${{ inputs.ruleset }} |
| 66 | + ACTION_OUTPUT: ${{ inputs.output }} |
| 67 | + ACTION_MINIMUMPRIORITY: ${{ inputs.minimumpriority }} |
| 68 | + ACTION_REPORTFILE: ${{ inputs.reportfile }} |
| 69 | + ACTION_SUFFIXES: ${{ inputs.suffixes }} |
| 70 | + ACTION_EXCLUDE: ${{ inputs.exclude }} |
| 71 | + ACTION_STRICT: ${{ inputs.strict }} |
| 72 | + ACTION_ARGS: ${{ inputs.args }} |
| 73 | + |
| 74 | + id: phpmd_run |
| 75 | + run: | |
| 76 | + set -e |
| 77 | + bash <(curl -s https://raw.githubusercontent.com/php-actions/php-build/cee5b9fa9fbc4c888e7a62bbb7b8eade18e3c56b/php-build.bash) phpmd |
| 78 | + ${{ github.action_path }}/phpmd-action.bash |
| 79 | + shell: bash |
| 80 | + |
| 81 | +branding: |
| 82 | + icon: 'check-square' |
| 83 | + color: 'purple' |
0 commit comments