-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
148 lines (135 loc) · 6.69 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
version: build.{build}
image: Visual Studio 2022
branches:
except:
- /v\d+\.\d+\.\d+/
skip_commits:
files:
- .github/
- docs/
- misc/
- README.md
- LICENSE
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- SECURITY.md
environment:
github_access_token:
secure: gtEHCUmmDjYfrp/NEe2qUPjZi9gXoSgzYTNEmN99fCWp7qp4tXhVSPhzutj2WATjNqlFChFx1vcvFZtiq9C9vVjJ/lcmp/b0paF+W9V0xqScKMrkYQmCrA/glUq4XOae
SINGLESTORE_LICENSE:
secure: CnPDQsQ/dDximcta5iMng/QKahXstSQpENsXCHiDd9JbPfkYTRn8GgXsAcYQgrHKtnsA+FDAO85fxfHXyb2tmrLjJupAMKA14t58y7D0ePpeIs6ZRGu8MCQkSLk9cuiGFQeRSOxoH9gUkVPQU30M3n9+HY8gVvasxanUsWH+HWhwrl9+4gr7D8SGx4ZB4rUyEZ8vQGUw0uHerbaImkQk9Q==
init:
- cmd: git config --global core.autocrlf true
- cmd: setx IGNORE_NORMALISATION_GIT_HEAD_MOVE "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 DubUrl 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 DubUrl.sln -p:version="%GitVersion_SemVer%" -c Release /p:ContinuousIntegrationBuild=true --nologo
test_script:
- pwsh: |
$ErrorActionPreference = "Stop"
dotnet test DubUrl.Testing -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Threshold=10 /p:ThresholdType=line /p:CoverletOutput=../.coverage/coverage.DubUrl.xml --test-adapter-path:. --logger:Appveyor --no-build --nologo
$globalTestResult = $LastExitCode
dotnet test DubUrl.OleDb.Testing -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Threshold=10 /p:ThresholdType=line /p:Exclude=[DubUrl.Testing]* /p:CoverletOutput=../.coverage/coverage.DubUrl.OleDb.xml --test-adapter-path:. --logger:Appveyor --no-build --nologo
$globalTestResult += $LastExitCode
dotnet test DubUrl.Adomd.Testing -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Threshold=10 /p:ThresholdType=line /p:Exclude=[DubUrl.Testing]* /p:CoverletOutput=../.coverage/coverage.DubUrl.Adomd.xml --test-adapter-path:. --logger:Appveyor --no-build --nologo
$globalTestResult += $LastExitCode
dotnet test DubUrl.Extensions.Testing -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Threshold=10 /p:ThresholdType=line /p:CoverletOutput=../.coverage/coverage.DubUrl.Extensions.xml --test-adapter-path:. --logger:Appveyor --no-build --nologo
$globalTestResult += $LastExitCode
if($globalTestResult -ne 0) { $host.SetShouldExit($globalTestResult) }
- pwsh: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile codecov.exe
.\codecov.exe --dir "./.coverage/"
- pwsh: |
$force = ($env:APPVEYOR_REPO_BRANCH -eq "main") #Valid for a Pull Request or a Commit on main
& .\DubUrl.QA\deploy-test-harness.ps1 -force:$force -config "Release" -frameworks @("net6.0") -exclude @("CockRoach", "Drill", "Trino", "PowerBIDesktop", "SsasMultdim", "SsasTabular", "SingleStore", "CrateDB")
if ($lastexitcode -gt 0) {
throw "At least one of the test-suite was not successful. Build stopped."
}
after_test:
- dotnet pack DubUrl.Core -p:version="%GitVersion_SemVer%" -c Release --include-symbols --no-build --nologo
- dotnet pack DubUrl.OleDb -p:version="%GitVersion_SemVer%" -c Release --include-symbols --no-build --nologo
- dotnet pack DubUrl.Extensions -p:version="%GitVersion_SemVer%" -c Release --include-symbols --no-build --nologo
- dotnet pack DubUrl.Adomd -p:version="%GitVersion_SemVer%" -c Release --include-symbols --no-build --nologo
artifacts:
- path: '**\*.nupkg'
- path: '**\*.snupkg'
deploy:
- provider: NuGet
api_key:
secure: WulUiguCSzi1ZCQHZxmpdhP/FMMifFhjqvSZRK7QiT0vLrJeaN1P3mZLB5lyPHvz
skip_symbols: false
artifact: /.*(\.|\.s)nupkg/
on:
branch: main
on_success:
- pwsh: |
. "$env:APPVEYOR_BUILD_FOLDER\github.ps1"
if (($env:APPVEYOR_REPO_BRANCH -eq "main") -and ($null -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)) {
if ($env:GitVersion_Patch -eq '0' -or $env:GitVersion_Patch -eq 0) {
$context = [PSCustomObject] @{
Owner = ($env:APPVEYOR_REPO_NAME -Split '/')[0]
Repository = ($env:APPVEYOR_REPO_NAME -Split '/')[1]
SecretToken = $env:github_access_token
}
if (-not ($context | Check-Release-Published -Tag "v$($env:GitVersion_SemVer)")) {
$context | Publish-Release `
-Tag "v$($env:GitVersion_SemVer)" `
-Name "$(($env:APPVEYOR_REPO_NAME -Split '/')[1]) $($env:GitVersion_SemVer)" `
-ReleaseNotes `
-DiscussionCategory 'Announcements'
}
} else {
Write-Host "No release published on GitHub when patch is not set to zero."
}
} else {
Write-Host "No release published on GitHub when not on branch main."
}
- pwsh: |
& .\generate-adonet-info.ps1
$exitCode = $LastExitCode
& .\generate-odbc-driver-info.ps1
$exitCode += $LastExitCode
& .\generate-oledb-provider-info.ps1
$exitCode += $LastExitCode
& .\generate-adomd-info.ps1
$exitCode += $LastExitCode
if ($exitCode -gt 0) {
Write-Host "`tUpdating README.md ..."
& .\generate-table-scheme.ps1
& .\generate-badge.ps1
Write-Host "`tSetting GitHub credentials ..."
& git config --global credential.helper store
Set-Content -Path "$HOME\.git-credentials" -Value "https://Seddryck:$($env:github_access_token)@github.com`n" -NoNewline
& git config --global user.email "no-reply@nbiguity.io"
& git config --global user.name "AppVeyor bot"
Write-Host "`tCreating commit ..."
& git add --all
& git status
& git pull
& git commit -m "docs: update automatically generated documentation"
Write-Host "`tPushing commit ..."
& git push origin
Write-Host "`tNew commit uploaded."
}