test: update appveyor.test.ps1
This commit is contained in:
parent
4cd8d6c9f4
commit
f7d0ae0f49
|
@ -51,26 +51,27 @@ if ("$($env:APPVEYOR_REPO_BRANCH)" -eq "master") {
|
||||||
if ("$($env:APPVEYOR_REPO_PROVIDER)" -eq "gitHub") {
|
if ("$($env:APPVEYOR_REPO_PROVIDER)" -eq "gitHub") {
|
||||||
coverallUnitTest
|
coverallUnitTest
|
||||||
}
|
}
|
||||||
elseif ("$($env:APPVEYOR_REPO_PROVIDER)" -eq "gitLab") {
|
|
||||||
coverallUnitTest
|
|
||||||
|
|
||||||
Set-AppveyorBuildVariable COVERALLS_REPO_TOKEN $($env:COVERALLS_REPO_TOKEN_GITLAB)
|
|
||||||
Set-AppveyorBuildVariable CODECOV_TOKEN $($env:CODECOV_TOKEN_GITLAB)
|
|
||||||
|
|
||||||
$codecovCmd = "C:\ProgramData\chocolatey\lib\codecov\tools\codecov.exe"
|
|
||||||
$codecov = Test-Path $codecovCmd
|
|
||||||
if (!$codecov) {
|
|
||||||
write-host "install codecov tools" -ForegroundColor Cyan
|
|
||||||
choco install codecov
|
|
||||||
}
|
|
||||||
cmd.exe /c "$codecovCmd -f ""coverage.opencover.xml"""
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
write-warning "Coveralls has been skipped because current provider is ""$($env:APPVEYOR_REPO_PROVIDER)"""
|
write-warning "Coveralls has been skipped because current provider is ""$($env:APPVEYOR_REPO_PROVIDER)"""
|
||||||
write-host "dotnet test UnitTest without Coveralls" -ForegroundColor Cyan
|
write-host "dotnet test UnitTest without Coveralls" -ForegroundColor Cyan
|
||||||
dotnet test UnitTest --no-restore
|
dotnet test UnitTest --no-restore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elseif ("$($env:APPVEYOR_REPO_PROVIDER)" -eq "gitLab") {
|
||||||
|
installDB
|
||||||
|
coverallUnitTest
|
||||||
|
|
||||||
|
Set-AppveyorBuildVariable COVERALLS_REPO_TOKEN $($env:COVERALLS_REPO_TOKEN_GITLAB)
|
||||||
|
Set-AppveyorBuildVariable CODECOV_TOKEN $($env:CODECOV_TOKEN_GITLAB)
|
||||||
|
|
||||||
|
$codecovCmd = "C:\ProgramData\chocolatey\lib\codecov\tools\codecov.exe"
|
||||||
|
$codecov = Test-Path $codecovCmd
|
||||||
|
if (!$codecov) {
|
||||||
|
write-host "install codecov tools" -ForegroundColor Cyan
|
||||||
|
choco install codecov
|
||||||
|
}
|
||||||
|
cmd.exe /c "$codecovCmd -f ""coverage.opencover.xml"""
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
write-warning "UnitTest has been skipped because current branch is ""$($env:APPVEYOR_REPO_BRANCH)"""
|
write-warning "UnitTest has been skipped because current branch is ""$($env:APPVEYOR_REPO_BRANCH)"""
|
||||||
}
|
}
|
Loading…
Reference in New Issue