Comments are only sent when GNU/BFS test compatibility changes. (#407)

This commit is contained in:
hanbings
2024-06-28 02:56:32 -04:00
committed by GitHub
parent f2202dc23f
commit f145469cfd
3 changed files with 17 additions and 2 deletions
+9 -2
View File
@@ -58,12 +58,19 @@ jobs:
.map(annotation => `${annotation.run}: ${annotation.annotation.message}`)
.join('\n');
console.log(annotationContent);
// check if no changes
let gnuTestReport = annotationContent.includes('Run GNU findutils tests: Gnu tests No changes');
let bfsTestReport = annotationContent.includes('Run BFS tests: BFS tests No changes');
if (gnuTestReport && bfsTestReport) {
console.log('No changes');
return;
}
// Comment on the PR
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: annotations.pull_request_number,
body: 'GNU testsuite comparison:\n```\n' + annotationContent + '\n```\n'
body: 'Commit ${{ github.event.workflow_run.head_sha }} has GNU testsuite comparison:\n```\n' + annotationContent + '\n```\n'
});
+4
View File
@@ -21,6 +21,10 @@ fail_d = int(current["fail"]) - int(last["fail"])
# Get an annotation to highlight changes
print(f"::warning ::Changes from main: PASS {pass_d:+d} / SKIP {skip_d:+d} / FAIL {fail_d:+d}")
# Check if there are no changes.
if pass_d == 0:
print("::warning ::BFS tests No changes")
# If results are worse fail the job to draw attention
if pass_d < 0:
sys.exit(1)
+4
View File
@@ -24,6 +24,10 @@ print(
f"::warning ::Changes from main: PASS {pass_d:+d} / FAIL {fail_d:+d} / ERROR {error_d:+d} / SKIP {skip_d:+d} "
)
# Check if there are no changes.
if pass_d == 0:
print("::warning ::Gnu tests No changes")
# If results are worse fail the job to draw attention
if pass_d < 0:
sys.exit(1)