generated from ebekker/pwsh-github-action-base
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from natescherer/feature/code-coverage
Code Coverage
- Loading branch information
Showing
8 changed files
with
774 additions
and
7 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
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
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
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
[CmdletBinding()] | ||
param( | ||
[Parameter(Mandatory)] | ||
[string]$mdFile | ||
) | ||
|
||
$mdData = Get-Content -Path $mdFile | ||
|
||
$outputData = @() | ||
foreach ($line in $mdData) { | ||
if ($line -like "- Line #*") { | ||
$linePrefix = $line.Split("|")[0] | ||
$lineNumber = $linePrefix.Split("#")[1] | ||
$arrayLineNumber = $lineNumber - 1 | ||
|
||
$filePath = $line.Split("|")[1] | ||
if ($IsWindows -or $PSVersionTable.PSVersion.Major -le 5) { | ||
$filePath = $filePath.Replace("/","\") | ||
} | ||
$workspaceFiles = Get-ChildItem -Path "$env:GITHUB_WORKSPACE" -Recurse -File | ||
$resolvedFilePath = $workspaceFiles | Where-Object {$_.FullName -like "*$filePath"} | ||
$fileContents = Get-Content -Path $resolvedFilePath | ||
$missedLine = $fileContents[$arrayLineNumber] | ||
|
||
$outputData += $linePrefix | ||
$outputData += "``````" | ||
$outputData += $missedLine | ||
$outputData += "``````" | ||
|
||
} | ||
else { | ||
$outputData += $line | ||
} | ||
} | ||
|
||
Set-Content -Value $outputData -Path $mdFile |
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 |
---|---|---|
@@ -0,0 +1,98 @@ | ||
|
||
# Coverage Report: Pester (04/16/2021 11:51:47) | ||
|
||
* Pester (04/16/2021 11:51:47) | ||
|
||
Outcome: 98.43% Coverage | ||
| Lines Covered: 191 | ||
| Lines Missed: 3 | ||
|
||
## Details: | ||
|
||
|
||
### src | ||
|
||
<details> | ||
<summary> | ||
:x: ChangelogManagement.psm1 | ||
</summary> | ||
|
||
#### Lines Missed: | ||
- Line #4 | ||
``` | ||
. $PrivateFile.FullName | ||
``` | ||
</details> | ||
|
||
|
||
### src/public | ||
|
||
<details> | ||
<summary> | ||
:heavy_check_mark: Add-ChangelogData.ps1 | ||
</summary> | ||
|
||
#### All Lines Covered! | ||
</details> | ||
|
||
|
||
|
||
<details> | ||
<summary> | ||
:heavy_check_mark: ConvertFrom-Changelog.ps1 | ||
</summary> | ||
|
||
#### All Lines Covered! | ||
</details> | ||
|
||
|
||
|
||
<details> | ||
<summary> | ||
:heavy_check_mark: Get-ChangelogData.ps1 | ||
</summary> | ||
|
||
#### All Lines Covered! | ||
</details> | ||
|
||
|
||
|
||
<details> | ||
<summary> | ||
:heavy_check_mark: New-Changelog.ps1 | ||
</summary> | ||
|
||
#### All Lines Covered! | ||
</details> | ||
|
||
|
||
|
||
<details> | ||
<summary> | ||
:x: Update-Changelog.ps1 | ||
</summary> | ||
|
||
#### Lines Missed: | ||
- Line #79 | ||
``` | ||
throw "You must be running in GitHub Actions to use GitHub LinkMode" | ||
``` | ||
- Line #89 | ||
``` | ||
throw "You must be running in Azure Pipelines to use AzureDevOps LinkMode" | ||
``` | ||
</details> | ||
|
||
|
Oops, something went wrong.