Skip to content

Provide ability to provide checks to run in addition to auto-discovered checks #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

weierophinney
Copy link
Member

Previously, usage of the "checks" array would cause usage of that value for the matrix, and no further discovery would occur. This patch adds a new key, additional_checks, which allows package authors to provide checks to run in addition to any discovered. This allows providing checks for tools the matrix discovery tools do not know about, or providing one-off checks (such as benchmarks or mutation tests).

The syntax for the additional_checks key is as follows:

{
    "additional_checks": [
        {
            "name": "(string; REQUIRED) name of the check to run",
            "job": {
                "command": "(string; REQUIRED) command to run",
                "php": "(string; OPTIONAL) PHP version to run on (defaults to stable-php); * indicates all versions",
                "dependencies": "(string; OPTIONAL) dependency set to run on (defaults to locked); * indicates all sets",
                "extensions": [
                    "(array of strings; OPTIONAL) specific extensions to install for this check only"
                ],
                "ini": [
                    "(array of strings; OPTIONAL) specific php.ini settings to use for this check only"
                ]
            }
        }
    ]
}

A job per PHP version per dependency set will be created, and the "name" will be appended with "on PHP {VERSION} with {DEPS} dependencies" during an actual run.

The tool discovers checks first, then appends any additional_checks are concatenated, and then any exclude rules are applied.

Fixes #11

Previously, usage of the "checks" array would cause usage of that value for the matrix, and no further discovery would occur.
This patch adds a new key, "additional_checks", which allows package authors to provide checks to run _in addition to any discovered_.
This allows providing checks for tools the matrix discovery tools do not know about, or providing one-off checks (such as benchmarks or mutation tests).

The syntax for the "additional_checks" key is as follows:

```json
{
    "additional_checks": [
        {
            "name": "(string; REQUIRED) name of the check to run",
            "job": {
                "command": "(string; REQUIRED) command to run",
                "php": "(string; OPTIONAL) PHP version to run on (defaults to stable-php); * indicates all versions",
                "dependencies": "(string; OPTIONAL) dependency set to run on (defaults to locked); * indicates all sets",
                "extensions": [
                    "(array of strings; OPTIONAL) specific extensions to install for this check only"
                ],
                "ini": [
                    "(array of strings; OPTIONAL) specific php.ini settings to use for this check only"
                ]
            }
        }
    ]
}
```

A job per PHP version per dependency set will be created, and the "name" will be appended with "on PHP {VERSION} with {DEPS} dependencies" during an actual run.

The tool discovers checks first, then appends any `additional_checks` are concatenated, and then any `exclude` rules are applied.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
@weierophinney weierophinney added this to the 1.3.0 milestone Mar 4, 2021
This ensures that we get information about errors flagged better in the GHA env.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
@weierophinney weierophinney merged commit 604ed10 into laminas:1.3.x Mar 4, 2021
@weierophinney weierophinney deleted the feature/additional-checks branch March 4, 2021 16:02
@gsteel
Copy link
Member

gsteel commented Mar 4, 2021

Awesome! I'm gonna go try that out as soon as I can. Thanks @weierophinney

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the ability to specify additional checks to perform
2 participants