-
-
Notifications
You must be signed in to change notification settings - Fork 70
163 lines (140 loc) · 4.78 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
name: Tests
on:
push:
branches: [ main ]
paths-ignore:
- '**/*.md'
pull_request:
branches: [ main ]
jobs:
coverage:
name: Code Coverage
uses: ./.github/workflows/reusable.yml
with:
coverage: true
permissions:
statuses: write
compare:
name: Compare coverage
runs-on: ubuntu-latest
if: false
permissions:
statuses: write
needs:
- coverage
steps:
- name: Install pycobertura
run: pip install pycobertura
- name: Checkout
uses: actions/checkout@v4
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main
path: main
- name: Download coverage
uses: actions/download-artifact@v4
with:
name: coverage
path: ${{ github.workspace }}/ClickHouse.Client
- name: Download 'main' coverage
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
working-directory: ${{ github.workspace }}/main/ClickHouse.Client
run: unzip coverage.zip
- name: Report diff annotations
run: pycobertura diff ./main/ClickHouse.Client/coverage.cobertura.xml ./ClickHouse.Client/coverage.cobertura.xml
--format github-annotation
continue-on-error: true
- name: Report diff summary
run: pycobertura diff ./main/ClickHouse.Client/coverage.cobertura.xml ./ClickHouse.Client/coverage.cobertura.xml
--format markdown >> $GITHUB_STEP_SUMMARY
continue-on-error: true
- name: Generate diff json
run: pycobertura diff ./main/ClickHouse.Client/coverage.cobertura.xml ./ClickHouse.Client/coverage.cobertura.xml --format json --output coverage.diff.json
continue-on-error: true
- name: Set coverage status
env:
GITHUB_TOKEN: ${{ github.token }}
run: python ${{ github.workspace }}/.github/coverage-status.py
--coverage-file ./ClickHouse.Client/coverage.cobertura.xml
--repository ${{ github.event.pull_request.head.repo.full_name || github.repository }} --sha ${{ github.event.pull_request.head.sha || github.sha }}
- name: Set coverage diff status
env:
GITHUB_TOKEN: ${{ github.token }}
run: python ${{ github.workspace }}/.github/coverage-status.py
--coverage-file coverage.diff.json
--repository ${{ github.event.pull_request.head.repo.full_name || github.repository }} --sha ${{ github.event.pull_request.head.sha || github.sha }}
regress-clickhouse:
name: ClickHouse regression
uses: ./.github/workflows/reusable.yml
with:
clickhouse-version: ${{ matrix.version }}
strategy:
fail-fast: false
matrix:
version:
- '21.3'
- '21.8'
- '22.3'
- '22.8'
- '22.9'
- '22.12'
- '23.3'
- '23.6'
- '23.8'
- '23.9'
regress-dotnet:
name: .NET regression
uses: ./.github/workflows/reusable.yml
with:
framework: ${{ matrix.framework }}
needs:
- coverage
strategy:
fail-fast: false
matrix:
framework: ['net8.0', 'net7.0', 'net6.0', 'net5.0', 'netcoreapp3.1']
integration:
name: Integration Tests
runs-on: ubuntu-latest
needs:
- coverage
services:
clickhouse:
image: clickhouse/clickhouse-server:latest
ports:
- 8123:8123
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
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@v4
with:
dotnet-version: |
3.1.x
6.x
8.x
- name: Install GitHubActionsTestLogger
run: dotnet add ClickHouse.Client.IntegrationTests/ClickHouse.Client.IntegrationTests.csproj package GitHubActionsTestLogger --no-restore
- name: Test with coverage
run: dotnet test ClickHouse.Client.IntegrationTests/ClickHouse.Client.IntegrationTests.csproj --framework net8.0 --configuration Release --verbosity normal --logger GitHubActions /clp:ErrorsOnly /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:SkipAutoProps=true
env:
CLICKHOUSE_CONNECTION: Host=localhost;Port=8123
CLICKHOUSE_VERSION: latest