-
Notifications
You must be signed in to change notification settings - Fork 2
135 lines (111 loc) · 3.58 KB
/
Copy pathversion-audit.yml
File metadata and controls
135 lines (111 loc) · 3.58 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
name: Version Audit
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
audit-versions:
name: Audit Version Consistency
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Install Python dependencies
run: pip install pyyaml pydantic
- name: Run version audit
run: python3 ./scripts/audit-versions.py --verbose
- name: Compare versions by package
run: python3 ./scripts/compare-versions.py --by-package
if: always()
- name: Check for version mismatches
run: |
# Run audit and capture exit code
python3 ./scripts/audit-versions.py > /tmp/audit.log 2>&1 || EXIT_CODE=$?
# Check if any failures occurred
if grep -q "check(s) failed" /tmp/audit.log; then
echo "Version audit failed - mismatches detected"
cat /tmp/audit.log
exit 1
else
echo "Version audit passed"
cat /tmp/audit.log
exit 0
fi
validate-manifests:
name: Validate Package Manifests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Install Python dependencies
run: pip install pyyaml pydantic
- name: Validate manifest YAML format
run: |
python3 -c "
import yaml
import sys
from pathlib import Path
issues = 0
for manifest in Path('packages').glob('*/manifest.yaml'):
try:
with open(manifest) as f:
data = yaml.safe_load(f)
if 'version' not in data:
print(f'{manifest}: Missing version field')
issues += 1
else:
print(f'{manifest}: version={data[\"version\"]}')
except Exception as e:
print(f'{manifest}: Parse error - {e}')
issues += 1
if issues > 0:
sys.exit(1)
"
changelog-check:
name: Check for CHANGELOGs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Verify CHANGELOG files exist
run: |
python3 -c "
import sys
from pathlib import Path
missing = 0
packages_dir = Path('packages')
if not packages_dir.exists():
print('No packages directory found')
sys.exit(0)
for package in packages_dir.iterdir():
if package.is_dir():
changelog = package / 'CHANGELOG.md'
if not changelog.exists():
print(f'Warning: Missing CHANGELOG.md in {package.name}')
missing += 1
else:
print(f'Found CHANGELOG.md in {package.name}')
if missing > 0:
print()
print(f'Note: {missing} missing CHANGELOG(s) are warnings, not failures.')
print('Please create CHANGELOG.md for consistency with semantic versioning.')
"