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

Generate error annotations when not publishing a check #34

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

nineinchnick
Copy link
Member

Using the GitHub Actions to create/update a check with annotations have
multiple drawbacks, and doesn't work well in repositories with complex
workflows. Create error annotations when skip publish option is set,
without using the GHA REST API.

This is inspired by https://github.com/mikepenz/action-junit-report/blob/main/src/annotator.ts#L39

I'll apply the same change in https://github.com/starburstdata/action-testng-report before using this in the Trino workflows.

Using the GitHub Actions to create/update a check with annotations have
multiple drawbacks, and doesn't work well in repositories with complex
workflows. Create error annotations when skip publish option is set,
without using the GHA REST API.
@nineinchnick
Copy link
Member Author

Tehnically we could also generate a job summary. Getting the number of executed tests might be useful since we only run tests from impacted modules in PRs. I'll do this as a follow-up.

@nineinchnick
Copy link
Member Author

I tested this in my Trino fork, since I opened a PR with a hardcoded test failure against a branch that's using these updated actions: https://github.com/nineinchnick/trino/actions/runs/10884950374?pr=18

The annotation shows up in the summary.

startColumn: annotation.start_column,
endColumn: annotation.end_column
};
core.error(annotation.message, properties);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@nineinchnick nineinchnick merged commit b63800b into main Sep 17, 2024
2 of 5 checks passed
@nineinchnick nineinchnick deleted the surefire-report-update-check branch September 17, 2024 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants