Repository navigation
160 lines (146 loc) · 5.25 KB
/
Copy pathpython-ci.yml
File metadata and controls
160 lines (146 loc) · 5.25 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
name: Python CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
test:
name: pytest (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install package and test dependencies
run: python -m pip install --upgrade pip && python -m pip install -e ".[dev]"
- name: Compile package
run: python -m compileall -q datamind
- name: Run test suite
run: python -m pytest -q -rs datamind/tests plugins/datamind-context/tests
- name: Verify real SQLite demo
run: python -m datamind.scripts.verify_sqlite_demo
versioning:
name: Optional versioning providers (Python 3.12)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install optional versioning and ingest dependencies
run: python -m pip install -e ".[dev,cocoindex,dolt]"
- name: Run local versioning, publication and recovery contracts
run: >-
python scripts/ci_required_tests.py -q
datamind/tests/test_kb_versioning.py
datamind/tests/test_kb_ingest.py
datamind/tests/test_pr28_regressions.py
datamind/tests/test_workspace_revisions.py
datamind/tests/test_workspace_incremental.py
datamind/tests/test_ingestion_skills.py
databases:
name: MySQL and Dolt integration
runs-on: ubuntu-latest
timeout-minutes: 15
services:
mysql:
image: mysql:8.4
env:
MYSQL_ROOT_PASSWORD: datamind_ci
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h localhost -pdatamind_ci"
--health-interval=10s
--health-timeout=5s
--health-retries=12
env:
DATAMIND_TEST_MYSQL_DSN: mysql+pymysql://root:datamind_ci@127.0.0.1:3306/
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install database dependencies
run: python -m pip install -e ".[dev,mysql,dolt,versioning]"
- name: Install pinned Dolt binary
shell: bash
run: |
curl --fail --location --retry 3 https://github.com/dolthub/dolt/releases/download/v2.5.0/dolt-linux-amd64.tar.gz -o /tmp/dolt.tar.gz
echo "639b8042d1ea46ebf6b645a002fc787134dbe1dc02888cc51a51d1d3eb557c93 /tmp/dolt.tar.gz" | sha256sum --check
tar -xzf /tmp/dolt.tar.gz -C /tmp
sudo install /tmp/dolt-linux-amd64/bin/dolt /usr/local/bin/dolt
dolt version
- name: Run database integration tests without skips
run: >-
python scripts/ci_required_tests.py -q
datamind/tests/test_db_ingest.py
datamind/tests/test_db_versioning.py
datamind/tests/test_workspace_native_db.py
package:
name: Installed wheel smoke test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Build wheel
run: python -m pip install build && python -m build --wheel
- name: Install wheel in isolated environment
run: |
python -m venv /tmp/datamind-wheel-env
/tmp/datamind-wheel-env/bin/python -m pip install dist/*.whl
- name: Check imports, resources and default providers outside checkout
working-directory: /tmp
run: /tmp/datamind-wheel-env/bin/python "$GITHUB_WORKSPACE/scripts/ci_smoke_installed.py"
codex:
name: Official Codex SDK and direct data tools
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install official SDK integration
run: python -m pip install -e ".[dev,codex]"
- name: Require direct execution and offline SDK contracts
run: >-
python scripts/ci_required_tests.py -q
datamind/tests/test_direct_data_plane.py
datamind/tests/test_codex_host.py
datamind/tests/test_unified_host.py
datamind/tests/test_cli_codex.py
datamind/tests/test_http_api.py
datamind/tests/test_experiment_faults.py
plugins/datamind-context/tests/test_datamind_mcp.py
gate:
name: CI gate
if: always()
needs: [test, versioning, databases, package, codex]
runs-on: ubuntu-latest
steps:
- name: Require all test jobs to succeed
env:
RESULTS: ${{ toJSON(needs) }}
run: |
python - <<'PY'
import json, os
results = json.loads(os.environ["RESULTS"])
failed = {name: result["result"] for name, result in results.items() if result["result"] != "success"}
if failed:
raise SystemExit(f"Required CI jobs did not succeed: {failed}")
print("All required CI jobs passed")
PY