-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (91 loc) · 2.94 KB
/
Copy pathspec-pipeline.yml
File metadata and controls
104 lines (91 loc) · 2.94 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
name: Spec Pipeline CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install pytest
- name: Regenerate deterministic codegen outputs (dry-run)
env:
SHIELDCRAFT_SELFBUILD_ALLOW_DIRTY: '1'
SHIELDCRAFT_PERSONA_ENABLED: '0'
run: |
mkdir -p .selfhost_outputs
python -m src.shieldcraft.engine \
--self-host \
--spec spec/se_dsl_v1.spec.json \
--dry-run \
--emit-preview .selfhost_outputs/selfhost_preview.json
- name: Clean stale bytecode
run: python scripts/ci/clean_pycache.py
- name: Run tests
run: pytest -q
continue-on-error: false
- name: Run self-host tests specifically
env:
SHIELDCRAFT_SELFBUILD_ALLOW_DIRTY: '1'
run: pytest -q tests/selfhost -q
- name: Ensure critical tests exist
run: |
python - <<PY
import pathlib, sys
repo = pathlib.Path('.').resolve()
txt = ''
for p in repo.rglob('*.py'):
try:
txt += p.read_text()
except Exception:
pass
required = [
'test_selfhost_roundtrip_identity',
'test_selfhost_closed_loop_determinism',
'test_sync_authority_compare',
'test_snapshot_detects_change'
]
missing = [r for r in required if r not in txt]
if missing:
print('Missing critical tests:', missing)
sys.exit(2)
print('Critical tests present')
PY
- name: Check generator lockfile version
run: |
python -c "
import json
spec = json.load(open('spec/se_dsl_v1.spec.json'))
lockfile = json.load(open('generators/lockfile.json'))
spec_version = spec['metadata'].get('generator_version', 'missing')
lock_version = lockfile.get('generator_version', 'missing')
if spec_version != lock_version:
print(f'ERROR: Generator version mismatch')
print(f' Spec: {spec_version}')
print(f' Lockfile: {lock_version}')
exit(1)
print(f'Generator version match: {spec_version}')
"
- name: Run spec pipeline dry-run
run: |
if [ -f scripts/verify_spec_pipeline.py ]; then
python -m scripts.verify_spec_pipeline --dry-run || true
fi
continue-on-error: true
- name: Upload test failure summary
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-failures
path: artifacts/test_failures/summary.txt
if-no-files-found: ignore