diff --git a/.github/workflows/comment.yml b/.github/workflows/comment.yml index e0c20c8..8a6db05 100644 --- a/.github/workflows/comment.yml +++ b/.github/workflows/comment.yml @@ -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' }); \ No newline at end of file diff --git a/util/compare_bfs_result.py b/util/compare_bfs_result.py index 0b6a346..b96026b 100644 --- a/util/compare_bfs_result.py +++ b/util/compare_bfs_result.py @@ -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) diff --git a/util/compare_gnu_result.py b/util/compare_gnu_result.py index 3f6fb8c..7e5e251 100644 --- a/util/compare_gnu_result.py +++ b/util/compare_gnu_result.py @@ -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)