-
Notifications
You must be signed in to change notification settings - Fork 0
218 lines (190 loc) · 8.89 KB
/
Copy pathci.yml
File metadata and controls
218 lines (190 loc) · 8.89 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
git-hygiene:
name: Git hygiene (mandatory hooks + attribution)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure approved git identity
run: |
git config user.name "cyre"
git config user.email "Lawrence@cyre.me"
- name: Install mandatory repo hooks
run: bash scripts/git/install-local-hooks.sh
- name: Bootstrap private attribution patterns (self-contained)
run: bash scripts/cursor/ci-bootstrap-private-attribution.sh
- name: Checkout orama-system (PR branch for stacked cross-repo parity)
if: github.event_name == 'pull_request'
id: checkout-orama-pr
uses: actions/checkout@v4
with:
repository: diazMelgarejo/orama-system
ref: ${{ github.head_ref }}
path: orama-system
fetch-depth: 1
persist-credentials: false
continue-on-error: true
- name: Clear orama-system before main fallback
if: github.event_name != 'pull_request' || steps.checkout-orama-pr.outcome != 'success'
run: rm -rf orama-system
- name: Checkout orama-system (main fallback)
if: github.event_name != 'pull_request' || steps.checkout-orama-pr.outcome != 'success'
uses: actions/checkout@v4
with:
repository: diazMelgarejo/orama-system
ref: main
path: orama-system
fetch-depth: 1
persist-credentials: false
continue-on-error: true
- name: Sync gitignored .cursor/private
run: |
if [[ -f orama-system/scripts/cursor/write-openclaw-private-attribution.sh ]]; then
export ORAMA_SYSTEM_PATH="$GITHUB_WORKSPACE/orama-system"
bash orama-system/scripts/cursor/write-openclaw-private-attribution.sh
fi
bash scripts/cursor/sync-private-attribution-from-home.sh
- name: Verify docs/adr pointers in sync with orama docs/v2 (zero-fragmentation)
run: |
if [ -d orama-system ]; then
ORAMA_ROOT="$GITHUB_WORKSPACE/orama-system" \
bash scripts/check_docs_v2_pointer_sync.sh
else
echo "skip: orama-system not available in this CI run"
fi
- name: Verify model endpoint policy parity with orama-system
run: |
if [ -d orama-system ]; then
ORAMA_SYSTEM_ROOT="$GITHUB_WORKSPACE/orama-system" \
python3 scripts/review/verify_model_endpoint_policy_parity.py
else
echo "skip: orama-system not available in this CI run"
fi
- name: Scan tracked files for banned tokens
run: bash scripts/git/scan-tracked-banned-tokens.sh
- name: Verify git guards
run: bash scripts/git/verify-git-guards.sh
- name: Provision verboten-literals for CI
# CI checks out this repo in isolation, so repo_hygiene.py's
# openclaw_workspace_root() ancestor walk never finds a sibling
# orama-system/ directory the way a local multi-repo checkout does --
# the private-literal scan silently checks against nothing on CI
# today. If OPENCLAW_VERBOTEN_LITERALS_CONTENT is provisioned as a
# repo secret (operator action, not this workflow), write it to an
# ephemeral runner-temp file and point OPENCLAW_VERBOTEN_LITERALS at
# it for the rest of this job. No-op (and the scan stays empty, same
# as today) if the secret isn't set -- safe default for forked-repo
# PRs, which never receive secrets.
if: ${{ env.OPENCLAW_VERBOTEN_LITERALS_CONTENT != '' }}
env:
OPENCLAW_VERBOTEN_LITERALS_CONTENT: ${{ secrets.OPENCLAW_VERBOTEN_LITERALS_CONTENT }}
run: |
literals_path="$RUNNER_TEMP/.verboten-literals.local"
printf '%s\n' "$OPENCLAW_VERBOTEN_LITERALS_CONTENT" > "$literals_path"
chmod 600 "$literals_path"
echo "OPENCLAW_VERBOTEN_LITERALS=$literals_path" >> "$GITHUB_ENV"
- name: Repo hygiene gate
run: python3 scripts/review/repo_hygiene.py .
- name: Local runtime overlay gate (committed config)
run: python3 scripts/git/check_local_runtime_overlay.py . --mode tree
- name: Audit branch commit attribution (PR commits)
if: github.event_name == 'pull_request'
env:
BASE_REF: ${{ github.base_ref }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
git fetch origin "$BASE_REF:$BASE_REF" || true
# actions/checkout checks out refs/pull/*/merge for pull_request events.
# Audit the contributor's actual head commits, not GitHub's synthetic merge commit.
RANGE="origin/$BASE_REF..$HEAD_SHA"
GIT_AUDIT_RANGE="$RANGE" GIT_AUDIT_STRICT=1 bash scripts/git/audit_attribution.sh
# docs-sync folded in 2026-07-31: same trigger as the rest of this
# job already (both live in ci.yml), so a second full
# checkout+Python+pyyaml setup for two lightweight script calls was
# a redundant runner/checkout, not a real isolation boundary.
#
# if: ${{ !cancelled() }} on all 3 steps below is load-bearing, not
# decorative: without it, a step failure earlier in THIS job (e.g.
# repo hygiene, banned-token scan) would skip these by GitHub
# Actions' own default step behavior, silently coupling docs/config
# sync to git-hygiene's success -- exactly the independent-execution
# property docs-sync had as its own separate job before this fold.
# !cancelled() (not always()) deliberately still skips these on a
# genuine manual cancellation, which always() would not.
- name: Install pyyaml (for docs/config sync checks below)
if: ${{ !cancelled() }}
run: pip install pyyaml
- name: Validate hardware/SKILL.md matches config/models.yml
if: ${{ !cancelled() }}
run: python scripts/check_docs_sync.py --quiet
- name: Reject stale model as default_primary_model
if: ${{ !cancelled() }}
run: |
# Only fail if qwen3.5-35b-a3b-q4 is set as the PRIMARY model.
# It may still appear as a legacy fallback entry — that is intentional.
if grep "default_primary_model:.*qwen3.5-35b-a3b-q4" hardware/SKILL.md; then
echo "FAIL: stale model 'qwen3.5-35b-a3b-q4' is set as default_primary_model — update to canonical LM Studio model"
exit 1
fi
echo "OK: default_primary_model is not a stale reference"
lint-and-test:
needs: [git-hygiene]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Bootstrap private attribution patterns (self-contained)
run: bash scripts/cursor/ci-bootstrap-private-attribution.sh
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Core test deps + runtime deps needed by orchestrator.py at import time
pip install pytest pytest-asyncio pytest-cov pyyaml
pip install fastapi aiohttp redis httpx python-dotenv loguru pydantic
# fix(ci): slowapi must be present before orchestrator.py can be imported
pip install slowapi
# fix(ci): respx is used by tests/discovery/ for mocking httpx calls
pip install respx
# fix(ci): hypothesis is used by tests/test_state_transition_manager.py
# for property-based tests (declared in pyproject.toml's dev extra, but
# this step installs an explicit list rather than `pip install -e .[dev]`,
# so it needs to be listed here too or CI diverges from pyproject.toml).
pip install hypothesis
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8 (warnings only)
run: |
pip install flake8
flake8 . --count --max-line-length=120 --statistics --exit-zero
continue-on-error: true
- name: Run tests
run: |
pytest tests/ -v --tb=short
env:
ORAMA_ENDPOINT: http://localhost:8001/orama
ORAMA_TIMEOUT: "120"
ORAMA_ENABLED: "false"
- name: Check routing.yml validity
run: |
python -c "
import yaml
with open('config/routing.yml') as f:
cfg = yaml.safe_load(f)
assert 'routes' in cfg, 'routes key missing'
assert 'deep_reasoning' in cfg['routes'], 'deep_reasoning route missing'
assert 'code_analysis' in cfg['routes'], 'code_analysis route missing'
print('routing.yml OK -- all required routes present')
"