Allow resolve PHP version from jobs in [Travis] CI config (#4731)
* allow resolve PHP version from jobs in Travis CI config * get version from jobs Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
@@ -16,6 +16,9 @@ const schema = Joi.object({
|
||||
matrix: Joi.object({
|
||||
include: Joi.array().items(Joi.object({ php: optionalNumberOrString })),
|
||||
}),
|
||||
jobs: Joi.object({
|
||||
include: Joi.array().items(Joi.object({ php: optionalNumberOrString })),
|
||||
}),
|
||||
}).required(),
|
||||
}).required(),
|
||||
}).required()
|
||||
@@ -73,6 +76,12 @@ module.exports = class TravisPhpVersion extends BaseJsonService {
|
||||
config.matrix.include.filter(v => 'php' in v).map(v => v.php.toString())
|
||||
)
|
||||
}
|
||||
// from jobs
|
||||
if (config.jobs && config.jobs.include) {
|
||||
travisVersions = travisVersions.concat(
|
||||
config.jobs.include.filter(v => 'php' in v).map(v => v.php.toString())
|
||||
)
|
||||
}
|
||||
|
||||
const versions = travisVersions
|
||||
.map(v => minorVersion(v))
|
||||
|
||||
@@ -15,6 +15,10 @@ t.create('gets the package version of yii')
|
||||
.get('/yiisoft/yii.json')
|
||||
.expectBadge({ label: 'php', message: isPhpVersionReduction })
|
||||
|
||||
t.create('gets the package version of pagination-bundle')
|
||||
.get('/gpslab/pagination-bundle.json')
|
||||
.expectBadge({ label: 'php', message: isPhpVersionReduction })
|
||||
|
||||
t.create('invalid package name')
|
||||
.get('/frodo/is-not-a-package.json')
|
||||
.expectBadge({ label: 'php', message: 'repo not found' })
|
||||
|
||||
Reference in New Issue
Block a user