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:
Peter Gribanov
2020-03-07 04:03:23 +03:00
committed by GitHub
parent 6b16939ccd
commit a082feec0c
2 changed files with 13 additions and 0 deletions

View File

@@ -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))

View File

@@ -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' })