Repository navigation
103 lines (91 loc) · 4.52 KB
/
Copy pathpython-matching-engine.yml
File metadata and controls
103 lines (91 loc) · 4.52 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
name: PythonMatchingEngine integration
on:
workflow_dispatch:
schedule:
- cron: "17 6 * * 1"
pull_request:
paths:
- ".github/workflows/python-matching-engine.yml"
- "pyproject.toml"
- "MANIFEST.in"
- "integrations/python_matching_engine/**"
- "src/tracebook/__init__.py"
- "src/tracebook/_version.py"
- "src/tracebook/core/**"
- "src/tracebook/conformance/**"
- "src/tracebook/events/**"
- "tests/test_conformance_campaign.py"
- "tests/test_external_integrations.py"
- "tests/test_integration_workflow_coverage.py"
permissions:
contents: read
jobs:
pinned-upstream:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
UPSTREAM_COMMIT: f94150294a85d7b415ca4518590b5a661d6f9958
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
- name: Configure the upstream checkout path
run: echo "PYTHON_MATCHING_ENGINE_PATH=$RUNNER_TEMP/PythonMatchingEngine" >> "$GITHUB_ENV"
- name: Install Tracebook and current upstream runtime dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e . "pandas>=2.3.3" "PyYAML>=6.0.2"
- name: Fetch the pinned PythonMatchingEngine revision
run: |
git init "$PYTHON_MATCHING_ENGINE_PATH"
git -C "$PYTHON_MATCHING_ENGINE_PATH" remote add origin https://github.com/Surbeivol/PythonMatchingEngine.git
git -C "$PYTHON_MATCHING_ENGINE_PATH" fetch --depth 1 origin "$UPSTREAM_COMMIT"
git -C "$PYTHON_MATCHING_ENGINE_PATH" checkout --detach FETCH_HEAD
test "$(git -C "$PYTHON_MATCHING_ENGINE_PATH" rev-parse HEAD)" = "$UPSTREAM_COMMIT"
- name: Verify the native FIFO and lifecycle subset
run: |
tracebook-conformance run \
integrations/python_matching_engine/fifo-compatible.jsonl \
--output /tmp/python-matching-engine-compatible.json \
--timeout 20 \
--candidate python integrations/python_matching_engine/adapter.py
python -c "import json; p=json.load(open('/tmp/python-matching-engine-compatible.json')); assert p['conformant'] is True and p['compared_events'] == 13; assert p['candidate_engine']['version'] == 'f94150294a85'; assert p['final_state_hash'] == '21a9606e7c77c3b239259f5032245c6330ddcd1d3f7fa25394612d9818becee3'"
- name: Verify the expected full-suite contract profile
run: |
tracebook-conformance sample /tmp/tracebook-conformance-v2
set +e
tracebook-conformance suite \
/tmp/tracebook-conformance-v2 \
--output /tmp/python-matching-engine-suite.json \
--timeout 20 \
--candidate python integrations/python_matching_engine/adapter.py
status=$?
set -e
if [ "$status" -ne 1 ]; then
echo "Expected semantic-difference exit code 1, got $status" >&2
exit 1
fi
python -c "import json; p=json.load(open('/tmp/python-matching-engine-suite.json')); passed={c['name'] for c in p['cases'] if c['report']['conformant']}; assert p['suite_id'] == 'tracebook-conformance-v2'; assert p['suite_hash'] == 'sha256:7b82f87088fbbaa760c8623243d8abfce5be57a477ebea91527b74309190decd'; assert passed == {'fifo-lifecycle', 'deep-cancellation'}"
- name: Run the generated FIFO lifecycle campaign
run: |
tracebook-conformance campaign \
--output-dir /tmp/python-matching-engine-campaign \
--profile fifo-limit-v1 \
--seed 20260713 \
--traces 10 \
--events-per-trace 50 \
--max-minimize-runs 40 \
--timeout 20 \
--candidate python integrations/python_matching_engine/adapter.py
python -c "import json; p=json.load(open('/tmp/python-matching-engine-campaign/campaign.json')); assert p['campaign_id'] == 'sha256:53e31761dbcc5b5858506c7f11b81b1ad9cae281d46fb8212c1d62a89d058a2d'; assert p['conformant'] is True and p['generated_events'] == 500; assert p['candidate_engine']['version'] == 'f94150294a85'; assert p['semantic_coverage']['coverage_ratio'] == 1.0"
- uses: actions/upload-artifact@v7
if: always()
with:
name: python-matching-engine-conformance
path: |
/tmp/python-matching-engine-compatible.json
/tmp/python-matching-engine-suite.json
/tmp/python-matching-engine-campaign
if-no-files-found: error