-
Notifications
You must be signed in to change notification settings - Fork 7
/
appveyor.yml
67 lines (60 loc) · 1.95 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
61
62
63
64
65
66
67
version: 1.1.{build}
image: Visual Studio 2019
branches:
only:
- master
pull_requests:
do_not_increment_build_number: true
configuration: Release
shallow_clone: true
skip_commits:
files:
- '**/*.yml'
- '**/*.md'
- .gitignore
- .editorconfig
message: /updated readme.*|update readme.*s|update docs.*|update version.*|update changelog.*/
init:
- cmd: dotnet --version
- ps: 'if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & dotnet tool install -g dotnet-sonarscanner }'
- cmd: dotnet tool install -g minicover
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: '{version}'
package_version: '{version}'
assembly_version: '{version}'
file_version: '{version}'
informational_version: '{version}'
nuget:
project_feed: true
before_build:
- dotnet restore
build_script:
# Ensure Java 11, required by Sonar
- set JAVA_HOME=C:\Program Files\Java\jdk11
- set PATH=%JAVA_HOME%\bin;%PATH%
# Begin SonarScanner
- ps: 'if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & dotnet sonarscanner begin /k:"Moq.ILogger" /o:adrianiftode-github /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$env:SONAR_TOKEN" /v:"$env:APPVEYOR_BUILD_NUMBER" /d:sonar.cs.opencover.reportsPaths="opencovercoverage.xml" /d:sonar.coverage.exclusions=test/**}'
- dotnet build
- minicover instrument
test_script:
- dotnet test --no-restore --no-build
after_test:
- minicover uninstrument
- minicover opencoverreport
# will fail when the test coverage is lower than the threshold
- minicover report --threshold 90
- ps: 'if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & dotnet sonarscanner end /d:sonar.login="$env:SONAR_TOKEN" }'
- dotnet pack --no-restore --include-symbols -c %CONFIGURATION%
artifacts:
- path: '**\*.nupkg'
name: NuGet
deploy:
- provider: NuGet
api_key:
secure: O+eAN9xt6vbmeNTfpqoQ5c64xbzUCXrZXhJU6/3Vw9BvSn747F9PH5tFtuxEqLTA
skip_symbols: true
artifact: /.*\.nupkg/
on:
branch: master