Skip to content

Commit e283436

Browse files
committed
docs: add more detailed documentation regarding the new php platform
requirement flags Signed-off-by: Maximilian Bösing <[email protected]>
1 parent c000113 commit e283436

File tree

1 file changed

+25
-51
lines changed

1 file changed

+25
-51
lines changed

README.md

Lines changed: 25 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,25 @@ The "exclude" element will only be present if the package using the action provi
7676
Each item in the "exclude" array will be an object, with one or more of the keys listed in the "include" objects; when a job matches all elements specified in the "exclude" array, it will be excluded from runs.
7777

7878
The "job" element is a string JSON object detailing the job to run.
79-
Note: it is **not** an object; it is a JSON string.
80-
It will have the following elements, but is not restricted to them:
79+
Note: it is **not** an object; it is a JSON string but it MUST have the structure as shown [here](#job-element).
80+
81+
### Job Element
82+
83+
The "job" element will have the following elements, but is not restricted to them:
8184

8285
```json
8386
{
84-
"php": "string PHP minor version to run against",
87+
"php": "(optional) string PHP minor version to run against",
8588
"extensions": [
86-
"extension names to install; names are from the ondrej PHP repository, minus the php{VERSION}- prefix",
89+
"(optional) extension names to install; names are from the ondrej PHP repository, minus the php{VERSION}- prefix"
8790
],
8891
"ini": [
89-
"php.ini directives, one per element; e.g. 'memory_limit=-1'",
92+
"(optional) php.ini directives, one per element; e.g. 'memory_limit=-1'"
9093
],
91-
"dependencies": "dependencies to test against; one of lowest, locked, latest",
92-
"command": "command to run to perform the check"
94+
"dependencies": "(optional) dependencies to test against; one of lowest, locked, latest. default: locked",
95+
"command": "(required) command to run to perform the check",
96+
"ignore_platform_reqs_8": "(optional; deprecated) boolean; whether to add `--ignore-platform-req=php` to composer for PHP 8.0",
97+
"ignore_php_platform_requirement": "(optional) boolean; whether to add `--ignore-platform-req=php` to composer for this job."
9398
}
9499
```
95100

@@ -116,7 +121,11 @@ The package can include a configuration file in its root, `.laminas-ci.json`, wh
116121
"exclude": [
117122
{
118123
}
119-
]
124+
],
125+
"ignore_php_platform_requirements": {
126+
"8.0": true
127+
},
128+
"stablePHP": "7.4"
120129
}
121130
```
122131

@@ -130,39 +139,18 @@ Each element in that array should be in the same format as listed above for the
130139
"name": "(string) Name of the check being run",
131140
"operatingSystem": "(string) Name of the OS the job should be run on (generally ubuntu-latest)",
132141
"action": "(string) GHA to run the step on; currently ignored, as GHA does not support dynamic action selection",
133-
"job": "(string) JSON object detailing the job (more on this later)",
142+
"job": "(string) JSON object detailing the job"
134143
}
135144
```
136145

137146
The "job" element can either be a JSON string representing a job, or an object.
138-
In each case, it MUST have the structure as noted above:
139-
140-
```json
141-
{
142-
"php": "(string; REQUIRED) PHP minor version to run against",
143-
"extensions": [
144-
"OPTIONAL array of strings",
145-
"Each element represents an extension to install",
146-
"Names are from the Sury PHP repository, minus the php{VERSION}- prefix"
147-
],
148-
"ini": [
149-
"OPTIONAL array of strings",
150-
"Each element respresents one php.ini directive",
151-
"e.g. 'memory_limit=-1'"
152-
],
153-
"dependencies": "dependencies to test against; one of lowest, locked, latest",
154-
"ignore_platform_reqs_8": "(boolean; OPTIONAL; DEPRECATED) Whether or not to ignore platform requirements on PHP 8; defaults to true",
155-
"ignore_platform_reqs": {
156-
"8.0": true,
157-
"8.1": true,
158-
"(object; OPTIONAL) Whether or not to ignore platform requirements for specific PHP versions; defaults to true for PHP 8 & PHP 8.1": false
159-
},
160-
"command": "command to run to perform the check"
161-
}
162-
```
147+
In each case, it MUST have the structure as shown [here](#job-element) **but** the "php" element is mandatory in here and MUST contain
148+
the minor PHP version to run the check against.
163149

164150
The action validates each check and its job to ensure it is structured correctly, and will provide warnings if not, omitting any check that is malformed from the output.
165151

152+
**If specific checks are provided by a project, the matrix won't contain any auto-detected checks and will only output these checks.**
153+
166154
### Providing additional checks
167155

168156
The `additional_checks` key allows package authors to provide checks to run in addition to any discovered.
@@ -175,29 +163,15 @@ The syntax for the `additional_checks` key is as follows:
175163
"additional_checks": [
176164
{
177165
"name": "(string; REQUIRED) name of the check to run",
178-
"job": {
179-
"command": "(string; REQUIRED) command to run",
180-
"php": "(string; OPTIONAL) PHP version to run on (defaults to stable-php); * indicates all versions",
181-
"dependencies": "(string; OPTIONAL) dependency set to run on (defaults to locked); * indicates all sets",
182-
"extensions": [
183-
"(array of strings; OPTIONAL) specific extensions to install for this check only"
184-
],
185-
"ini": [
186-
"(array of strings; OPTIONAL) specific php.ini settings to use for this check only"
187-
],
188-
"ignore_platform_reqs_8": "(boolean; OPTIONAL; DEPRECATED) Whether or not to ignore platform reqs when installing dependencies on PHP 8.0; defaults to true",
189-
"ignore_platform_reqs": {
190-
"8.0": true,
191-
"8.1": true,
192-
"(object; OPTIONAL) Whether or not to ignore platform requirements for specific PHP versions; defaults to true for PHP 8 & PHP 8.1": false
193-
}
194-
}
166+
"job": "(object) JSON object detailing the job"
195167
}
196168
]
197169
}
198170
```
199171

200172
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.
173+
The "job" element MUST have the structure as shown [here](#job-element) **but** the "php" element is mandatory in here and MUST contain either the minor PHP version to run the check against or a wildcard `*` to run the against **all** supported PHP versions.
174+
In case that the "php" version is passed as a wildcard `*`, the `ignore_php_platform_requirement` element will be ignored. It is possible to provide per-version flags by adding the `ignore_php_platform_requirements` element instead.
201175

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

0 commit comments

Comments
 (0)