-
Notifications
You must be signed in to change notification settings - Fork 0
295 lines (283 loc) · 11.5 KB
/
Copy pathci.yml
File metadata and controls
295 lines (283 loc) · 11.5 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
288
289
290
291
292
293
294
295
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
qualification-class:
name: Determine qualification class
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
classification: ${{ steps.classify.outputs.classification }}
reason: ${{ steps.classify.outputs.reason }}
changed_count: ${{ steps.classify.outputs.changed_count }}
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0
persist-credentials: false
- name: Resolve changed paths without repository API access
id: classify
env:
SOURCE_BASE_SHA: ${{ github.event.pull_request.base.sha }}
SOURCE_EVENT_NAME: ${{ github.event_name }}
SOURCE_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
python scripts/ci/classify_pr_qualification.py \
--root . \
--event-name "$SOURCE_EVENT_NAME" \
--base-ref "$SOURCE_BASE_SHA" \
--head-ref "$SOURCE_HEAD_SHA" \
--github-output "$GITHUB_OUTPUT"
qualification-class-report:
name: Qualification class — ${{ needs.qualification-class.outputs.classification }}
needs: qualification-class
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Report selected qualification
env:
CHANGED_COUNT: ${{ needs.qualification-class.outputs.changed_count }}
QUALIFICATION_CLASS: ${{ needs.qualification-class.outputs.classification }}
QUALIFICATION_REASON: ${{ needs.qualification-class.outputs.reason }}
run: |
case "$QUALIFICATION_CLASS" in
focused-documentation|complete) ;;
*) exit 1 ;;
esac
echo "::notice title=Qualification class::$QUALIFICATION_CLASS ($QUALIFICATION_REASON; $CHANGED_COUNT changed paths)"
regression-corpus:
name: Regression corpus
needs: qualification-class
if: ${{ needs.qualification-class.outputs.classification == 'complete' }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"
- name: Install the official Python binding
run: pip install -e .
- name: Require durable replay and codec evidence
env:
CORPUS_BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
run: |
arguments=()
if [[ "$CORPUS_BASE_REF" =~ ^[0-9a-f]{40}$ ]] && [[ ! "$CORPUS_BASE_REF" =~ ^0+$ ]]; then
arguments+=(--base-ref "$CORPUS_BASE_REF")
fi
python scripts/ci/validate-regression-corpus.py "${arguments[@]}"
- name: Test regression corpus policy guards
run: python scripts/ci/test-validate-regression-corpus.py
lint:
needs: qualification-class
if: ${{ needs.qualification-class.outputs.classification == 'complete' }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"
- run: pip install -e '.[dev]'
- run: ruff check src/ tests/
- run: mypy src/durable_workflow/
- name: Enforce load-calibrated Avro Value regression budget
run: python benchmarks/avro_value.py --enforce
avro-benchmark:
name: Avro Value absolute throughput (advisory)
needs: qualification-class
if: ${{ needs.qualification-class.outputs.classification == 'complete' }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"
- run: pip install -e .
- name: Measure the bounded absolute throughput signal
continue-on-error: true
run: >-
python benchmarks/avro_value.py --enforce-absolute
--output avro-value-benchmark.json
- name: Publish the measured sample summary
if: ${{ always() && github.server_url == 'https://github.com' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: avro-value-benchmark-${{ github.sha }}
path: avro-value-benchmark.json
if-no-files-found: error
test:
needs: qualification-class
if: ${{ needs.qualification-class.outputs.classification == 'complete' }}
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: ${{ matrix.python-version }}
- run: pip install -e '.[dev]'
- run: pytest tests/ -m "not integration" -q
package:
needs: qualification-class
if: ${{ needs.qualification-class.outputs.classification == 'complete' }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
fetch-depth: 0
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"
- run: pip install build twine
- run: sh -n scripts/ci/check-docs-release-audit.sh
- name: Verify release recovery source contracts
env:
CONFORMANCE_BASE_REF: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
run: |
arguments=()
if [ -n "$CONFORMANCE_BASE_REF" ]; then
arguments+=(--previous-ref "$CONFORMANCE_BASE_REF")
fi
python scripts/ci/release_recovery_consumer_conformance.py \
--contract scripts/ci/release-recovery-consumer-contract.json \
--adapter scripts/ci/release-recovery-consumer-adapter.json \
"${arguments[@]}"
python scripts/ci/test-component-release-recovery.py ConsumerContractIdentityRegressionTest
- run: python -m build
- name: Compare built release metadata with the exact source commit
run: python scripts/check_release_metadata.py --source-ref "$(git rev-parse HEAD)" --dist dist
- run: twine check dist/*
- run: python scripts/smoke-built-package.py
cli-parity:
needs: qualification-class
if: ${{ needs.qualification-class.outputs.classification == 'complete' }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
path: sdk-python
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"
- name: Checkout public CLI integration source
run: python sdk-python/scripts/ci/checkout-public-repository.py cli cli
- name: Compare shared control-plane parity fixtures
working-directory: sdk-python
run: python scripts/check-cli-parity.py --cli ../cli
integration:
if: ${{ needs.qualification-class.outputs.classification == 'complete' }}
runs-on: ubuntu-latest
timeout-minutes: 25
needs: [qualification-class, lint, test]
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
path: sdk-python
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: "3.12"
- name: Checkout public Server integration source
run: python sdk-python/scripts/ci/checkout-public-repository.py server server
- run: pip install -e '.[dev]'
working-directory: sdk-python
- name: Configure isolated Docker project
working-directory: sdk-python
run: python scripts/ci/configure-compose-project.py
- name: Start server stack
working-directory: sdk-python
run: |
docker compose --project-name "$COMPOSE_PROJECT_NAME" -f docker-compose.test.yml \
up -d --build --wait --timeout 300
- name: Select and probe integration endpoint
working-directory: sdk-python
run: python scripts/ci/configure-integration-endpoint.py
- name: Run integration tests
working-directory: sdk-python
env:
DURABLE_WORKFLOW_AUTH_TOKEN: test-token
run: pytest tests/integration/ -v
- name: Emit integration diagnostics
if: failure()
working-directory: sdk-python
run: |
for service in bootstrap server worker; do
echo "::group::$service logs"
docker compose --project-name "$COMPOSE_PROJECT_NAME" -f docker-compose.test.yml \
logs --no-color --tail 200 "$service" || true
echo "::endgroup::"
done
- name: Teardown
if: always()
working-directory: sdk-python
run: |
docker compose --project-name "$COMPOSE_PROJECT_NAME" -f docker-compose.test.yml \
down -v --rmi local
target-branch-qualification:
name: Target branch qualification
if: ${{ always() }}
needs:
- qualification-class
- qualification-class-report
- regression-corpus
- lint
- avro-benchmark
- test
- package
- cli-parity
- integration
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Require every supported Python and integration cell
env:
CLASSIFICATION_RESULT: ${{ needs.qualification-class.result }}
CLASSIFICATION_REPORT_RESULT: ${{ needs.qualification-class-report.result }}
QUALIFICATION_CLASS: ${{ needs.qualification-class.outputs.classification }}
LINT_RESULT: ${{ needs.lint.result }}
AVRO_BENCHMARK_RESULT: ${{ needs.avro-benchmark.result }}
CORPUS_RESULT: ${{ needs.regression-corpus.result }}
TEST_RESULT: ${{ needs.test.result }}
PACKAGE_RESULT: ${{ needs.package.result }}
PARITY_RESULT: ${{ needs.cli-parity.result }}
INTEGRATION_RESULT: ${{ needs.integration.result }}
run: |
test "$CLASSIFICATION_RESULT" = success
test "$CLASSIFICATION_REPORT_RESULT" = success
if [ "$QUALIFICATION_CLASS" = focused-documentation ]; then
test "$LINT_RESULT" = skipped
test "$AVRO_BENCHMARK_RESULT" = skipped
test "$CORPUS_RESULT" = skipped
test "$TEST_RESULT" = skipped
test "$PACKAGE_RESULT" = skipped
test "$PARITY_RESULT" = skipped
test "$INTEGRATION_RESULT" = skipped
echo "Focused documentation qualification selected; Docs PR checks and Public Boundary remain required."
elif [ "$QUALIFICATION_CLASS" = complete ]; then
test "$LINT_RESULT" = success
test "$AVRO_BENCHMARK_RESULT" = success
test "$CORPUS_RESULT" = success
test "$TEST_RESULT" = success
test "$PACKAGE_RESULT" = success
test "$PARITY_RESULT" = success
test "$INTEGRATION_RESULT" = success
else
exit 1
fi