-
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathappveyor.yml
86 lines (76 loc) · 3.71 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
86
version: build.{build}
image: Visual Studio 2022
skip_tags: true
skip_commits:
files:
- .github/
- docs/
- misc/
- README.md
- LICENSE
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- SECURITY.md
environment:
github_access_token:
secure: gtEHCUmmDjYfrp/NEe2qUD77p+k9Hi9jN10WEi2lV9xuiO0nM4XQIKW4Im9B+XHC+D5KCWLBG/K+n0A0l0xviQgQkDl769/LVMbC2lsITjJdEa3twioBC2vtDzzmjhpM
init:
- cmd: git config --global core.autocrlf true
- cmd: setx IGNORE_NORMALISATION_GIT_HEAD_MOVE 1
- cmd: setx DOTNET_NO_WORKLOAD_UPDATE_NOTIFICATION 1
- cmd: setx DOTNET_CLI_TELEMETRY_OPTOUT 1
- cmd: setx DOTNET_NOLOGO 1
- cmd: RefreshEnv.cmd
- pwsh: Write-Host "Target branch is '$($env:APPVEYOR_REPO_BRANCH)'"
before_build:
- cmd: gitversion /output buildserver /verbosity Minimal
- pwsh: Write-Host "Building NBi version $($env:GitVersion_SemVer)"
- pwsh: |
. "$env:APPVEYOR_BUILD_FOLDER\github.ps1"
if (($env:APPVEYOR_REPO_BRANCH -eq "main") -and ($null -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)) {
$context = [PSCustomObject] @{
Id = $env:APPVEYOR_REPO_COMMIT
Owner = ($env:APPVEYOR_REPO_NAME -Split '/')[0]
Repository = ($env:APPVEYOR_REPO_NAME -Split '/')[1]
SecretToken = $env:github_access_token
}
foreach($id in ($context | Get-Commit-Associated-Pull-Requests)) {
$context.Id = $id
$context | Set-Pull-Request-Expected-Labels -Config '.github\conventional_commits_labels.json'
}
} else {
Write-Host 'Not a merge on main built on appveyor. Skipping mapping conventional commits and labels.'
}
build_script:
#- dotnet --info
- dotnet build NBi.sln -p:version="%GitVersion_SemVer%" -c Release /p:ContinuousIntegrationBuild=true --nologo
before_test:
- ps: .\install-roapi-for-testing.ps1
- ps: .\install-odbc-drivers-for-testing.ps1
# - ps: .\restore-database-for-testing.ps1
# - ps: .\restore-database-for-testing.ps1
test_script:
- pwsh: |
$ErrorActionPreference = "Stop"
dotnet test NBi.Testing.Core -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Threshold=10 /p:ThresholdType=line /p:CoverletOutput=../.coverage/coverage.NBi.Testing.Core.xml --test-adapter-path:. --logger:Appveyor --no-build --nologo
$globalTestResult = $LastExitCode
dotnet test NBi.Testing.GenbiL -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Threshold=10 /p:ThresholdType=line /p:Exclude=[DubUrl.Testing]* /p:CoverletOutput=../.coverage/coverage.NBi.Testing.GenbiL.xml --test-adapter-path:. --logger:Appveyor --no-build --nologo
$globalTestResult += $LastExitCode
dotnet test NBi.Testing.Xml -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Threshold=10 /p:ThresholdType=line /p:Exclude=[DubUrl.Testing]* /p:CoverletOutput=../.coverage/coverage.NBi.Testing.Xml.xml --test-adapter-path:. --logger:Appveyor --no-build --nologo
$globalTestResult += $LastExitCode
dotnet test NBi.Testing.Framework -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Threshold=10 /p:ThresholdType=line /p:CoverletOutput=../.coverage/coverage.NBi.Testing.Framework.xml --test-adapter-path:. --logger:Appveyor --no-build --nologo
$globalTestResult += $LastExitCode
if($globalTestResult -ne 0) { $host.SetShouldExit($globalTestResult) }
after_test:
- clone-extensions.cmd
- dotnet pack NBi.Extensibility -p:version="%GitVersion_SemVer%" -c Release --include-symbols --no-build --nologo
- dotnet pack NBi.Framework -p:version="%GitVersion_SemVer%" -c Release --include-symbols --no-build --nologo
artifacts:
- path: '**\*.nupkg'
- path: '**\*.snupkg'
deploy:
- provider: NuGet
api_key:
secure: 4QlvXCPZjlS9KZY9jzLAMNKJ06C0JYXTsIbTFddgCiiC8apCgIW4MX+fcPf3wxhh
on:
branch: main