forked from kabili207/zora-sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
60 lines (53 loc) · 3.05 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
version: 2.3.{build}
configuration: Debug
image: Visual Studio 2017
# environment variables
environment:
github_token:
secure: UTLYBi+fA9DfITcCNVwGyJw5MGEvXeawqBzd7U6q9agG5u5gTwIc7LxqdxAVWhSC
github_email:
secure: N1sJz+EugtLJ1e1jR232oYKnskaCKJlQHmL3EruztHE=
sonar_token:
secure: vTWxLNbvNn2Pyg2jicVTzMRsrs4n2avCvgJ6CNG8euQsB8+bHZDz1DUCE1GbnI9M
before_build:
- ps: >-
nuget restore ZoraSharp.sln;
if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
$git_hash = $env:APPVEYOR_REPO_COMMIT.Substring(0, 10);
choco install "msbuild-sonarqube-runner" -y;
SonarScanner.MSBuild.exe begin /k:"zora-sharp" /o:"kabili207-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$env:sonar_token" /v:"$git_hash" /d:sonar.branch.name="$env:APPVEYOR_REPO_BRANCH" /d:sonar.cs.nunit.reportsPaths="$env:APPVEYOR_BUILD_FOLDER\nunit-results.xml" /d:sonar.cs.opencover.reportsPaths="$env:APPVEYOR_BUILD_FOLDER\coverage.xml";
}
build:
project: ZoraSharp.sln
verbosity: minimal
test_script:
- nuget.exe install OpenCover -ExcludeVersion
- OpenCover\tools\OpenCover.Console.exe -register:user -target:nunit3-console.exe -targetargs:"test\bin\%CONFIGURATION%\ZoraSharp.Tests.dll --result=myresults.xml;format=AppVeyor --result=nunit-results.xml;format=nunit3" -returntargetcode -filter:"+[*]* -[ZoraSharp.Tests]* -[ZoraSharp]*Exception -[ZoraSharp]SimpleJson.* -[ZoraSharp]*.AssemblyDetail -[ZoraSharp]*.Attributes" -excludebyattribute:"*.ExcludeFromCodeCoverage*" -hideskipped:All -output:coverage.xml
- C:\Python36\python -m pip install codecov
- C:\Python36\python -m codecov -f "%APPVEYOR_BUILD_FOLDER%\coverage.xml" -X gcov
after_test:
- ps: >-
If (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
SonarScanner.MSBuild.exe end /d:sonar.login="$env:sonar_token"
}
If ($env:APPVEYOR_REPO_TAG -eq "true") {
echo "Building API documentation";
git config --global credential.helper store;
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:github_token):x-oauth-basic@github.com`n";
git config --global user.email "$($env:github_email)";
git config --global user.name "Amy Nagle";
git config --global core.safecrlf false;
git clone -q -b gh-pages --single-branch https://github.com/kabili207/zora-sharp.git doc;
$env:SHFBROOT = "$($env:APPVEYOR_BUILD_FOLDER)\EWSoftware.SHFB\Tools\";
nuget install EWSoftware.SHFB -ExcludeVersion;
nuget install EWSoftware.SHFB.NETFramework;
msbuild ZoraSharp.shfbproj /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Configuration=$env:CONFIGURATION;
7z a -tzip api_doc.zip $env:APPVEYOR_BUILD_FOLDER\doc\api-doc\*;
Invoke-WebRequest -Uri "https://img.shields.io/badge/docs-$($env:APPVEYOR_REPO_TAG_NAME)-blue.svg" -OutFile $env:APPVEYOR_BUILD_FOLDER\doc\api-doc\badge.svg;
git -C doc add api-doc;
git -C doc commit -m "Update API documentation for $($env:APPVEYOR_REPO_TAG_NAME)";
git -C doc push -q origin gh-pages;
}
artifacts:
- path: src\bin\$(configuration)\*.dll
- path: api_doc.zip