Skip to content

Commit

Permalink
ci: Fix test reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
kf6kjg committed Jun 7, 2021
1 parent 883e137 commit 1631c40
Showing 1 changed file with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions .github/workflows/test-report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,40 @@ jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]

- name: Fetch transform code
run: |
wget https://raw.githubusercontent.com/nunit/nunit-transforms/master/nunit3-junit/nunit3-junit.xslt
shell: bash

- name: Get test results artifact
uses: actions/[email protected]
# There's no support for selective download: it's either ALL artifacts or an exact file name, no pattern matching.
# Would be easy to add to the [downloadArtifact method](https://github.com/actions/toolkit/blob/main/packages/artifact/src/internal/artifact-client.ts#L132) and thus expose to the action.
# But I'm not motifcated enough to push that through right now.
# with:
# name: /test-results_(.*)/

- name: Install NUnit
run: |
nuget install NUnit.Console -Version 3.12.0
shell: bash

- name: Transform NUnit3 to JUnit
run: |
Get-ChildItem . -Filter test-results_*.xml | Foreach-Object {
$xml = Resolve-Path $_.FullName
$output = Join-Path ($pwd) ($_.BaseName + '_junit.xml')
$xslt = New-Object System.Xml.Xsl.XslCompiledTransform;
$xslt.Load("nunit3-junit.xslt");
$xslt.Transform($xml, $output);
}
shell: pwsh

- uses: dorny/[email protected]
with:
artifact: /test-results_(.*)/
name: "NUnit Tests for $1"
path: "*.xml"
reporter: nunit
# artifact: /test-results_(.*)/
name: "NUnit tests for $1"
path: "*_junit.xml"
reporter: jest-junit

0 comments on commit 1631c40

Please sign in to comment.