加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.appveyor.yml 2.65 KB
一键复制 编辑 原始数据 按行查看 历史
version: 1.0.{build}
image: Visual Studio 2017
configuration: Debug
platform: Any CPU
environment:
AUTOUPDATER_Duplicati_SKIP_UPDATE: 1
COVERALLS_REPO_TOKEN:
secure: szQsrkP5rvra8L60SomD73/dFvRwot0UuyA566zqzI2qmLOr+MhLN0AyC8BTbhYY
before_build:
- ps: $env:UNITTEST_BASEFOLDER = "$Env:APPVEYOR_BUILD_FOLDER" + "\testdata"
- cmd: nuget restore Duplicati.sln
build:
project: Duplicati.sln
verbosity: minimal
test_script:
- ps: |
nuget install OpenCover -Version 4.7.922 -OutputDirectory packages
nuget install coveralls.net -Version 0.7.0 -OutputDirectory packages
nuget install NUnit.Runners -Version 3.10.0 -OutputDirectory packages
$testDir = ".\Duplicati\UnitTest\bin\Debug"
$tests = @("$testDir\Duplicati.UnitTest.dll")
$testsPassed = $true
foreach ($elem in $tests) {
$testResultsFile = "$elem" + ".xml"
.\packages\OpenCover.4.7.922\tools\OpenCover.Console.exe `
-register:user `
-target:.\packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe `
"-targetargs:""$elem"" /where:cat!=BulkData /result:""$testResultsFile""" `
"-filter:+[Duplicati.Library.Main]* -[UnitTest]*" `
-output:opencover.xml `
-returntargetcode `
# Keep track of test failures so that we can throw an exception after
# uploading coverage and test results.
$testsPassed = $testsPassed -and $?
# Upload test results to AppVeyor.
$wc = New-Object "System.Net.WebClient"
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\""$testResultsFile""))
}
if ($Env:COVERALLS_REPO_TOKEN) {
$revision = git rev-parse HEAD
$branch = git rev-parse --abbrev-ref HEAD
$commitAuthor = git show --quiet --format="%aN" $revision
$commitEmail = git show --quiet --format="%aE" $revision
$commitMessage = git show --quiet --format="%s" $revision
.\packages\coveralls.net.0.7.0\tools\csmacnz.Coveralls.exe `
--opencover -i opencover.xml `
--repoToken "$Env:COVERALLS_REPO_TOKEN" `
--commitId "$revision" `
--commitBranch "$branch" `
--commitAuthor "$commitAuthor" `
--commitEmail "$commitEmail" `
--commitMessage "$commitMessage" `
--useRelativePaths `
--basePath .\Duplicati\UnitTest\bin\Debug
}
if (!$testsPassed) {
throw "Tests failed."
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化