A GitHub Action that converts TRX (Visual Studio Test Results) files to Visual Studio Test playlist files. This action uses the trx-to-vsplaylist
.NET global tool to perform the conversion and automatically uploads the generated playlist file as an artifact that can be easily downloaded from your GitHub Actions run.
- ✅ Converts TRX files to VS Test playlist files
- ✅ Configurable output path
- ✅ Customizable test outcome filtering
- name: Convert TRX to Playlist
uses: BenjaminMichaelis/trx-to-vsplaylist@v1
with:
trx-file-path: './TestResults/results.trx'
- name: Convert TRX to Playlist
uses: BenjaminMichaelis/trx-to-vsplaylist@v1
with:
trx-file-path: './TestResults/results.trx'
output-directory: './artifacts'
test-outcomes: 'Failed,NotExecuted'
skip-empty: false # disables skipping empty playlists
name: Test and Generate Playlist
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Run Tests
run: |
dotnet test --logger trx --results-directory ./TestResults
- name: Convert TRX to Playlist
if: always() # Run even if tests fail
uses: BenjaminMichaelis/trx-to-vsplaylist@v1
with:
trx-file-path: './TestResults/*.trx'
test-outcomes: 'Failed'
# The playlist file will be automatically uploaded as an artifact named either by the specified `artifact-name` or as `playlists`
Input | Description | Required | Default |
---|---|---|---|
trx-file-path |
Path to the TRX file to convert (supports glob patterns for multiple files) | Yes | - |
output-directory |
Directory to write the output playlist file(s) to. If not specified, saves in the same directory as the TRX file with .playlist extension | No | - |
test-outcomes |
Test outcomes to include in the playlist (comma-separated). Accepts: Passed, Failed, NotExecuted, Inconclusive, Timeout | No | Failed |
artifact-name |
Name for the uploaded artifact. If not specified, will use the playlist file name (without extension) | No | playlist file name |
skip-empty |
Skip writing out empty playlist files. If true, empty playlists will not be created. | No | true |
Output | Description |
---|---|
playlist-path |
Path to the generated playlist file |
The following test outcomes can be specified in the test-outcomes
input:
- Passed
- Failed
- NotExecuted
- Inconclusive
- Timeout
- Pending
You can specify multiple outcomes by separating them with commas: Failed,NotExecuted,Timeout
The generated playlist file is automatically uploaded as a workload artifact.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please open an issue on the GitHub repository.