forked from MassTransit/MassTransit
-
Notifications
You must be signed in to change notification settings - Fork 2
590 lines (523 loc) · 17.4 KB
/
build.yml
File metadata and controls
590 lines (523 loc) · 17.4 KB
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
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
name: MassTransit
env:
MASSTRANSIT_VERSION: 8.5.8
on:
push:
paths:
- 'src/**'
- 'tests/**'
- 'MassTransit.sln'
- 'Directory.Build.props'
- 'Directory.Packages.props'
- '**/build.yml'
branches:
- '**'
pull_request:
paths:
- 'src/**'
- 'tests/**'
- 'MassTransit.sln'
- 'Directory.Build.props'
- 'Directory.Packages.props'
- '**/build.yml'
workflow_dispatch:
jobs:
compile:
name: Build
timeout-minutes: 15
strategy:
max-parallel: 2
matrix:
os: ['ubuntu-latest', 'windows-latest']
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Restore NuGet packages
run: dotnet restore
working-directory: ./
- name: Build
run: dotnet build -c Release --no-restore
working-directory: ./
test-ubuntu:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Unit Tests
run: dotnet test -c Release -f net9.0 --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.Tests
- name: Test Abstractions
run: dotnet test -c Release -f net9.0 --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.Abstractions.Tests
test-activemq:
name: "Transports: ActiveMQ"
timeout-minutes: 10
runs-on: ubuntu-latest
services:
activemq:
image: masstransit/activemq:latest
ports:
- "61616:61616"
- "8161:8161"
- "5672:5672"
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test ActiveMQ
run: dotnet test -c Release --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.ActiveMqTransport.Tests
test-sql-transport:
name: "Transport: SQL"
timeout-minutes: 10
runs-on: ubuntu-latest
services:
mssql:
image: mcr.microsoft.com/azure-sql-edge
env:
ACCEPT_EULA: Y
SA_PASSWORD: "Password12!"
ports:
- 1433:1433
postgres:
image: postgres:14.7
env:
POSTGRES_PASSWORD: "Password12!"
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: false
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test Database Transport
run: dotnet test -c Release --logger GitHubActions --filter "Category!=Flaky&Category!=Integration"
working-directory: tests/MassTransit.SqlTransport.Tests
test-azure-service-bus:
name: "Transports: Azure Service Bus"
if: false # too flaky at this point
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test Azure Service Bus
env:
MT_ASB_KEYVALUE: ${{ secrets.AZURE_SERVICEBUS }}
MT_AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE }}
run: dotnet test -c Release --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.Azure.ServiceBus.Core.Tests
test-rabbitmq:
name: "Transports: RabbitMQ"
timeout-minutes: 10
runs-on: ubuntu-latest
services:
rabbitmq:
image: masstransit/rabbitmq:latest
ports:
- "5672:5672"
- "15672:15672"
options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test RabbitMQ
run: dotnet test -c Release --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.RabbitMqTransport.Tests
test-sqs:
name: "Transports: SQS (+S3)"
timeout-minutes: 10
runs-on: ubuntu-latest
services:
localstack:
image: localstack/localstack:3.0.2
ports:
- "4566:4566"
- "4571:4571"
options: --health-cmd "curl --fail http://localhost:4566/health || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5 --health-start-period 15s
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test SQS
run: dotnet test -c Release --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.AmazonSqsTransport.Tests
test-azure-table:
name: "Storage: Azure Table"
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Spin up test environment
run: |
docker compose -f docker-compose.yml up -d
working-directory: tests/MassTransit.Azure.Table.Tests
- name: Test Azure Table
env:
MT_AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE }}
run: dotnet test -c Release --logger GitHubActions --filter "Category!=Flaky&Category!=Integration"
working-directory: tests/MassTransit.Azure.Table.Tests
- name: Stop test environment
run: |
docker compose -f docker-compose.yml down
working-directory: tests/MassTransit.Azure.Table.Tests
test-cosmosdb:
name: "Storage: CosmosDB"
timeout-minutes: 10
runs-on: ubuntu-latest
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') && github.repository == 'MassTransit/MassTransit'
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test CosmosDB
env:
MT_COSMOS_ENDPOINT: ${{ secrets.AZURE_COSMOSENDPOINT }}
MT_COSMOS_KEY: ${{ secrets.AZURE_COSMOSKEY }}
run: dotnet test -c Release --logger GitHubActions --filter "Category!=Flaky&Category!=Integration"
working-directory: tests/MassTransit.Azure.Cosmos.Tests
test-dapper:
name: "Storage: Dapper"
timeout-minutes: 10
runs-on: ubuntu-latest
services:
mssql:
image: mcr.microsoft.com/azure-sql-edge
env:
ACCEPT_EULA: Y
SA_PASSWORD: "Password12!"
ports:
- 1433:1433
env:
# otherwise the client barks
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: false
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test Dapper
run: dotnet test -c Release --logger GitHubActions --filter "Category!=Flaky&Category!=Integration"
working-directory: tests/MassTransit.DapperIntegration.Tests
test-entity-framework:
name: "Storage: EntityFramework"
timeout-minutes: 10
runs-on: ubuntu-latest
services:
mssql:
image: mcr.microsoft.com/azure-sql-edge
env:
ACCEPT_EULA: Y
SA_PASSWORD: "Password12!"
ports:
- 1433:1433
postgres:
image: postgres
env:
POSTGRES_PASSWORD: "Password12!"
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
# otherwise the client barks
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: false
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test EntityFrameworkCore
run: dotnet test -c Release --logger GitHubActions --filter "Category!=Flaky&Category!=Integration"
working-directory: tests/MassTransit.EntityFrameworkCoreIntegration.Tests
- name: Test EntityFramework
run: dotnet test -c Release --logger GitHubActions --filter "Category!=Flaky&Category!=Integration"
working-directory: tests/MassTransit.EntityFrameworkIntegration.Tests
test-marten:
name: "Storage: Marten"
timeout-minutes: 10
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: "Password12!"
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test Marten
run: dotnet test -c Release --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.MartenIntegration.Tests
test-mongo:
name: "Storage: MongoDB"
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Spin up test environment
run: |
docker compose -f docker-compose.yml up -d
working-directory: tests/MassTransit.MongoDbIntegration.Tests
- name: Test MongoDB
run: dotnet test -c Release --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.MongoDbIntegration.Tests
- name: Stop test environment
run: |
docker compose -f docker-compose.yml down
working-directory: tests/MassTransit.MongoDbIntegration.Tests
test-nhibernate:
name: "Storage: NHibernate"
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test NHibernate
run: dotnet test -c Release --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.NHibernateIntegration.Tests
test-redis:
name: "Storage: Redis"
timeout-minutes: 10
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- '6379:6379'
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test Redis
run: dotnet test -c Release --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.RedisIntegration.Tests
test-valkey:
name: "Storage: Valkey"
timeout-minutes: 10
runs-on: ubuntu-latest
services:
valkey:
image: valkey/valkey:8
ports:
- '6379:6379'
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test Valkey
run: dotnet test -c Release --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.RedisIntegration.Tests
test-hangfire:
name: "Scheduler: Hangfire"
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test Hangfire
run: dotnet test -c Release --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.HangfireIntegration.Tests
test-quartz:
name: "Scheduler: Quartz"
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test Quartz
run: dotnet test -c Release --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.QuartzIntegration.Tests
test-eventhub:
name: "Rider: EventHub"
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Spin up test environment
run: |
docker compose -f docker-compose.yml up -d
working-directory: tests/MassTransit.EventHubIntegration.Tests
- name: Test EventHub
run: dotnet test -c Release --logger GitHubActions --filter Category!=Flaky
env:
MT_EH_NAMESPACE: ${{ secrets.AZURE_EVENTHUB }}
MT_AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE }}
working-directory: tests/MassTransit.EventHubIntegration.Tests
- name: Stop test environment
run: |
docker compose -f docker-compose.yml down
working-directory: tests/MassTransit.EventHubIntegration.Tests
test-kafka:
name: "Rider: Kafka"
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Spin up test environment
run: |
docker compose -f docker-compose.yml up -d
working-directory: tests/MassTransit.KafkaIntegration.Tests
- name: Test Kafka
run: dotnet test -c Release --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.KafkaIntegration.Tests
- name: Stop test environment
run: |
docker compose -f docker-compose.yml down
working-directory: tests/MassTransit.KafkaIntegration.Tests
test-signalr:
name: SignalR
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Test SignalR
run: dotnet test -c Release --logger GitHubActions --filter Category!=Flaky
working-directory: tests/MassTransit.SignalR.Tests
calc-version:
name: Calculate Version
runs-on: ubuntu-latest
needs:
- compile
- test-ubuntu
- test-activemq
# - test-azure-service-bus
- test-rabbitmq
- test-sqs
- test-sql-transport
- test-azure-table
- test-cosmosdb
- test-dapper
- test-entity-framework
- test-marten
- test-mongo
- test-nhibernate
- test-redis
- test-valkey
- test-hangfire
- test-quartz
# - test-eventhub
- test-kafka
- test-signalr
outputs:
version: ${{ steps.v.outputs.version }}
steps:
- id: v
run: |
if [ "${{ github.ref }}" = 'refs/heads/master' ]; then
echo "version=${MASSTRANSIT_VERSION}" >> $GITHUB_OUTPUT
else
echo "version=${MASSTRANSIT_VERSION}-develop.${{ github.run_number }}" >> $GITHUB_OUTPUT
fi
publish:
name: Build and Publish NuGets
timeout-minutes: 60
runs-on: windows-latest
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') && github.repository == 'MassTransit/MassTransit' && success()
env:
DOTNET_INSTALL_DIR: D:\dotnet
NUGET_PACKAGES: D:\.nuget\packages
needs:
- calc-version
steps:
- name: Version Output Check
run: |
echo "${{ needs.calc-version.outputs.version }}"
- name: Check out code
uses: actions/checkout@v5
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Build and Pack Solution
run: |
dotnet build -c Release -p:Version=${{ needs.calc-version.outputs.version }}
dotnet pack --no-build -c Release -p:PackageVersion=${{ needs.calc-version.outputs.version }} -o ./artifacts
- name: Publish NuGets
working-directory: artifacts
run: |
dotnet nuget push * -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate --no-symbols