Fail (optionally) the action if test report contains any failed test

This commit is contained in:
Michal Dorner 2020-11-18 21:54:36 +01:00
parent 1ee2707b1a
commit 94e768fc01
No known key found for this signature in database
GPG key ID: 9EEE04B48DA36786
4 changed files with 13 additions and 1 deletions

View file

@ -14,6 +14,7 @@ async function run(): Promise<void> {
}
async function main(): Promise<void> {
const failOnError = core.getInput('fail-on-error', {required: true}) === 'true'
const name = core.getInput('name', {required: true})
const path = core.getInput('path', {required: true})
const reporter = core.getInput('reporter', {required: true})
@ -37,6 +38,9 @@ async function main(): Promise<void> {
})
core.setOutput('conclusion', conclusion)
if (failOnError && !result.success) {
core.setFailed(`Failed test has been found and 'fail-on-error' option is set to ${failOnError}.`)
}
}
function getParser(reporter: string): ParseTestResult {