-
Notifications
You must be signed in to change notification settings - Fork 15
226 lines (213 loc) · 8.04 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
name: Main
on:
push:
branches:
- "*"
pull_request:
jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/sitkoru/actions-container
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
run: dotnet build -c Release
- name: Create packages
run: dotnet pack -c Release --no-build -p:PackageOutputPath=$(pwd)/packages
apps:
runs-on: ubuntu-latest
container: ghcr.io/sitkoru/actions-container
steps:
- uses: actions/checkout@v4
- name: Run tests
run: dotnet test --logger GitHubActions tests/Sitko.Core.App.Tests/Sitko.Core.App.Tests.csproj
blazor:
runs-on: ubuntu-latest
container: ghcr.io/sitkoru/actions-container
steps:
- uses: actions/checkout@v4
- name: Install node.js
uses: actions/setup-node@v4
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: Run tests
run: dotnet test --logger GitHubActions tests/Sitko.Core.App.Blazor.Tests/Sitko.Core.App.Blazor.Tests.csproj
grpc:
runs-on: ubuntu-latest
container: ghcr.io/sitkoru/actions-container
steps:
- uses: actions/checkout@v4
- 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/checkout@v4
- 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/checkout@v4
- name: Install chrome
run: |
apt-get update
apt-get install -y google-chrome-stable
- 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/checkout@v4
- 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
DB__POSTGRES__SECONDTESTDBCONTEXT__HOST: postgres
DB__POSTGRES__TPHDBCONTEXT__HOST: postgres
TESTS__USEPOSTGRES: "true"
services:
postgres:
image: postgres:alpine
env:
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- uses: actions/checkout@v4
- name: Run EF Core tests
run: dotnet test --logger GitHubActions tests/Sitko.Core.Repository.EntityFrameworkCore.Tests/Sitko.Core.Repository.EntityFrameworkCore.Tests.csproj
- name: Run Remote tests
run: dotnet test --logger GitHubActions tests/Sitko.Core.Repository.Remote.Tests/Sitko.Core.Repository.Remote.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/checkout@v4
- name: Run tests
run: dotnet test --logger GitHubActions tests/Sitko.Core.SonyFlake.Tests/Sitko.Core.SonyFlake.Tests.csproj
opensearch:
runs-on: ubuntu-latest
container: ghcr.io/sitkoru/actions-container
env:
OpenSearchModuleOptions__Url: http://opensearch:9200
OpenSearchModuleOptions__Login: admin
OpenSearchModuleOptions__Password: sikdadasDA123@ituDSSaMydfdssdss
services:
opensearch:
image: opensearchproject/opensearch:latest
ports: [ "9200:9200" ]
env:
discovery.type: single-node
plugins.security.disabled: true
OPENSEARCH_INITIAL_ADMIN_PASSWORD: sikdadasDA123@ituDSSaMydfdssdss
options: >-
--health-cmd="curl http://localhost:9200/_cluster/health"
--health-interval=10s
--health-timeout=5s
--health-retries=10
steps:
- uses: actions/checkout@v4
- name: Run opensearch tests
run: dotnet test --logger GitHubActions tests/Sitko.Core.Search.OpenSearch.Tests/Sitko.Core.Search.OpenSearch.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_ROOT_USER: ptTYf7VkCVbUjAzn
MINIO_ROOT_PASSWORD: RddqonEnrZZaCU7kkZszN9yiMFkX7rH3
postgres:
image: postgres:alpine
env:
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- uses: actions/checkout@v4
- 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.Remote
run: dotnet test --logger GitHubActions tests/Sitko.Core.Storage.Remote.Tests/Sitko.Core.Storage.Remote.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://vault:8200
VAULT__TOKEN: twit3itPSAD0yok
VAULT__MOUNTPOINT: secret
VAULT__SECRETS__0: tests
VAULT__SECRETS__1: test2
services:
vault:
image: hashicorp/vault
env:
VAULT_DEV_ROOT_TOKEN_ID: twit3itPSAD0yok
VAULT_DEV_LISTEN_ADDRESS: 0.0.0.0:8200
options: --cap-add=IPC_LOCK
steps:
- uses: actions/checkout@v4
- 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, opensearch ]
if: ${{ github.event_name == 'push' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Semantic Release
uses: sitkoru/semantic-release-action@v2
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 }}