This Action was inspired by https://github.com/zyborg/dotnet-tests-report
This GitHub Action provides a fast and reliable way of parsing dotnet test results from trx files in a given directory. The action will find trx files specified in the TRX-PATH
input variable. This path must be accessible to the action.
The action features parallel processing for improved performance - it will read and process multiple .trx files concurrently, convert them to typed JSON objects, and create GitHub Status checks in parallel. Each TRX file generates a detailed markup report with the report name and title derived from data.TestRun.TestDefinitions.UnitTest[0]._storage
.
The following reports show a failing and a passing check generated by this action.
Workflow Reports:
![]() |
![]() |
To make trx-parser
a part of your workflow, just add the following to your existing workflow file in your .github/workflows/
directory in your GitHub repository.
name: Test
on: [pull_request]
jobs:
Build:
runs-on: ubuntu-latest
steps:
# Replace this whichever way you build your code
- name: Build & Test dotnet code
run: |
dotnet restore
dotnet build -c Release no-restore
dotnet test -c Release --no-restore --no-build --logger trx --results-directory ./TestResults
# Using the trx-parser action
- name: Parse Trx files
uses: NasAmin/trx-parser@v0.1
id: trx-parser
with:
TRX_PATH: $/TestResults #This should be the path to your TRX files
REPO_TOKEN: $
| Name | Description | Default | Required |
| —- | ———– | ——- | ——– |
| TRX_PATH
| Path to the directory container your test files | ./TestResults
| yes
|
| REPO_TOKEN
| GitHub token to create status checks | nil
| yes
|
| SHA
| The commit SHA associated with the checks. This is optional | nil
| no
|
| IGNORE_FAILURE
| If true, will not set status check as failure. | false
| no
|
| REPORT_PREFIX
| The prefix for the report name. Useful for matrix builds | nil
| no
|
| OTEL_ENABLED
| Enable OpenTelemetry telemetry collection | false
| no
|
| HONEYCOMB_API_KEY
| Honeycomb API key for telemetry export | nil
| no
|
| HONEYCOMB_DATASET
| Honeycomb dataset name for telemetry | trx-parser
| no
|
This action now includes optional telemetry using OpenTelemetry and Honeycomb to help you monitor test execution patterns and performance. Telemetry is disabled by default and requires explicit configuration.
Key Features:
For detailed configuration and usage, see the Telemetry Documentation.
65535
characters. So if the test report exceeds this limit, GitHub will fail to create a check and fail your workflow.
This was mitigated on #103 and #138 to only report details about failing tests.This action features a modern, modular architecture designed for maintainability and performance:
The codebase is organized into focused, single-responsibility modules:
src/config/constants.ts
- Configuration and constantssrc/config/telemetry-config.ts
- Telemetry configurationsrc/parsers/trx-parser.ts
- TRX file parsing logicsrc/services/github-service.ts
- GitHub API operationssrc/services/report-service.ts
- Report generationsrc/services/telemetry-service.ts
- OpenTelemetry integrationsrc/utils/file-utils.ts
- File operationssrc/utils/test-analyzer.ts
- Test result analysissrc/validators/input-validator.ts
- Input validationAnyone is welcome to contribute and make this action better. Please fork the repository and create a pull request with proposed changes.
npm install
npm run build
npm run test
npm run lint
(or npm run lint-fix
to auto-fix)npm run format
npm run package
npm run all
The modular architecture makes it easy to:
src/parsers/
src/services/
src/validators/
src/utils/
This repository uses automated releases powered by release-please. When you contribute:
feat:
, fix:
, docs:
)See docs/RELEASE.md for detailed information about the release process.