Merge branch 'main' into pr-179

This commit is contained in:
Michal Dorner
2022-11-30 18:40:51 +01:00
47 changed files with 24483 additions and 18386 deletions

View File

@@ -25,7 +25,8 @@ async function main(): Promise<void> {
const testReporter = new TestReporter()
await testReporter.run()
} catch (error) {
core.setFailed(error.message)
if (error instanceof Error) core.setFailed(error)
else core.setFailed(JSON.stringify(error))
}
}
@@ -153,7 +154,7 @@ class TestReporter {
}
core.info(`Creating check run ${name}`)
const createResp = await this.octokit.checks.create({
const createResp = await this.octokit.rest.checks.create({
head_sha: this.context.sha,
name,
status: 'in_progress',
@@ -166,18 +167,18 @@ class TestReporter {
core.info('Creating report summary')
const {listSuites, listTests, onlySummary} = this
const baseUrl = createResp.data.html_url
const baseUrl = createResp.data.html_url as string
const summary = getReport(results, {listSuites, listTests, baseUrl, onlySummary})
core.info('Creating annotations')
const annotations = getAnnotations(results, this.maxAnnotations)
const isFailed = results.some(tr => tr.result === 'failed')
const isFailed = this.failOnError && results.some(tr => tr.result === 'failed')
const conclusion = isFailed ? 'failure' : 'success'
const icon = isFailed ? Icon.fail : Icon.success
core.info(`Updating check run conclusion (${conclusion}) and output`)
const resp = await this.octokit.checks.update({
const resp = await this.octokit.rest.checks.update({
check_run_id: createResp.data.id,
conclusion,
status: 'completed',