forked from influxdata/influxdb-client-csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
246 lines (236 loc) · 9.2 KB
/
config.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
version: 2.1
commands:
influxdb-onboarding:
steps:
- run:
name: "Post onBoarding request to InfluxDB 2"
command: ./Scripts/influxdb-onboarding.sh
prepare:
description: "Prepare environment to tests"
steps:
- checkout
- influxdb-onboarding
client-test:
parameters:
code-coverage-report:
type: boolean
default: false
steps:
- run:
name: "Running tests"
command: ./Scripts/ci-test.sh << parameters.code-coverage-report >>
- run:
name: "Converting test results to Junit format"
when: on_fail
command: ./trx2junit/trx2junit ./**/TestResults/*.trx
storing-test-results:
steps:
- run:
name: "Copying test results"
when: always
command: |
mkdir test-results
mkdir test-results/client-legacy
cp -r Client.Legacy.Test/TestResults/*.xml test-results/client-legacy || true
mkdir test-results/client-linq
cp -r Client.Linq.Test/TestResults/*.xml test-results/client-linq || true
mkdir test-results/client
cp -r Client.Test/TestResults/*.xml test-results/client || true
mkdir test-results/client-core
cp -r Client.Core.Test/TestResults/*.xml test-results/client-core || true
- store_test_results:
path: test-results
storing-artifacts:
steps:
- run:
name: "Copying artifacts"
command: |
mkdir artifacts
cp -r Client.Core/bin/Debug/*/*.dll artifacts/
cp -r Client.Legacy/bin/Debug/*/*.dll artifacts/
cp -r Client.Linq/bin/Debug/*/*.dll artifacts/
cp -r Client/bin/Debug/*/*.dll artifacts/
- store_artifacts:
path: artifacts
jobs:
tests-dotnet:
parameters:
dotnet-image:
type: string
default: &default-dotnet-image "mcr.microsoft.com/dotnet/sdk:7.0"
dotnet-target-version:
type: string
default: "netstandard2.1"
influxdb-image:
type: string
default: &default-influxdb-image "influxdb:latest"
code-coverage-report:
type: boolean
default: false
docker:
- image: << parameters.dotnet-image >>
environment:
NET_TARGET_VERSION: << parameters.dotnet-target-version >>
- image: &influx-image << parameters.influxdb-image >>
environment:
INFLUXD_HTTP_BIND_ADDRESS: :9999
- image: &influx-image << parameters.influxdb-image >>
name: influxdb_v2_onboarding
environment:
INFLUXD_HTTP_BIND_ADDRESS: :9999
- image: influxdb:1.8
environment:
INFLUXDB_HTTP_FLUX_ENABLED: true
environment:
INFLUXDB_2_ONBOARDING_IP: influxdb_v2_onboarding
INFLUXDB_2_ONBOARDING_PORT: 9999
steps:
- prepare
- client-test:
code-coverage-report: << parameters.code-coverage-report >>
- storing-test-results
- storing-artifacts
- when:
condition:
and:
- equal: [ true, << parameters.code-coverage-report >> ]
steps:
- run:
name: Install GPG
command: |
apt-get update
apt-get install gpg -y
- run:
name: Collecting coverage reports
command: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
curl -s https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x ./codecov
./codecov
tests-windows:
machine:
image: "windows-server-2019-vs2019:stable"
resource_class: windows.medium
shell: bash
steps:
- checkout
- run: choco install influxdb1 --version=1.8.0
- run: export INFLUXDB_HTTP_FLUX_ENABLED=true
- run:
name: "Start InfluxDB"
command: /c/influxdata/influxdb-1.8.0-1/influxd.exe -config "Scripts/influxdb.conf"
background: true
- run: |
sed -i '/<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0<\/TargetFrameworks>/c\<TargetFramework>'net5.0'<\/TargetFramework>' Client.Core.Test/Client.Core.Test.csproj
sed -i '/<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0<\/TargetFrameworks>/c\<TargetFramework>'net5.0'<\/TargetFramework>' Client.Test/Client.Test.csproj
sed -i '/<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0<\/TargetFrameworks>/c\<TargetFramework>'net5.0'<\/TargetFramework>' Client.Legacy.Test/Client.Legacy.Test.csproj
sed -i '/<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0<\/TargetFrameworks>/c\<TargetFramework>'net5.0'<\/TargetFramework>' Client.Linq.Test/Client.Linq.Test.csproj
sed -i '/<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0<\/TargetFrameworks>/c\<TargetFramework>'net5.0'<\/TargetFramework>' Examples/Examples.csproj
- run: dotnet sln remove Examples/ExampleBlazor/ExampleBlazor.csproj
- run: dotnet nuget locals --clear all
- run: dotnet restore --no-cache --force -s https://api.nuget.org/v3/index.json
- run: dotnet build
- run: dotnet test Client.Legacy.Test/Client.Legacy.Test.csproj --no-build
check-compilation-warnings:
docker:
- image: *default-dotnet-image
steps:
- checkout
- run: |
sed -i '/<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0<\/TargetFrameworks>/c\<TargetFramework>'net7.0'<\/TargetFramework>' Client.Core.Test/Client.Core.Test.csproj
sed -i '/<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0<\/TargetFrameworks>/c\<TargetFramework>'net7.0'<\/TargetFramework>' Client.Test/Client.Test.csproj
sed -i '/<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0<\/TargetFrameworks>/c\<TargetFramework>'net7.0'<\/TargetFramework>' Client.Legacy.Test/Client.Legacy.Test.csproj
sed -i '/<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0<\/TargetFrameworks>/c\<TargetFramework>'net7.0'<\/TargetFramework>' Client.Linq.Test/Client.Linq.Test.csproj
sed -i '/<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0<\/TargetFrameworks>/c\<TargetFramework>'net7.0'<\/TargetFramework>' Examples/Examples.csproj
- run:
name: Check compilation warnings
command: |
dotnet clean --configuration Release
dotnet build --configuration Release -warnAsError -warnAsMessage:CS0618,NETSDK1138
check-code-formatting:
docker:
- image: *default-dotnet-image
steps:
- checkout
- restore_cache:
name: Restoring reSharper Cache
keys:
- &cache-key reSharper-cache-2022_1_0
- run:
name: Check code formatting
command: |
./Scripts/reformat-code.sh
git diff --exit-code
- save_cache:
name: Saving reSharper Cache
key: *cache-key
paths:
- ./reSharperCLI
deploy-preview:
parameters:
influxdb-image:
type: string
default: *default-influxdb-image
docker:
- image: *default-dotnet-image
steps:
- run:
name: Early return if this build is from a forked repository
command: |
if [[ $CIRCLE_PROJECT_USERNAME != "influxdata" ]]; then
echo "Nothing to do for forked repositories, so marking this step successful"
circleci step halt
fi
- checkout
- run:
name: Deploying To Preview repository
command: ./Scripts/ci-deploy-snapshot.sh
workflows:
version: 2
build:
when:
not:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
jobs:
- check-compilation-warnings
- check-code-formatting
- tests-dotnet:
name: dotnet-3.1-nightly
influxdb-image: "quay.io/influxdb/influxdb:nightly"
dotnet-image: "mcr.microsoft.com/dotnet/core/sdk:3.1"
- tests-dotnet:
name: dotnet-3.1
dotnet-image: "mcr.microsoft.com/dotnet/core/sdk:3.1"
- tests-dotnet:
name: dotnet-5.0
code-coverage-report: true
dotnet-image: "mcr.microsoft.com/dotnet/sdk:5.0"
- tests-dotnet:
name: dotnet-6.0
dotnet-image: "mcr.microsoft.com/dotnet/sdk:6.0"
- tests-dotnet:
name: dotnet-7.0
- tests-windows:
name: dotnet-windows
- deploy-preview:
requires:
- check-compilation-warnings
- check-code-formatting
- dotnet-3.1-nightly
- dotnet-3.1
- dotnet-5.0
- dotnet-6.0
- dotnet-7.0
- dotnet-windows
filters:
branches:
only: master
nightly:
when:
equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
jobs:
- tests-dotnet