-
Notifications
You must be signed in to change notification settings - Fork 257
428 lines (393 loc) · 13.7 KB
/
ci.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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
name: CI
# CI build for Brighter
# It creates a package on the github nuger feed for this project
# We run tests for transports as separate jobs to create greater visibility of failure, and to parallelize
# HINT: If you need to debug a config issue, tmate allows you to hop on to the server, check in the build
# logs for the SSH address to let you hop onto the box via tmate. It will timeout and not connect if left too long
# - name: Debugging with tmate
# uses: mxschmitt/[email protected]
on:
push:
branches: [ master, release/9X ]
tags:
- '*.*.*'
pull_request:
branches: [ master, release/9X ]
env:
# Stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending usage data to Microsoft
DOTNET_CLI_TELEMETRY_OPTOUT: true
# Don't show a logo on first run of CLI
DOTNET_NOLOGO: true
# GitHub Packages Feed settings
GITHUB_FEED: https://nuget.pkg.github.com/
GITHUB_USER: iancooper
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- run: dotnet --info
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: Linux-nuget-${{ hashFiles('**/Directory.Packages.props') }}
restore-keys: |
Linux-nuget-
- name: Build
run: dotnet build --configuration Release
- name: Core Tests
run: |
dotnet test tests/Paramore.Brighter.Core.Tests/Paramore.Brighter.Core.Tests.csproj --filter "Fragile!=CI" -c Release --no-restore --no-build --verbosity d
dotnet test tests/Paramore.Brighter.Extensions.Tests/Paramore.Brighter.Extensions.Tests.csproj -c Release --no-restore --no-build --verbosity d
dotnet test tests/Paramore.Brighter.InMemory.Tests/Paramore.Brighter.InMemory.Tests.csproj --filter "Fragile!=CI" -c Release --no-restore --no-build --verbosity d
- name: Upload packages as artifacts
uses: actions/upload-artifact@v4
with:
name: nuget packages
path: "**/*.nupkg"
- name: Push to GitHub Feed
if: ${{ github.event_name != 'pull_request' }}
run: dotnet nuget push **/*.nupkg --source https://nuget.pkg.github.com/${REPOSITORY_OWNER}/index.json --api-key ${GITHUB_TOKEN} --skip-duplicate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY_OWNER: ${{ github.repository_owner }}
release:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build]
steps:
- uses: actions/download-artifact@v4
with:
name: nuget packages
- name: Push generated package to NuGet
run: dotnet nuget push **/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate
memory:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: In Memory Transport Tests
run: dotnet test ./tests/Paramore.Brighter.InMemory.Tests/Paramore.Brighter.InMemory.Tests.csproj --filter "Fragile!=CI" --configuration Release --logger "console;verbosity=normal" --blame -v n
redis-ci:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build]
services:
redis:
image: redis:latest
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: Redis Transport Tests
run: dotnet test ./tests/Paramore.Brighter.Redis.Tests/Paramore.Brighter.Redis.Tests.csproj --filter "Fragile!=CI" --configuration Release --logger "console;verbosity=normal" --blame -v n
mqtt-ci:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build]
services:
mosquitto:
image: efrecon/mosquitto:latest
ports:
- 1883:1883
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup dotnet 6
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
- name: Install dependencies
run: dotnet restore
- name: MQTT Transport Tests
run: dotnet test ./tests/Paramore.Brighter.MQTT.Tests/Paramore.Brighter.MQTT.Tests.csproj --filter "Category=MQTT&Fragile!=CI" --configuration Release --logger "console;verbosity=normal" --blame -v n
rabbitmq-ci:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build]
services:
rabbitmq:
image: brightercommand/rabbitmq:3.13-management-delay
ports:
- 5672:5672
# needed because the rabbitmq container does not provide a healthcheck
options: >-
--health-cmd "rabbitmqctl node_health_check"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: RMQ Transport Tests
run: dotnet test ./tests/Paramore.Brighter.RMQ.Tests/Paramore.Brighter.RMQ.Tests.csproj --filter "Fragile!=CI" --configuration Release --logger "console;verbosity=normal" --blame -v n
kafka-ci:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: [build]
env:
CONFLUENT_BOOSTRAP_SERVER: ${{ secrets.CONFLUENT_BOOSTRAP_SERVER }}
CONFLUENT_SASL_PASSWORD: ${{ secrets.CONFLUENT_SASL_PASSWORD }}
CONFLUENT_SASL_USERNAME: ${{ secrets.CONFLUENT_SASL_USERNAME }}
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
ports:
- 2181:2181
env:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ALLOW_ANONYMOUS_LOGIN: yes
kafka:
image: confluentinc/cp-enterprise-kafka:latest
ports:
- 9092:9092
env:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: true
KAFKA_DELETE_TOPIC_ENABLE: "false"
schema-registry:
image: confluentinc/cp-schema-registry:latest
ports:
- 8081:8081
env:
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'kafka:29092'
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081
steps:
- name: Install KafkaCat
run: |
sudo apt-get install kafkacat
- name: Sleep to let Kafka spin up
uses: jakejarvis/wait-action@master
with:
time: '30s'
- name: docker check
run: docker ps -a
- name: Checkout code
uses: actions/checkout@v4
- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: Kafka Transport Tests
run: dotnet test ./tests/Paramore.Brighter.Kafka.Tests/Paramore.Brighter.Kafka.Tests.csproj --filter "Category=Kafka&Category!=Confluent&Fragile!=CI" --configuration Release --logger "console;verbosity=normal" --blame -v n
postgres-ci:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build]
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: password
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: Postgres Tests
run: dotnet test ./tests/Paramore.Brighter.PostgresSQL.Tests/Paramore.Brighter.PostgresSQL.Tests.csproj --filter "Fragile!=CI" --configuration Release --logger "console;verbosity=normal" --blame -v n
sqlserver-ci:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build]
services:
sqlserver:
image: mcr.microsoft.com/mssql/server
ports:
- 11433:1433
env:
ACCEPT_EULA: Y
SA_PASSWORD: Password123!
steps:
- uses: actions/checkout@v4
- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: MSSQL Tests
run: dotnet test ./tests/Paramore.Brighter.MSSQL.Tests/Paramore.Brighter.MSSQL.Tests.csproj --filter "Fragile!=CI" --configuration Release --logger "console;verbosity=normal" --blame -v n
mysql-ci:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build]
services:
mariadb:
image: mariadb:latest
ports:
- 3306:3306
env:
MYSQL_DATABASE: BrighterTests
MYSQL_ROOT_PASSWORD: root
options: --health-cmd="healthcheck.sh --su-mysql --connect --innodb_initialized" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: Verify MariaDB connection
env:
PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do
sleep 1
done
- name: MySQL Tests
run: dotnet test ./tests/Paramore.Brighter.MySQL.Tests/Paramore.Brighter.MySQL.Tests.csproj --filter "Fragile!=CI" --configuration Release --logger "console;verbosity=normal" --blame -v n
dynamo-ci:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build]
services:
dynamo:
image: dwmkerr/dynamodb
ports:
- 8000:8000
steps:
- uses: actions/checkout@v4
- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: DynamoDB Tests
run: dotnet test ./tests/Paramore.Brighter.DynamoDB.Tests/Paramore.Brighter.DynamoDB.Tests.csproj --filter "Fragile!=CI" --configuration Release --logger "console;verbosity=normal" --blame -v n
aws-ci:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build]
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-west-2
AWS_DEFAULT_OUTPUT: json
steps:
- uses: actions/checkout@v4
- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- name: Copy files to the test website with the AWS CLI
run: |
aws sns list-topics
- name: SQS Tests
run: dotnet test ./tests/Paramore.Brighter.AWS.Tests/Paramore.Brighter.AWS.Tests.csproj --filter "Fragile!=CI" --configuration Release --logger "console;verbosity=normal" --blame -v n
sqlite-ci:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [ build ]
steps:
- uses: actions/checkout@v4
- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: Sqlite Tests
run: dotnet test ./tests/Paramore.Brighter.Sqlite.Tests/Paramore.Brighter.Sqlite.Tests.csproj --filter "Fragile!=CI" --configuration Release --logger "console;verbosity=normal" --blame -v n
azure-ci:
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Setup dotnet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: Azure Tests
run: dotnet test ./tests/Paramore.Brighter.AzureServiceBus.Tests/Paramore.Brighter.AzureServiceBus.Tests.csproj --filter "Fragile!=CI" --configuration Release --logger "console;verbosity=normal" --blame -v n