You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
github-actions[bot] edited this page Sep 22, 2023
·
3 revisions
GitHub Action
WIth UnitTestBot GitHub Action you can generate and run unit tests
for your project directly on GitHub — and get the SARIF report.
How to generate tests and a SARIF report with UnitTestBot GitHub Action:
On GitHub.com, navigate to the main page of the repository. Under your repository name, select Settings. In the
left sidebar, select Actions > General.
Scroll down and select Allow GitHub Actions to create and approve pull requests.
Create a .github/workflows directory in your GitHub repository with a .yml file in it:
utbot_version: '[version]' — for the UnitTestBot engine
To run the workflow, under your repository name, select Actions, then choose the UnitTestBot workflow.
In the
Run workflow dropdown section, select the branch to use the workflow from. Press Run workflow.
How to use the generated tests and the SARIF report:
UnitTestBot GitHub Action creates a new project branch named like utbot-code-analysis-[short-commit-hash] and a
pull request to a branch where you ran the workflow.
In this new branch, two new folders appear:
the tests folder contains the generated tests with the related files,
the utbot_report folder contains the SARIF report for a project (project_code_analysis.sarif) as well as the
generation statistics.
To view the alerts, under your repository name, select Security, and in the left sidebar, select Code
scanning.