-
Notifications
You must be signed in to change notification settings - Fork 7
/
appveyor.yml
85 lines (79 loc) · 2.96 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
version: 1.8.0-ci-{build}
image: Visual Studio 2022
branches:
only:
- master
- /\d+\.\d+\.\d+/
pull_requests:
do_not_increment_build_number: false
skip_branch_with_pr: true
configuration: Release
shallow_clone: true
skip_commits:
files:
- '**/*.md'
- .gitignore
- .editorconfig
- samples/**/*
message: /.*skip\sci.*/
init:
- cmd: dotnet --version
- ps: |
if ($env:APPVEYOR_REPO_TAG -eq "true")
{
try
{
Update-AppveyorBuild -Version "$env:APPVEYOR_REPO_TAG_NAME"
}
catch
{
Write-Output "Update-AppveyorBuild Fail to change version to TAG: '$env:APPVEYOR_REPO_TAG_NAME'" -ForegroundColor Red
Write-Output "Exception Error: $PSItem.Exception.Message" -ForegroundColor Red
Write-Output "Exception Error: $PSItem.Exception.GetType().Name" -ForegroundColor Red
}
}
- ps: |
Write-Host "APPVEYOR_BUILD_VERSION='$env:APPVEYOR_BUILD_VERSION'" -ForegroundColor Yellow
Write-Host "APPVEYOR_REPO_TAG_NAME= '$env:APPVEYOR_REPO_TAG_NAME'" -ForegroundColor Yellow
- ps: 'if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & dotnet tool install -g dotnet-sonarscanner }'
- cmd: dotnet tool install -g minicover
nuget:
project_feed: true
before_build:
- dotnet restore
build_script:
# Begin SonarScanner
# Ensure Java 15, required by Sonar
- set JAVA_HOME=C:\Program Files\Java\jdk19
- if not exist "%JAVA_HOME%\bin\java.exe" (echo "%JAVA_HOME%\bin\java.exe does not exist" && exit 1)
- set PATH=%JAVA_HOME%\bin;%PATH%
- ps: 'if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & dotnet sonarscanner begin /k:"adrianiftode_FluentAssertions.Web" /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 -c %CONFIGURATION% /p:Version=%APPVEYOR_BUILD_VERSION%
- minicover instrument
test_script:
- dotnet test --no-restore --no-build --nologo --verbosity:q
after_test:
- minicover uninstrument
- minicover opencoverreport
# will fail when the test coverage is lower than the threshold
- minicover report --threshold 95
- ps: 'if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & dotnet sonarscanner end /d:sonar.login="$env:SONAR_TOKEN" }'
- dotnet pack --no-build --include-symbols -c %CONFIGURATION% /p:PackageVersion=%APPVEYOR_BUILD_VERSION%
artifacts:
- path: '**\*.nupkg'
name: NuGet
deploy:
- provider: NuGet
api_key:
secure: aHT1IlqkfTAZm236Pkjt84NdjfEIrPJqJt4IwO5QNvH0LpIWqx/L3oFRewdCwCQs
skip_symbols: true
artifact: /.*\.nupkg/
on:
appveyor_repo_tag: true
- provider: GitHub
release: $(APPVEYOR_BUILD_VERSION)
auth_token:
secure: WXU/Xj3ntIZVx89KDAa/V5km1nhPI924T8G9u8c/i2LBSegKtLVV2pJjfUFvNYFEQ2j6adP4YkP6AgotppXNcFVQ/uvEfx2TY304k+FzkQpRwIfxBZantESXUKIC6aa5
artifact: /.*\.nupkg/
on:
appveyor_repo_tag: true