-
Notifications
You must be signed in to change notification settings - Fork 5
232 lines (205 loc) · 7.69 KB
/
Copy pathpipelines.yml
File metadata and controls
232 lines (205 loc) · 7.69 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
name: Savvy I/O Pipeline
on:
pull_request:
branches: [main]
paths-ignore:
- .codecov/**
- .docfx/**
- .nuget/**
- '**/*.md'
workflow_dispatch:
inputs:
configuration:
type: choice
description: The build configuration to use in the deploy stage.
required: true
default: Release
options:
- Debug
- Release
permissions:
contents: read
jobs:
prepare_test:
name: 📜 Prepare Test
runs-on: ubuntu-24.04
outputs:
json: ${{ steps.test-projects.outputs.result }}
steps:
- name: Checkout
uses: codebeltnet/git-checkout@v1
- id: test-projects
name: Generate matrix for test projects
uses: codebeltnet/shell-globbing@v2
with:
pattern: |
test/**/*.csproj
!test/**/Savvyio.FunctionalTests.csproj
!test/**/Savvyio.Extensions.SimpleQueueService.FunctionalTests.csproj
!test/**/Savvyio.Extensions.QueueStorage.FunctionalTests.csproj
!test/**/Savvyio.Extensions.NATS.FunctionalTests.csproj
!test/**/Savvyio.Extensions.RabbitMQ.FunctionalTests.csproj
- name: JSON output
run: echo "${{ steps.test-projects.outputs.result }}"
build:
name: call-build
strategy:
matrix:
configuration: [Debug, Release]
uses: codebeltnet/jobs-dotnet-build/.github/workflows/default.yml@v3
with:
configuration: ${{ matrix.configuration }}
strong-name-key-filename: savvyio.snk
secrets: inherit
pack:
name: call-pack
needs: [build]
strategy:
matrix:
configuration: [Debug, Release]
uses: codebeltnet/jobs-dotnet-pack/.github/workflows/default.yml@v3
with:
configuration: ${{ matrix.configuration }}
version: ${{ needs.build.outputs.version }}
test:
name: call-test
needs: [build, prepare_test]
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2022]
configuration: [Debug, Release]
project: ${{ fromJson(needs.prepare_test.outputs.json) }}
uses: codebeltnet/jobs-dotnet-test/.github/workflows/default.yml@v3
with:
runs-on: ${{ matrix.os }}
configuration: ${{ matrix.configuration }}
projects: ${{ matrix.project }}
build-switches: -p:SkipSignAssembly=true
restore: true
integration_test:
name: ⚗️ Integration Test - Azure and AWS
needs: [build]
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2022]
configuration: [Release]
project: [ test/**/Savvyio.FunctionalTests.csproj, test/**/Savvyio.Extensions.SimpleQueueService.FunctionalTests.csproj, test/**/Savvyio.Extensions.QueueStorage.FunctionalTests.csproj ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: codebeltnet/git-checkout@v1
- name: Install .NET
uses: codebeltnet/install-dotnet@v3
- name: Install .NET Tool - Report Generator
uses: codebeltnet/dotnet-tool-install-reportgenerator@v1
- name: Test with ${{ matrix.configuration }} build
uses: codebeltnet/dotnet-test@v4
with:
projects: ${{ matrix.project }}
configuration: ${{ matrix.configuration }}
build-switches: -p:SkipSignAssembly=true
restore: true
build: true
env:
AWS__CALLERIDENTITY: ${{ secrets.AWS_CALLER_IDENTITY }}
AWS__IAM__ACCESSKEY: ${{ secrets.AWS_IAM_ACCESSKEY }}
AWS__IAM__SECRETKEY: ${{ secrets.AWS_IAM_SECRETKEY }}
AWS__LOCALSTACK: ${{ secrets.AWS_LOCALSTACK }}
AZURE__STORAGE__QUEUECONNECTIONSTRING: ${{ secrets.AZURE_STORAGE_QUEUECONNECTIONSTRING }}
AZURE__NEWTONSOFT__EVENTGRID__WINDOWS__DEBUG__KEY: ${{ secrets.AZURE_NEWTONSOFT_EVENTGRID_WINDOWS_DEBUG_KEY }}
AZURE__NEWTONSOFT__EVENTGRID__WINDOWS__RELEASE__KEY: ${{ secrets.AZURE_NEWTONSOFT_EVENTGRID_WINDOWS_RELEASE_KEY }}
AZURE__NEWTONSOFT__EVENTGRID__LINUX__DEBUG__KEY: ${{ secrets.AZURE_NEWTONSOFT_EVENTGRID_LINUX_DEBUG_KEY }}
AZURE__NEWTONSOFT__EVENTGRID__LINUX__RELEASE__KEY: ${{ secrets.AZURE_NEWTONSOFT_EVENTGRID_LINUX_RELEASE_KEY }}
AZURE__EVENTGRID__WINDOWS__DEBUG__KEY: ${{ secrets.AZURE_EVENTGRID_WINDOWS_DEBUG_KEY }}
AZURE__EVENTGRID__WINDOWS__RELEASE__KEY: ${{ secrets.AZURE_EVENTGRID_WINDOWS_RELEASE_KEY }}
AZURE__EVENTGRID__LINUX__DEBUG__KEY: ${{ secrets.AZURE_EVENTGRID_LINUX_DEBUG_KEY }}
AZURE__EVENTGRID__LINUX__RELEASE__KEY: ${{ secrets.AZURE_EVENTGRID_LINUX_RELEASE_KEY }}
integration_test_rabbitmq:
name: ⚗️ Integration Test - RabbitMQ
needs: [build]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: codebeltnet/git-checkout@v1
- name: Install .NET
uses: codebeltnet/install-dotnet@v3
- name: Install .NET Tool - Report Generator
uses: codebeltnet/dotnet-tool-install-reportgenerator@v1
- name: Spin up RabbitMQ test dependency
run: |
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:management
- name: Test with Release build
uses: codebeltnet/dotnet-test@v4
with:
projects: test/**/Savvyio.Extensions.RabbitMQ.FunctionalTests.csproj
build-switches: -p:SkipSignAssembly=true
restore: true
build: true
- name: Stop RabbitMQ
run: |
docker stop rabbitmq
docker rm rabbitmq
integration_test_nats:
name: ⚗️ Integration Test - NATS
needs: [build]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: codebeltnet/git-checkout@v1
- name: Install .NET
uses: codebeltnet/install-dotnet@v3
- name: Install .NET Tool - Report Generator
uses: codebeltnet/dotnet-tool-install-reportgenerator@v1
- name: Spin up NATS test dependency
run: |
docker run -d --name nats -p 4222:4222 nats:latest --js
- name: Test with Release build
uses: codebeltnet/dotnet-test@v4
with:
projects: test/**/Savvyio.Extensions.NATS.FunctionalTests.csproj
build-switches: -p:SkipSignAssembly=true
restore: true
build: true
- name: Stop NATS
run: |
docker stop nats
docker rm nats
sonarcloud:
name: call-sonarcloud
needs: [build, test, integration_test, integration_test_rabbitmq, integration_test_nats]
uses: codebeltnet/jobs-sonarcloud/.github/workflows/default.yml@v3
with:
organization: geekle
projectKey: savvyio
version: ${{ needs.build.outputs.version }}
secrets: inherit
codecov:
name: call-codecov
needs: [build, test, integration_test, integration_test_rabbitmq, integration_test_nats]
uses: codebeltnet/jobs-codecov/.github/workflows/default.yml@v1
with:
repository: codebeltnet/savvyio
secrets: inherit
codeql:
name: call-codeql
needs: [build, test, integration_test, integration_test_rabbitmq, integration_test_nats]
uses: codebeltnet/jobs-codeql/.github/workflows/default.yml@v3
permissions:
security-events: write
deploy:
if: github.event_name != 'pull_request'
name: call-nuget
needs: [build, pack, test, integration_test, integration_test_rabbitmq, integration_test_nats, sonarcloud, codecov, codeql]
uses: codebeltnet/jobs-nuget-push/.github/workflows/default.yml@v2
with:
version: ${{ needs.build.outputs.version }}
environment: Production
configuration: ${{ inputs.configuration == '' && 'Release' || inputs.configuration }}
permissions:
contents: write
packages: write
secrets: inherit