- Notifications
You must be signed in to change notification settings - Fork1
Github action for DrupalQA image
License
hussainweb/drupalqa-action
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This action runs checks fromDrupalQAon a Drupal codebase. While you can directly use the Docker image with GitHubActions, this Action makes it simpler to specify and configure some of thechecks.
The PHP version to use (corresponds to the Docker image). Allowed options andtheir corresponding Docker images are as follows. Default:8.4.
| php-version | Docker image |
|---|---|
| 7.3 | hussainweb/drupalqa:php7.3 (not supported) |
| 7.4 | hussainweb/drupalqa:php7.4 (not supported) |
| 8.0 | hussainweb/drupalqa:php8.0 (not supported) |
| 8.1 | hussainweb/drupalqa:php8.1 (not supported) |
| 8.2 | hussainweb/drupalqa:php8.2 |
| 8.3 | hussainweb/drupalqa:php8.3 |
| 8.4 | hussainweb/drupalqa:php8.4 |
| latest | hussainweb/drupalqa:latest |
Note: The actual Docker image used also depends on theregistry option. Ifthat option is set to'ghcr' (default value), then the Docker image isprefixed withghcr.io/. For example,ghcr.io/hussainweb/drupalqa:php8.2.
The web root (document root) for default values for some of the checks. Default:web.
A YAML string describing the checks to run. The default structure is as below.
checks:| phplint: {} phpcs: {}
The options for each of these are described in theDrupalQA checks section.
The registry to use to download the image. Onlyghcr anddockerhub aresupported. You probably don't need to change this option. It's only there tocompare the performance and switch to DockerHub in case there is a problem withghcr.io (which is unlikely). Default:ghcr.
No outputs.
uses:hussainweb/drupalqa@v1with:php-version:8.4checks:| phplint: {} phpcs: standard: phpcs.xml phpmd: ruleset: phpmd.xml
DrupalQA action supports configuring checks for the following tools.
These are the default options forphplint.
checks:| phplint: exclude: vendor,web/core,web/modules/contrib extensions: php,module,theme,engine,inc,install verbose: '' path: ''
In the above sample, the paths begin withweb as it is the default forweb-root input. The actual default will depend on theweb-root input.
phplint supports a.phplint.yml and can be run without any options. If youare using this, you can pass in theno_default_options option as follows.
checks:| phplint: no_default_options:true
If you set this option to true, all other options are ignored.
These are the default options forphpcs. All are optional and you can overridethese as per thecommand line options of phpcs.
checks:| phpcs: standard: Drupal,DrupalPractice extensions: php,module,inc,install,test,profile,theme ignore: '' path: web/modules/custom
In the above sample, the path begins withweb as it is the default forweb-root input. The actual default will depend on theweb-root input.
You can specify multiple paths by separating them with a comma.
checks:| phpcs: standard: Drupal,DrupalPractice path: web/modules/custom,web/themes/custom
These are the default options forphpmd. All are optional and you can overridethese as per thecommand line options of phpmd.
checks:| phpmd: path: web/modules/custom format: text ruleset: codesize,naming,unusedcode suffixes: php,module,theme,engine,inc exclude: ''
In the above sample, the path begins withweb as it is the default forweb-root input. The actual default will depend on theweb-root input.
These are the default options forgrumphp. All are optional and you canoverride these as per thecommand line options ofgrumphp run.
checks:| grumphp: testsuite: '' tasks: []
This runsgrumphp run on the codebase.
These are the default options forphpstan. All are optional and you canoverride these as per thecommand line options ofphpstan.
checks:| phpstan: configuration: '' paths: []
This runsphpstan on the codebase with the specified options. For the defaultsto work, you must have aphpstan.neon configuration file in your codebase asmentioned in the documentation.Note that the defaultphpstan.neon as generated byaxelerant/drupal-quality-checkeris valid for this purpose.
This allows you to run any arbitrary commands that you may want to run fromwithin the tools that are available within the Docker image. This is useful ifyou want to run one of the tools available in the drupalqa Docker image butthere is no custom check written above, or if you want to use a configurationoption not available above. In any case, if you think what you are trying to runhere is common enough, consider submitting an issue and/or a pull request to addthe check. Look at other pull requests such as #121 and #122 to see how to writea check.
Example usage:
checks:| custom_linters: command: ['grumphp', 'run', '--testsuite=linters'] custom_stylecheck: command: ['grumphp', 'run', '--testsuite=style']
The above will run two commands as shown. Thecustom check was introduced forsituations where we need to run the same command twice with different options.This is otherwise not possible using the typical check format as keys may not berepeated in YAML.
About
Github action for DrupalQA image
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.