Skip to content

Commit 0488622

Browse files
Use generic analyzer report directories
1 parent 4b7d949 commit 0488622

4 files changed

Lines changed: 16 additions & 10 deletions

File tree

.github/workflows/Action-Test.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ jobs:
150150
tests/Assert-ReportPaths.ps1 `
151151
-WorkingDirectory tests/srcTestRepo `
152152
-TestResultPath .PSModule/Explicit/TestResult.xml `
153-
-CodeCoveragePath .PSModule/Explicit/CodeCoverage.xml
153+
-CodeCoveragePath .PSModule/Explicit/CodeCoverage.xml `
154+
-ArtifactDirectory .PSModule
154155
155156
ActionTestDefaultReportPaths:
156157
name: Action-Test - [Default Report Paths]
@@ -178,8 +179,9 @@ jobs:
178179
run: |
179180
tests/Assert-ReportPaths.ps1 `
180181
-WorkingDirectory tests/srcTestRepo `
181-
-TestResultPath .PSModule/TestResult/PSScriptAnalyzer-TestResult-Report.xml `
182-
-CodeCoveragePath .PSModule/CodeCoverage/PSScriptAnalyzer-CodeCoverage-Report.xml
182+
-TestResultPath reports/TestResult/PSScriptAnalyzer-TestResult-Report.xml `
183+
-CodeCoveragePath reports/CodeCoverage/PSScriptAnalyzer-CodeCoverage-Report.xml `
184+
-ArtifactDirectory reports
183185
184186
ActionTestOutputs:
185187
name: Action-Test - [outputs]

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,12 @@ customize rule selection, severity filtering, and custom rule inclusion.
6969
| `TestRegistry_Enabled` | Enable TestRegistry. | false | |
7070

7171
The default report paths match the `Invoke-Pester` filename convention while
72-
using `.PSModule` to keep generated files out of the repository root:
72+
using generic `reports` directories to keep generated files out of the
73+
repository root:
7374

7475
```text
75-
TestResult_OutputPath: .PSModule/TestResult/PSScriptAnalyzer-TestResult-Report.xml
76-
CodeCoverage_OutputPath: .PSModule/CodeCoverage/PSScriptAnalyzer-CodeCoverage-Report.xml
76+
TestResult_OutputPath: reports/TestResult/PSScriptAnalyzer-TestResult-Report.xml
77+
CodeCoverage_OutputPath: reports/CodeCoverage/PSScriptAnalyzer-CodeCoverage-Report.xml
7778
```
7879

7980
## Outputs

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ inputs:
110110
description: |
111111
Path relative to the current directory where code coverage report is saved.
112112
required: false
113-
default: .PSModule/CodeCoverage/PSScriptAnalyzer-CodeCoverage-Report.xml
113+
default: reports/CodeCoverage/PSScriptAnalyzer-CodeCoverage-Report.xml
114114
CodeCoverage_OutputEncoding:
115115
description: |
116116
Encoding of the output file.
@@ -151,7 +151,7 @@ inputs:
151151
description: |
152152
Path relative to the current directory where test result report is saved.
153153
required: false
154-
default: .PSModule/TestResult/PSScriptAnalyzer-TestResult-Report.xml
154+
default: reports/TestResult/PSScriptAnalyzer-TestResult-Report.xml
155155
TestResult_OutputEncoding:
156156
description: |
157157
Encoding of the output file.

tests/Assert-ReportPaths.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ param(
77
[string] $TestResultPath,
88

99
[Parameter(Mandatory)]
10-
[string] $CodeCoveragePath
10+
[string] $CodeCoveragePath,
11+
12+
[Parameter(Mandatory)]
13+
[string] $ArtifactDirectory
1114
)
1215

1316
function Assert-ReportPath {
@@ -51,7 +54,7 @@ function Assert-ReportPath {
5154
}
5255

5356
$resolvedWorkingDirectory = [System.IO.Path]::GetFullPath($WorkingDirectory)
54-
$artifactDirectory = Join-Path -Path $resolvedWorkingDirectory -ChildPath '.PSModule'
57+
$artifactDirectory = Join-Path -Path $resolvedWorkingDirectory -ChildPath $ArtifactDirectory
5558

5659
Assert-ReportPath -Path (Join-Path -Path $resolvedWorkingDirectory -ChildPath $TestResultPath) `
5760
-ReportName 'test result' `

0 commit comments

Comments
 (0)