-
Notifications
You must be signed in to change notification settings - Fork 0
287 lines (270 loc) · 9.93 KB
/
Copy pathcommon.yml
File metadata and controls
287 lines (270 loc) · 9.93 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
name: Common
on:
pull_request:
merge_group:
types:
- checks_requested
push:
branches:
- master
- main
- release/v*
tags:
- v*
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: read
jobs:
changes:
name: Changes
uses: ./.github/workflows/changes-reusable.yml
semantic-conventions:
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
runs-on: ubuntu-latest
name: Semantic Conventions
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install repository tools
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
with:
version: 2026.8.2
install_args: github:open-telemetry/weaver
cache: false
- name: Verify semantic conventions
run: mise run --skip-tools semconv:check
csharp-quality:
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
runs-on: ubuntu-latest
name: C# Quality
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Install net10.0
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: 10.0.x
- name: Install task runner
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
with:
version: 2026.8.2
install: false
cache: false
- name: Set up .NET NuGet authentication
env:
NUGET_GITHUB_ACTOR: ${{ github.actor }}
NUGET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mise run --skip-tools github:actions:nuget-authenticate
- name: Resolve comparison refs
id: refs
env:
EVENT_NAME: ${{ github.event_name }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
MERGE_GROUP_BASE_SHA: ${{ github.event.merge_group.base_sha }}
MERGE_GROUP_HEAD_SHA: ${{ github.event.merge_group.head_sha }}
BEFORE_SHA: ${{ github.event.before }}
CURRENT_SHA: ${{ github.sha }}
run: mise run --skip-tools github:actions:resolve-comparison-refs
- name: Restore
run: |
dotnet restore src/EventStore.sln
- name: Lint unused variables
run: |
dotnet build --no-restore --configuration Release -p:Platform=x64 -warnaserror:CS0168,CS0219,CS8321 src/EventStore.sln
- name: Verify C# formatting
run: |
./ci/csharp-format-changed.sh src/EventStore.sln "${{ steps.refs.outputs.base }}" "${{ steps.refs.outputs.head }}"
- name: Verify semantic convention package
run: |
dotnet pack --no-restore --configuration Release --output artifacts/packages \
src/TrogonEventStore.SemanticConventions/TrogonEventStore.SemanticConventions.csproj
vulnerability-scan:
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
runs-on: ubuntu-latest
name: Scan for Vulnerabilities
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install net10.0
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: 10.0.x
- name: Install task runner
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
with:
version: 2026.8.2
install: false
cache: false
- name: Set up .NET NuGet authentication
env:
NUGET_GITHUB_ACTOR: ${{ github.actor }}
NUGET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mise run --skip-tools github:actions:nuget-authenticate
- name: Scan for Vulnerabilities
run: mise run --skip-tools github:actions:vulnerability-scan
protolock:
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
runs-on: ubuntu-latest
name: Protolock Status
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Protolock Status
shell: bash
run: |
./protolock.sh status --uptodate
release-metadata:
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
runs-on: ubuntu-latest
name: Release Metadata
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Install task runner
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
with:
version: 2026.8.2
install: false
cache: false
- name: Verify release metadata
run: mise run --skip-tools release-metadata:check
- name: Verify container publication tags
run: mise run --skip-tools github:actions:publish-container-test
archive-storage-contract:
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
runs-on: ubuntu-latest
name: Archive Storage Contract
env:
EVENTSTORE_S3_TEST_ENDPOINT: http://localhost:9000
EVENTSTORE_S3_TEST_REGION: us-east-1
EVENTSTORE_S3_TEST_ACCESS_KEY: archive-contract
EVENTSTORE_S3_TEST_SECRET_KEY: archive-contract-secret-key
EVENTSTORE_S3_RECOVERY_BUCKET: archive-recovery-${{ github.run_id }}-${{ github.run_attempt }}
services:
rustfs:
image: rustfs/rustfs:1.0.0-beta.11@sha256:84ce557a0245a06a9aae5516f55ee0f007fca78d41df356f419306fdc0cb168c
ports:
- 9000:9000
env:
RUSTFS_ACCESS_KEY: archive-contract
RUSTFS_SECRET_KEY: archive-contract-secret-key
options: >-
--health-cmd "curl --fail http://localhost:9000/health"
--health-interval 2s
--health-timeout 2s
--health-retries 30
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install net10.0
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: 10.0.x
- name: Install task runner
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
with:
version: 2026.8.2
install: false
cache: false
- name: Set up .NET NuGet authentication
env:
NUGET_GITHUB_ACTOR: ${{ github.actor }}
NUGET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mise run --skip-tools github:actions:nuget-authenticate
- name: Run archive storage contract tests
run: mise run --skip-tools github:actions:archive-storage-contract -- contract
- name: Seed archive restart recovery data
id: seed_archive_recovery
env:
EVENTSTORE_S3_RECOVERY_PHASE: seed
run: mise run --skip-tools github:actions:archive-storage-contract -- recovery
- name: Stop RustFS without removing its data
env:
RUSTFS_CONTAINER_ID: ${{ job.services.rustfs.id }}
run: mise run --skip-tools github:actions:archive-storage-contract -- stop-storage
- name: Assert archive storage is unavailable
env:
EVENTSTORE_S3_RECOVERY_PHASE: unavailable
run: mise run --skip-tools github:actions:archive-storage-contract -- recovery
- name: Restart RustFS and verify archive recovery
if: ${{ always() && steps.seed_archive_recovery.outcome == 'success' }}
env:
EVENTSTORE_S3_RECOVERY_PHASE: verify-cleanup
RUSTFS_CONTAINER_ID: ${{ job.services.rustfs.id }}
run: mise run --skip-tools github:actions:archive-storage-contract -- restart-and-verify
- name: Run archive cluster restore gate
run: mise run --skip-tools github:actions:archive-storage-contract -- cluster-restore
docker-compose:
needs: changes
if: ${{ needs.changes.outputs.code == 'true' }}
runs-on: ubuntu-latest
name: Docker Compose Smoke Test
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install task runner
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
with:
version: 2026.8.2
install: false
cache: false
- name: Github Registry Docker Login
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Compose Smoke Test
env:
DOCKER_BUILDKIT: 1
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mise run --skip-tools github:actions:docker-compose-smoke
required:
name: Common CI
if: ${{ always() }}
needs:
- changes
- semantic-conventions
- csharp-quality
- vulnerability-scan
- protolock
- release-metadata
- archive-storage-contract
- docker-compose
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install task runner
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
with:
version: 2026.8.2
install: false
cache: false
- name: Require successful jobs
env:
REQUIRED_JOBS: ${{ toJSON(needs) }}
run: mise run --skip-tools github:actions:require-successful-jobs