forked from dsccommunity/FailoverClusterDsc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added CodeCov and opt-in for all common tests (issue dsccommunity#41). - Fixed typo in README.md.
- Loading branch information
Showing
4 changed files
with
54 additions
and
51 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
codecov: | ||
notify: | ||
require_ci_to_pass: no | ||
|
||
comment: | ||
layout: "reach, diff" | ||
behavior: default | ||
|
||
coverage: | ||
range: 50..80 | ||
round: down | ||
precision: 0 | ||
|
||
status: | ||
project: | ||
default: | ||
# Set the overall project code coverage requirement to 70% | ||
target: 70 | ||
patch: | ||
default: | ||
# Set the pull request requirement to not regress overall coverage by more than 5% | ||
# and let codecov.io set the goal for the code changed in the patch. | ||
target: auto | ||
threshold: 5 |
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,4 @@ | ||
DSCResource.Tests | ||
.vs | ||
.vscode | ||
node_modules |
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 |
---|---|---|
@@ -1,63 +1,37 @@ | ||
#---------------------------------# | ||
# environment configuration # | ||
#---------------------------------# | ||
#---------------------------------# | ||
# environment configuration # | ||
#---------------------------------# | ||
version: 1.6.{build}.0 | ||
install: | ||
install: | ||
- git clone https://github.com/PowerShell/DscResource.Tests | ||
|
||
- ps: | | ||
Import-Module -Name .\DscResource.Tests\TestHelper.psm1 -Force | ||
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | ||
Install-Module -Name Pester -Repository PSGallery -Force | ||
Import-Module -Name "$env:APPVEYOR_BUILD_FOLDER\DscResource.Tests\AppVeyor.psm1" | ||
Invoke-AppveyorInstallTask | ||
#---------------------------------# | ||
# build configuration # | ||
#---------------------------------# | ||
#---------------------------------# | ||
# build configuration # | ||
#---------------------------------# | ||
|
||
build: false | ||
|
||
#---------------------------------# | ||
# test configuration # | ||
#---------------------------------# | ||
#---------------------------------# | ||
# test configuration # | ||
#---------------------------------# | ||
|
||
test_script: | ||
- ps: | | ||
$testResultsFile = ".\TestsResults.xml" | ||
$res = Invoke-Pester -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru | ||
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile)) | ||
if ($res.FailedCount -gt 0) { | ||
throw "$($res.FailedCount) tests failed." | ||
} | ||
#---------------------------------# | ||
# deployment configuration # | ||
#---------------------------------# | ||
|
||
# scripts to run before deployment | ||
deploy_script: | ||
Invoke-AppveyorTestScriptTask -CodeCoverage -CodeCovIo -ExcludeTag @() | ||
#---------------------------------# | ||
# deployment configuration # | ||
#---------------------------------# | ||
|
||
# scripts to run before deployment | ||
deploy_script: | ||
- ps: | | ||
# Creating project artifact | ||
$stagingDirectory = (Resolve-Path ..).Path | ||
$manifest = Join-Path $pwd "xFailOverCluster.psd1" | ||
(Get-Content $manifest -Raw).Replace("1.6.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest | ||
$zipFilePath = Join-Path $stagingDirectory "$(Split-Path $pwd -Leaf).zip" | ||
Add-Type -assemblyname System.IO.Compression.FileSystem | ||
[System.IO.Compression.ZipFile]::CreateFromDirectory($pwd, $zipFilePath) | ||
# Creating NuGet package artifact | ||
New-Nuspec -packageName $env:APPVEYOR_PROJECT_NAME -version $env:APPVEYOR_BUILD_VERSION -author "Microsoft" -owners "Microsoft" -licenseUrl "https://github.com/PowerShell/DscResources/blob/master/LICENSE" -projectUrl "https://github.com/$($env:APPVEYOR_REPO_NAME)" -packageDescription $env:APPVEYOR_PROJECT_NAME -tags "DesiredStateConfiguration DSC DSCResourceKit" -destinationPath . | ||
nuget pack ".\$($env:APPVEYOR_PROJECT_NAME).nuspec" -outputdirectory . | ||
$nuGetPackageName = $env:APPVEYOR_PROJECT_NAME + "." + $env:APPVEYOR_BUILD_VERSION + ".nupkg" | ||
$nuGetPackagePath = (Get-ChildItem $nuGetPackageName).FullName | ||
@( | ||
# You can add other artifacts here | ||
$zipFilePath, | ||
$nuGetPackagePath | ||
) | % { | ||
Write-Host "Pushing package $_ as Appveyor artifact" | ||
Push-AppveyorArtifact $_ | ||
} | ||
Invoke-AppveyorAfterTestTask | ||