Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 4 additions & 0 deletions util/compare_bfs_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
# 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 changes: 4 additions & 0 deletions util/compare_gnu_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
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)
Loading