GitHub Actions
Configure Flaky Tests detection using a GitHub Action
Configuring the Analytics Uploader Action
The Analytics Uploader Action uploads test reports to Trunk Flaky Tests from your GitHub workflows. Here are the steps for setting it up:
Create a GitHub workflow that runs the tests you want to monitor and produces a test report in JUnit XML format. Be careful that your test invocation doesn't use cached test results, and doesn't automatically retry failing tests.
Modify your GitHub workflow to add the Trunk Analytics Uploader Action as the step after your tests run. Point the uploader to the locations on disk where your test runner outputs Junit XML files:
Find Organization Slug and Token
Next you will need your Trunk organization slug and token. Navigate to app.trunk.io. Once logged in navigate to Settings -> Manage -> Organization. Copy your organization slug. You can find your Trunk token by navigating to Settings → Manage Organization → Organization API Token and clicking "View." Provide this token as a GitHub secret.
Sample GitHub Actions workflow file:
If you're interested in better understanding this binary or want to contribute to it, you can find the open source repo here.
Last updated