-
-
Notifications
You must be signed in to change notification settings - Fork 70
260 lines (219 loc) · 7.56 KB
/
tests.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
name: Tests
on:
push:
branches: [ main ]
paths-ignore:
- '**/*.md'
pull_request:
branches: [ main ]
jobs:
coverage:
name: Coverage
runs-on: ubuntu-latest
services:
clickhouse:
image: clickhouse/clickhouse-server:latest
ports:
- 8123:8123
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/cache@v3
name: Cache NuGet
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Checkout main
uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request' }}
with:
ref: main
path: main
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.x
- name: Install pycobertura
run: pip install pycobertura
- name: Install coverlet-collector
run: dotnet add ClickHouse.Client.Tests/ClickHouse.Client.Tests.csproj package coverlet.collector --no-restore
- name: Install coverlet-msbuild
run: dotnet add ClickHouse.Client.Tests/ClickHouse.Client.Tests.csproj package coverlet.msbuild --no-restore
- name: Install GitHubActionsTestLogger
run: dotnet add ClickHouse.Client.Tests/ClickHouse.Client.Tests.csproj package GitHubActionsTestLogger --no-restore
- name: Test with coverage
run: dotnet test --framework net6.0 --configuration Release --verbosity normal --logger GitHubActions /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:SkipAutoProps=true
env:
CLICKHOUSE_CONNECTION: Host=localhost;Port=8123
- run: mv ./ClickHouse.Client.Tests/coverage.net6.0.cobertura.xml ./coverage.cobertura.xml
- name: Upload coverage xml
if: always()
uses: actions/upload-artifact@v3
with:
name: coverage
path: ./coverage.cobertura.xml
- name: Download 'main' coverage
if: ${{ github.event_name == 'pull_request' }}
uses: benday-inc/download-latest-artifact@main
with:
token: ${{ github.token }}
repository_owner: ${{ github.repository_owner }}
repository_name: ClickHouse.Client
workflow_name: ${{ github.workflow }}
branch_name: main
artifact_name: coverage
download_path: ${{ github.workspace }}/main/ClickHouse.Client
download_filename: coverage.zip
- name: Unzip 'main' coverage
if: ${{ github.event_name == 'pull_request' }}
working-directory: ${{ github.workspace }}/main/ClickHouse.Client
run: unzip coverage.zip
- name: Report diff coverage
if: ${{ github.event_name == 'pull_request' }}
run: pycobertura diff ./main/coverage.cobertura.xml ./coverage.cobertura.xml --format markdown -o code-coverage-diff.md
continue-on-error: true
- name: Post diff Summary
if: ${{ github.event_name == 'pull_request' }}
run: cat code-coverage-diff.md >> $GITHUB_STEP_SUMMARY
continue-on-error: true
- name: Report full coverage
run: pycobertura show ./coverage.cobertura.xml --format markdown -o code-coverage-full.md
- name: Post full summary
run: cat code-coverage-full.md >> $GITHUB_STEP_SUMMARY
- name: Stick PR comment
if: ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }}
uses: marocchino/sticky-pull-request-comment@v2
continue-on-error: true
with:
recreate: true
path: code-coverage-diff.md
windows:
name: Windows Build
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/cache@v3
name: Cache NuGet
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Build
run: dotnet build
benchmark:
name: Benchmark
runs-on: ubuntu-latest
services:
clickhouse:
image: clickhouse/clickhouse-server:latest
ports:
- 8123:8123
steps:
- uses: actions/checkout@v4
name: Checkout
- uses: actions/cache@v3
name: Cache NuGet
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.x
7.x
- name: Run
run: dotnet run --project ClickHouse.Client.Benchmark/ClickHouse.Client.Benchmark.csproj --framework net6.0 --configuration Release -- --join --filter "*" --artifacts . --job Short
env:
CLICKHOUSE_CONNECTION: Host=localhost;Port=8123
- name: Post results to summary
run: cat results/*-report-github.md >> $GITHUB_STEP_SUMMARY
regress-dotnet:
name: Regression
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
framework: ['net6.0', 'net5.0', 'netcoreapp3.1']
services:
clickhouse:
image: clickhouse/clickhouse-server:latest
ports:
- 8123:8123
steps:
- uses: actions/checkout@v4
name: Checkout
- uses: actions/cache@v3
name: Cache NuGet
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
5.x
6.x
- name: Install GitHubActionsTestLogger
run: dotnet add ClickHouse.Client.Tests/ClickHouse.Client.Tests.csproj package GitHubActionsTestLogger --no-restore
- name: Test
run: dotnet test --framework ${{ matrix.framework }} --configuration Release --verbosity normal --logger GitHubActions /clp:ErrorsOnly
env:
CLICKHOUSE_CONNECTION: Host=localhost;Port=8123
regress:
name: Regression
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tag:
- 'yandex/clickhouse-server:20.6'
- 'yandex/clickhouse-server:20.9'
- 'yandex/clickhouse-server:20.12'
- 'clickhouse/clickhouse-server:21.3'
- 'clickhouse/clickhouse-server:21.7'
- 'clickhouse/clickhouse-server:21.9'
- 'clickhouse/clickhouse-server:21.12'
- 'clickhouse/clickhouse-server:22.3'
- 'clickhouse/clickhouse-server:22.6'
- 'clickhouse/clickhouse-server:22.9'
- 'clickhouse/clickhouse-server:22.12'
- 'clickhouse/clickhouse-server:23.3'
- 'clickhouse/clickhouse-server:23.6'
services:
clickhouse:
image: ${{ matrix.tag }}
ports:
- 8123:8123
steps:
- uses: actions/checkout@v4
name: Checkout
- uses: actions/cache@v3
name: Cache NuGet
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.x
- name: Install GitHubActionsTestLogger
run: dotnet add ClickHouse.Client.Tests/ClickHouse.Client.Tests.csproj package GitHubActionsTestLogger --no-restore
- name: Test
run: dotnet test --framework net6.0 --configuration Release --verbosity normal --logger GitHubActions
env:
CLICKHOUSE_CONNECTION: Host=localhost;Port=8123
CLICKHOUSE_CONTAINER_VERSION: ${{ matrix.tag }}