-
Notifications
You must be signed in to change notification settings - Fork 15
384 lines (371 loc) · 13.5 KB
/
main.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
name: Main
on:
push:
branches:
- "*"
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Install .NET Core 3.1
uses: actions/[email protected]
with:
dotnet-version: '3.1.x'
- name: Install .NET 5.0.x
uses: actions/[email protected]
with:
dotnet-version: '5.0.x'
- name: Install .NET 6.0.x
uses: actions/[email protected]
with:
dotnet-version: '6.0.100-preview.7.21379.14'
include-prerelease: true
- name: Build
run: dotnet build -c Release
- name: Create packages
run: dotnet pack -c Release -o $(pwd)/packages
apps:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Install .NET Core 3.1
uses: actions/[email protected]
with:
dotnet-version: '3.1.x'
- name: Install .NET 5.0.x
uses: actions/[email protected]
with:
dotnet-version: '5.0.x'
- name: Install .NET 6.0.x
uses: actions/[email protected]
with:
dotnet-version: '6.0.100-preview.7.21379.14'
include-prerelease: true
- name: Add Github Actions logger
run: dotnet add src/Sitko.Core.Xunit/Sitko.Core.Xunit.csproj package GitHubActionsTestLogger
- name: Run tests
run: dotnet test --logger GitHubActions tests/Sitko.Core.App.Tests/Sitko.Core.App.Tests.csproj
blazor:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Install node.js
uses: actions/[email protected]
with:
node-version: '15'
cache: 'npm'
cache-dependency-path: |
src/Sitko.Core.Blazor.AntDesign/Web/package.json
- name: Build Sitko.Core.Blazor.AntDesign js
working-directory: src/Sitko.Core.Blazor.AntDesign/Web
shell: bash
run: |
npm ci
npm run prod
- name: Install .NET Core 3.1
uses: actions/[email protected]
with:
dotnet-version: '3.1.x'
- name: Install .NET 5.0.x
uses: actions/[email protected]
with:
dotnet-version: '5.0.x'
- name: Install .NET 6.0.x
uses: actions/[email protected]
with:
dotnet-version: '6.0.100-preview.7.21379.14'
include-prerelease: true
- name: Add Github Actions logger
run: dotnet add src/Sitko.Core.Xunit/Sitko.Core.Xunit.csproj package GitHubActionsTestLogger
- name: Run tests
run: dotnet test --logger GitHubActions tests/Sitko.Core.App.Blazor.Tests/Sitko.Core.App.Blazor.Tests.csproj
grpc:
runs-on: ubuntu-latest
env:
POSTGRES_HOST: postgres
XUNIT_USE_POSTGRES: "true"
services:
postgres:
image: postgres:alpine
env:
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- uses: actions/[email protected]
- name: Install .NET Core 3.1
uses: actions/[email protected]
with:
dotnet-version: '3.1.x'
- name: Install .NET 5.0.x
uses: actions/[email protected]
with:
dotnet-version: '5.0.x'
- name: Install .NET 6.0.x
uses: actions/[email protected]
with:
dotnet-version: '6.0.100-preview.7.21379.14'
include-prerelease: true
- name: Add Github Actions logger
run: dotnet add src/Sitko.Core.Xunit/Sitko.Core.Xunit.csproj package GitHubActionsTestLogger
- name: Run tests
run: dotnet test --logger GitHubActions tests/Sitko.Core.Grpc.Client.Tests/Sitko.Core.Grpc.Client.Tests.csproj
imgproxy:
runs-on: ubuntu-latest
container: ghcr.io/sitkoru/actions-container
steps:
- uses: actions/[email protected]
- name: Install .NET Core 3.1
uses: actions/[email protected]
with:
dotnet-version: '3.1.x'
- name: Install .NET 5.0.x
uses: actions/[email protected]
with:
dotnet-version: '5.0.x'
- name: Install .NET 6.0.x
uses: actions/[email protected]
with:
dotnet-version: '6.0.100-preview.7.21379.14'
include-prerelease: true
- name: Add Github Actions logger
run: dotnet add src/Sitko.Core.Xunit/Sitko.Core.Xunit.csproj package GitHubActionsTestLogger
- name: Run tests
run: dotnet test --logger GitHubActions tests/Sitko.Core.ImgProxy.Tests/Sitko.Core.ImgProxy.Tests.csproj
pdf:
runs-on: ubuntu-latest
container: ghcr.io/sitkoru/actions-container
env:
PUPPETEER_EXECUTABLE_PATH: "/usr/bin/google-chrome-stable"
steps:
- uses: actions/[email protected]
- name: Install chrome
run: |
apt-get update
apt-get install -y google-chrome-stable
- name: Install .NET Core 3.1
uses: actions/[email protected]
with:
dotnet-version: '3.1.x'
- name: Install .NET 5.0.x
uses: actions/[email protected]
with:
dotnet-version: '5.0.x'
- name: Install .NET 6.0.x
uses: actions/[email protected]
with:
dotnet-version: '6.0.100-preview.7.21379.14'
include-prerelease: true
- name: Add Github Actions logger
run: dotnet add src/Sitko.Core.Xunit/Sitko.Core.Xunit.csproj package GitHubActionsTestLogger
- name: Run tests
run: dotnet test --logger GitHubActions tests/Sitko.Core.Pdf.Tests/Sitko.Core.Pdf.Tests.csproj
queue:
runs-on: ubuntu-latest
container: ghcr.io/sitkoru/actions-container
env:
QUEUE__NATS__SERVERS__0: nats://nats:4222
QUEUE__NATS__CLUSTERNAME: test-cluster
services:
nats:
image: nats-streaming:latest
steps:
- uses: actions/[email protected]
- name: Install .NET Core 3.1
uses: actions/[email protected]
with:
dotnet-version: '3.1.x'
- name: Install .NET 5.0.x
uses: actions/[email protected]
with:
dotnet-version: '5.0.x'
- name: Install .NET 6.0.x
uses: actions/[email protected]
with:
dotnet-version: '6.0.100-preview.7.21379.14'
include-prerelease: true
- name: Add Github Actions logger
run: dotnet add src/Sitko.Core.Xunit/Sitko.Core.Xunit.csproj package GitHubActionsTestLogger
- name: Run tests Sitko.Core.Queue
run: dotnet test --logger GitHubActions tests/Sitko.Core.Queue.Test/Sitko.Core.Queue.Tests.csproj
- name: Run tests Sitko.Core.Queue.Nats
run: dotnet test --logger GitHubActions tests/Sitko.Core.Queue.Nats.Tests/Sitko.Core.Queue.Nats.Tests.csproj
- name: Run tests Sitko.Core.Queue.InMemory
run: dotnet test --logger GitHubActions tests/Sitko.Core.Queue.InMemory.Tests/Sitko.Core.Queue.InMemory.Tests.csproj
repository:
runs-on: ubuntu-latest
container: ghcr.io/sitkoru/actions-container
env:
DB__POSTGRES__TESTDBCONTEXT__HOST: postgres
XUNIT_USE_POSTGRES: "true"
services:
postgres:
image: postgres:alpine
env:
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- uses: actions/[email protected]
- name: Install .NET Core 3.1
uses: actions/[email protected]
with:
dotnet-version: '3.1.x'
- name: Install .NET 5.0.x
uses: actions/[email protected]
with:
dotnet-version: '5.0.x'
- name: Install .NET 6.0.x
uses: actions/[email protected]
with:
dotnet-version: '6.0.100-preview.7.21379.14'
include-prerelease: true
- name: Add Github Actions logger
run: dotnet add src/Sitko.Core.Xunit/Sitko.Core.Xunit.csproj package GitHubActionsTestLogger
- name: Run tests
run: dotnet test --logger GitHubActions tests/Sitko.Core.Repository.Tests/Sitko.Core.Repository.Tests.csproj
sonyflake:
runs-on: ubuntu-latest
container: ghcr.io/sitkoru/actions-container
env:
IDPROVIDER__SONYFLAKE__URI: http://sonyflake
services:
sonyflake:
image: titpetric/sonyflake
steps:
- uses: actions/[email protected]
- name: Install .NET Core 3.1
uses: actions/[email protected]
with:
dotnet-version: '3.1.x'
- name: Install .NET 5.0.x
uses: actions/[email protected]
with:
dotnet-version: '5.0.x'
- name: Install .NET 6.0.x
uses: actions/[email protected]
with:
dotnet-version: '6.0.100-preview.7.21379.14'
include-prerelease: true
- name: Add Github Actions logger
run: dotnet add src/Sitko.Core.Xunit/Sitko.Core.Xunit.csproj package GitHubActionsTestLogger
- name: Run tests
run: dotnet test --logger GitHubActions tests/Sitko.Core.SonyFlake.Tests/Sitko.Core.SonyFlake.Tests.csproj
storage:
runs-on: ubuntu-latest
container: ghcr.io/sitkoru/actions-container
env:
STORAGE__S3__TESTS3STORAGESETTINGS__SERVER: http://minio:9000
STORAGE__S3__TESTS3STORAGESETTINGS__ACCESSKEY: ptTYf7VkCVbUjAzn
STORAGE__S3__TESTS3STORAGESETTINGS__SECRETKEY: RddqonEnrZZaCU7kkZszN9yiMFkX7rH3
STORAGE__METADATA__POSTGRES__TESTS3STORAGESETTINGS__HOST: postgres
STORAGE__METADATA__POSTGRES__TESTS3STORAGESETTINGS__USERNAME: postgres
STORAGE__METADATA__POSTGRES__TESTS3STORAGESETTINGS__PASSWORD: 123
services:
minio:
image: bitnami/minio
env:
MINIO_ACCESS_KEY: ptTYf7VkCVbUjAzn
MINIO_SECRET_KEY: RddqonEnrZZaCU7kkZszN9yiMFkX7rH3
postgres:
image: postgres:alpine
env:
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- uses: actions/[email protected]
- name: Install .NET Core 3.1
uses: actions/[email protected]
with:
dotnet-version: '3.1.x'
- name: Install .NET 5.0.x
uses: actions/[email protected]
with:
dotnet-version: '5.0.x'
- name: Install .NET 6.0.x
uses: actions/[email protected]
with:
dotnet-version: '6.0.100-preview.7.21379.14'
include-prerelease: true
- name: Add Github Actions logger
run: dotnet add src/Sitko.Core.Xunit/Sitko.Core.Xunit.csproj package GitHubActionsTestLogger
- name: Sitko.Core.Storage.FileSystem
run: dotnet test --logger GitHubActions tests/Sitko.Core.Storage.FileSystem.Tests/Sitko.Core.Storage.FileSystem.Tests.csproj
- name: Sitko.Core.Storage.S3
run: dotnet test --logger GitHubActions tests/Sitko.Core.Storage.S3.Tests/Sitko.Core.Storage.S3.Tests.csproj
- name: Sitko.Core.Storage.Metadata.Postgres
run: dotnet test --logger GitHubActions tests/Sitko.Core.Storage.Metadata.Postgres.Tests/Sitko.Core.Storage.Metadata.Postgres.Tests.csproj
vault:
runs-on: ubuntu-latest
container: ghcr.io/sitkoru/actions-container
env:
VAULT__URI: http://127.0.0.1:8200
VAULT__TOKEN: twit3itPSAD0yok
VAULT__MOUNTPOINT: secret
VAULT__SECRETS__0: tests
VAULT__SECRETS__1: test2
services:
sonyflake:
image: titpetric/sonyflake
steps:
- uses: actions/[email protected]
- name: Install .NET Core 3.1
uses: actions/[email protected]
with:
dotnet-version: '3.1.x'
- name: Install .NET 5.0.x
uses: actions/[email protected]
with:
dotnet-version: '5.0.x'
- name: Install .NET 6.0.x
uses: actions/[email protected]
with:
dotnet-version: '6.0.100-preview.7.21379.14'
include-prerelease: true
- name: Install Vault
run: |
curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add -
apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
apt-get update && apt-get install -y vault
setcap cap_ipc_lock= /usr/bin/vault
- name: Start Vault
run: |
vault server -dev -dev-root-token-id="${VAULT__TOKEN}" &
- name: Seed Vault
run: |
export VAULT_ADDR=${VAULT__URI}
json='{"test": {"Foo": "123","Bar": 123}}'
echo $json > data.json
vault kv put ${VAULT__MOUNTPOINT}/${VAULT__SECRETS__0} @data.json
vault kv put ${VAULT__MOUNTPOINT}/${VAULT__SECRETS__1} @data.json
- name: Add Github Actions logger
run: dotnet add src/Sitko.Core.Xunit/Sitko.Core.Xunit.csproj package GitHubActionsTestLogger
- name: Run tests
run: dotnet test --logger GitHubActions tests/Sitko.Core.Configuration.Vault.Tests/Sitko.Core.Configuration.Vault.Tests.csproj
release:
name: Release
runs-on: ubuntu-latest
needs: [ build, apps, blazor, grpc, imgproxy, pdf, queue, repository, sonyflake, storage, vault ]
if: ${{ github.event_name == 'push' }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: Install node.js
uses: actions/[email protected]
with:
node-version: '16'
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@sitkoru/semantic-release-config
@semantic-release/changelog
@semantic-release/git
env:
GH_TOKEN: ${{ secrets.BOT_TOKEN }}
GIT_AUTHOR_NAME: ${{ secrets.BOT_NAME }}
GIT_AUTHOR_EMAIL: ${{ secrets.BOT_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.BOT_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.BOT_EMAIL }}