forked from manuc66/JsonSubTypes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
59 lines (49 loc) · 2.91 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
image: Visual Studio 2019
environment:
sonar_token:
secure: 4M8z89LHqy9Rho8Mi4i7V0Ajz/7kvDYolVFH2V0GjK5VO5dseuv2Dja/qmKbio1I
github_auth_token:
secure: XUib5rF8Uxwk7S2umtsFEQ9t5G0p/J3G3PNpWLZuNIyw/zNufLDCge8C6QJRTzQw
init:
- choco install opencover.portable
- choco install codecov
- choco install "sonarscanner-msbuild-net46" -y
- SET JAVA_HOME=C:\Program Files\Java\jdk11
- SET PATH=%JAVA_HOME%\bin;%PATH%
before_build:
- nuget restore
- ps: >-
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
SonarScanner.MSBuild.exe begin /k:"manuc66:JsonSubtypes" /d:"sonar.host.url=https://sonarcloud.io" /o:"manuc66-github" /d:"sonar.login=$env:sonar_token" /d:sonar.cs.opencover.reportsPaths=".\MyProject_coverage.xml" /d:sonar.cs.nunit.reportsPaths="nunitTestResult.xml" /d:"sonar.cpd.exclusions=**/*Tests.cs" /d:"sonar.language=cs" /d:"sonar.pullrequest.base=master" /d:"sonar.pullrequest.branch=$env:APPVEYOR_REPO_BRANCH" /d:"sonar.pullrequest.key=$env:APPVEYOR_PULL_REQUEST_NUMBER" /d:"sonar.pullrequest.provider=GitHub" /d:"sonar.pullrequest.github.repository=$env:APPVEYOR_REPO_NAME" /d:"sonar.github.oauth=$env:github_auth_token"
}
elseif ($env:APPVEYOR_REPO_BRANCH -eq "master") {
SonarScanner.MSBuild.exe begin /k:"manuc66:JsonSubtypes" /d:"sonar.host.url=https://sonarcloud.io" /o:"manuc66-github" /d:"sonar.login=$env:sonar_token" /d:sonar.cs.opencover.reportsPaths=".\MyProject_coverage.xml" /d:sonar.cs.nunit.reportsPaths="nunitTestResult.xml" /d:"sonar.cpd.exclusions=**/*Tests.cs" /d:"sonar.language=cs"
}
else {
SonarScanner.MSBuild.exe begin /k:"manuc66:JsonSubtypes" /d:"sonar.host.url=https://sonarcloud.io" /o:"manuc66-github" /d:"sonar.login=$env:sonar_token" /d:"sonar.branch.name=$env:APPVEYOR_REPO_BRANCH" /d:"sonar.branch.target=master" /d:sonar.cs.opencover.reportsPaths=".\MyProject_coverage.xml" /d:sonar.cs.nunit.reportsPaths="nunitTestResult.xml" /d:"sonar.cpd.exclusions=**/*Tests.cs" /d:"sonar.language=cs"
}
configuration: Release
nuget:
disable_publish_on_pr: true
build:
project: JsonSubTypes.sln
verbosity: minimal
test_script:
- dir /S JsonSubTypes\bin\Release
- dir /S JsonSubTypes.Tests\bin\Release
- OpenCover.Console.exe -register:admin -target:"nunit3-console.exe" -targetargs:".\JsonSubTypes.Tests\bin\Release\net46\JsonSubTypes.Tests.dll --result:nunitTestResult.xml" -filter:"+[JsonSubTypes*]* -[JsonSubTypes.Tests]*" -output:".\MyProject_coverage.xml"
- codecov -f "MyProject_coverage.xml"
after_test:
- ps: SonarScanner.MSBuild.exe end /d:"sonar.login=$env:sonar_token"
artifacts:
# pushing all *.nupkg files in build directory recursively
- path: 'JsonSubTypes\**\*.nupkg'
deploy:
- provider: NuGet
name: NuGet
server: https://www.nuget.org/api/v2/package
api_key:
secure: KEftXcKjdRt0b70WDraJBUSBxH8r8AmZ4r83q5ICF/IDCfulsg2ld/IIkFAGv+GR
artifact: /JsonSubTypes.*\.nupkg/
on:
branch: master