-
Notifications
You must be signed in to change notification settings - Fork 47
142 lines (140 loc) · 6 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
name: CI
on:
push:
branches:
- master
- release-*
pull_request:
workflow_dispatch:
env:
DOTNET_NOLOGO: true
jobs:
build:
name: ${{ matrix.os-name }}-${{ matrix.test-category }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, ubuntu-22.04]
test-category: [ Default, SqlServer, AzureServiceBus, RabbitMQ, AzureStorageQueues, MSMQ, SQS, PrimaryRavenAcceptance, PrimaryRavenPersistence, PostgreSQL ]
include:
- os: windows-2022
os-name: Windows
- os: ubuntu-22.04
os-name: Linux
exclude:
- os: ubuntu-22.04
test-category: MSMQ
fail-fast: false
steps:
- name: Check for secrets
env:
SECRETS_AVAILABLE: ${{ secrets.SECRETS_AVAILABLE }}
shell: pwsh
run: exit $(If ($env:SECRETS_AVAILABLE -eq 'true') { 0 } Else { 1 })
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
- name: Download RavenDB Server
shell: pwsh
run: ./tools/download-ravendb-server.ps1
- name: Build
run: dotnet build src --configuration Release -graph
- name: Zip PowerShell module
shell: pwsh
run: |
New-Item assets\PowerShellModules -ItemType Directory
Compress-Archive -Path deploy\PowerShellModules\Particular.ServiceControl.Management\* -DestinationPath assets\PowerShellModules\Particular.ServiceControl.Management.zip
- name: Upload assets
uses: actions/[email protected]
if: matrix.test-category == 'Default'
with:
name: ${{ matrix.os-name }}-assets
path: |
nugets/
zip/
assets/
retention-days: 1
- name: Smoke test PowerShell module import
if: matrix.os-name == 'Windows'
shell: pwsh
run: Import-Module ./deploy/PowerShellModules/Particular.ServiceControl.Management
- name: Azure login
uses: azure/[email protected]
if: matrix.test-category == 'AzureServiceBus' || matrix.test-category == 'AzureStorageQueues' || matrix.test-category == 'RabbitMQ' || matrix.test-category == 'PostgreSQL'
with:
creds: ${{ secrets.AZURE_ACI_CREDENTIALS }}
- name: Setup SQL Server
uses: Particular/[email protected]
if: matrix.test-category == 'SqlServer'
with:
connection-string-env-var: ServiceControl_TransportTests_SQL_ConnectionString
catalog: nservicebus
- name: Setup PostgreSQL
uses: Particular/[email protected]
if: matrix.test-category == 'PostgreSQL'
with:
connection-string-name: ServiceControl_TransportTests_PostgreSQL_ConnectionString
tag: ServiceControl
registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
registry-password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup RabbitMQ
uses: Particular/[email protected]
if: matrix.test-category == 'RabbitMQ'
with:
connection-string-name: ServiceControl_TransportTests_RabbitMQ_ConnectionString
tag: ServiceControl
registry-username: ${{ secrets.DOCKERHUB_USERNAME }}
registry-password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup Azure Service Bus
uses: Particular/[email protected]
if: matrix.test-category == 'AzureServiceBus'
with:
connection-string-name: ServiceControl_TransportTests_ASBS_ConnectionString
azure-credentials: ${{ secrets.AZURE_ACI_CREDENTIALS }}
tag: ServiceControl
- name: Setup Azure Storage Queues
uses: Particular/[email protected]
if: matrix.test-category == 'AzureStorageQueues'
with:
connection-string-name: ServiceControl_TransportTests_ASQ_ConnectionString
azure-credentials: ${{ secrets.AZURE_ACI_CREDENTIALS }}
tag: ServiceControl
- name: Setup SQS environment variables
if: matrix.test-category == 'SQS'
shell: pwsh
run: |
echo "AWS_REGION=${{ secrets.AWS_REGION }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
echo "AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
echo "AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
# Cleanup of queues starting with `GHA-` handled by https://github.com/Particular/NServiceBus.AmazonSQS/blob/master/.github/workflows/tests-cleanup.yml
$connectString = "AccessKeyId=${{ secrets.AWS_ACCESS_KEY_ID }};SecretAccessKey=${{ secrets.AWS_SECRET_ACCESS_KEY }};Region=${{ secrets.AWS_REGION }};QueueNamePrefix=GHA-${{ github.run_id }}"
echo "ServiceControl_TransportTests_SQS_ConnectionString=$connectString" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
- name: Run tests
uses: Particular/[email protected]
env:
ServiceControl_TESTS_FILTER: ${{ matrix.test-category }}
PARTICULARSOFTWARE_LICENSE: ${{ secrets.LICENSETEXT }}
AZURE_ACI_CREDENTIALS: ${{ secrets.AZURE_ACI_CREDENTIALS }}
windows-installers:
if: ${{ github.actor != 'dependabot[bot]' }}
uses: ./.github/workflows/build-windows.yml
secrets: inherit
containers:
if: ${{ github.actor != 'dependabot[bot]' }}
uses: ./.github/workflows/build-containers.yml
secrets: inherit
db-container:
if: ${{ github.actor != 'dependabot[bot]' }}
uses: ./.github/workflows/build-db-container.yml
secrets: inherit
# See /src/container-integration-test/README.md
container-test:
if: ${{ github.actor != 'dependabot[bot]' }}
needs: [ 'containers', 'db-container' ]
uses: ./.github/workflows/container-integration-test.yml
secrets: inherit