refactor: make this a valid nuget package for Powershell gallery
feat: add build environment scripts
This commit is contained in:
parent
69c2684ee7
commit
46b1b7c83f
38 changed files with 200 additions and 42 deletions
BIN
scripts/._analyze.ps1
Executable file
BIN
scripts/._analyze.ps1
Executable file
Binary file not shown.
BIN
scripts/._clean.ps1
Executable file
BIN
scripts/._clean.ps1
Executable file
Binary file not shown.
BIN
scripts/._test.ps1
Executable file
BIN
scripts/._test.ps1
Executable file
Binary file not shown.
16
scripts/analyze.ps1
Executable file
16
scripts/analyze.ps1
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
#! /usr/bin/pwsh
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$ErrorView = "NormalView"
|
||||
|
||||
$basePath = Join-Path $PSScriptRoot '..'
|
||||
|
||||
Import-Module PSScriptAnalyzer -ErrorAction Stop -Force
|
||||
|
||||
Invoke-ScriptAnalyzer `
|
||||
-Path (Join-Path -Path $basePath 'src') `
|
||||
-Settings PSGallery `
|
||||
-Recurse
|
||||
22
scripts/clean.ps1
Executable file
22
scripts/clean.ps1
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#! /usr/bin/pwsh
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$ErrorView = "NormalView"
|
||||
|
||||
$basePath = Join-Path $PSScriptRoot '..'
|
||||
|
||||
@(
|
||||
'dist',
|
||||
'test-reports'
|
||||
) | ForEach {
|
||||
$path = Join-Path $basePath $_
|
||||
|
||||
If (-Not (Test-Path $path)) {return}
|
||||
|
||||
Write-Host "rm: $(Resolve-Path $path)"
|
||||
|
||||
Remove-Item -Recurse -Force ($path)
|
||||
}
|
||||
12
scripts/pack.ps1
Executable file
12
scripts/pack.ps1
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#! /usr/bin/pwsh
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$ErrorView = "NormalView"
|
||||
|
||||
$basePath = Join-Path $PSScriptRoot '..'
|
||||
|
||||
nuget pack (Join-Path $basePath 'PSConfluencePublisher.nuspec') `
|
||||
-OutputDirectory (Join-Path $basePath 'dist')
|
||||
36
scripts/test.ps1
Executable file
36
scripts/test.ps1
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
#! /usr/bin/pwsh
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$ErrorView = "NormalView"
|
||||
|
||||
Import-Module Pester -ErrorAction Stop -Force
|
||||
|
||||
Invoke-Pester -Configuration @{
|
||||
'Debug' = @{
|
||||
'ShowFullErrors' = $false
|
||||
'ShowNavigationMarkers' = $false
|
||||
'WriteDebugMessagesFrom' = 'CodeCoverage'
|
||||
}
|
||||
'Output' = @{
|
||||
'Verbosity' = 'Normal'
|
||||
}
|
||||
'Run' = @{
|
||||
'Path' = Join-Path $PSScriptRoot '..' 'tests' '*'
|
||||
'Exit' = $true
|
||||
'PassThru' = $true
|
||||
}
|
||||
'CodeCoverage' = @{
|
||||
'Enabled' = $true
|
||||
'Path' = Join-Path $PSScriptRoot '..' 'src' '*'
|
||||
'OutputPath' = Join-Path $PSScriptRoot '..' 'test-reports' `
|
||||
'coverage.xml'
|
||||
}
|
||||
'TestResult' = @{
|
||||
'Enabled' = $true
|
||||
'OutputPath' = Join-Path $PSScriptRoot '..' 'test-reports' 'testResults.xml'
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue