-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (122 loc) · 4.53 KB
/
Copy pathstaging.yml
File metadata and controls
146 lines (122 loc) · 4.53 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
name: Staging — Ephemeral AEE Lifecycle
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
concurrency:
group: staging-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# ── Python gateway tests ───────────────────────────────────────────
python-tests:
name: Python ${{ matrix.python }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python: ["3.10", "3.12", "3.13"]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
cache: pip
- name: Install Python package
run: pip install -e ".[dev]"
- name: Install specsmith (required by test_governance.py)
run: pip install "git+https://github.com/layer1labs/specsmith.git@main"
env:
SPECSMITH_NO_AUTO_UPDATE: "1"
SPECSMITH_PYPI_CHECKED: "1"
- name: Run pytest (TEST-001..110)
env:
SPECSMITH_NO_AUTO_UPDATE: "1"
SPECSMITH_PYPI_CHECKED: "1"
run: pytest tests/ -v --tb=short
# ── Rust firmware tests ────────────────────────────────────────────
rust-tests:
name: Rust firmware (TEST-004..006)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
firmware/rust/target
key: ${{ runner.os }}-cargo-${{ hashFiles('firmware/rust/Cargo.lock') }}
- name: Run Rust tests
working-directory: firmware/rust
run: cargo test --verbose
# ── specsmith AEE lifecycle (TEST-011..013) ───────────────────────
specsmith-lifecycle:
name: specsmith AEE Lifecycle
runs-on: ubuntu-latest
needs: [python-tests]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
- name: Install specsmith from main
run: pip install "git+https://github.com/layer1labs/specsmith.git@main"
- name: Validate governance schema — strict (TEST-013)
env:
SPECSMITH_NO_AUTO_UPDATE: "1"
SPECSMITH_PYPI_CHECKED: "1"
run: |
python -m specsmith validate --strict --json --project-dir . \
| tee /tmp/validate.json
python -c "
import json, sys
r = json.load(open('/tmp/validate.json'))
errors = r.get('strict_errors', 0)
if errors > 0:
print(f'FAIL: {errors} strict errors')
sys.exit(1)
print('PASS: 0 strict errors')
"
- name: Sync machine state (TEST-012)
env:
SPECSMITH_NO_AUTO_UPDATE: "1"
SPECSMITH_PYPI_CHECKED: "1"
run: python -m specsmith sync --project-dir .
- name: Sync check — assert drift-free (TEST-012)
env:
SPECSMITH_NO_AUTO_UPDATE: "1"
SPECSMITH_PYPI_CHECKED: "1"
run: python -m specsmith sync --check --project-dir .
- name: Audit governance health (TEST-011)
env:
SPECSMITH_NO_AUTO_UPDATE: "1"
SPECSMITH_PYPI_CHECKED: "1"
run: python -m specsmith audit --project-dir .
- name: Preflight smoke-test
env:
SPECSMITH_NO_AUTO_UPDATE: "1"
SPECSMITH_PYPI_CHECKED: "1"
run: |
python -m specsmith preflight "add CAN filter for extended frames" \
--project-dir . --json | python -c "
import json, sys
d = json.load(sys.stdin)
print('decision:', d['decision'])
if d['decision'] not in ('accepted', 'needs_clarification'):
sys.exit(1)
"
- name: Dispatch CLI smoke-test
env:
SPECSMITH_NO_AUTO_UPDATE: "1"
SPECSMITH_PYPI_CHECKED: "1"
run: |
python -m specsmith dispatch run "improve CAN parse robustness" \
--no-dag --project-dir .