-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,44 @@ 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 | ||
env: | ||
DEBUG_GITHUB: ${{ toJSON(github.event) }} | ||
uses: dawidd6/[email protected] | ||
with: | ||
# 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. | ||
# name: /test-results_(.*)/ | ||
workflow_conclusion: completed | ||
workflow: ci.yml | ||
|
||
- 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 |