-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (136 loc) · 4.32 KB
/
test-stubs.yml
File metadata and controls
168 lines (136 loc) · 4.32 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
name: Test Code Stubs
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
schedule:
# Run tests weekly on Sundays at 00:00 UTC
- cron: '0 0 * * 0'
jobs:
test-imports:
runs-on: ubuntu-latest
strategy:
matrix:
project:
- project-01-platform-core
- project-02-feature-store
- project-03-workflow-orchestration
- project-04-model-registry
- project-05-developer-portal
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Cache pip packages
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.project }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install project dependencies
run: |
python -m pip install --upgrade pip
cd projects/${{ matrix.project }}
if [ -f requirements.txt ]; then
pip install -r requirements.txt
fi
pip install pytest pytest-cov pytest-asyncio
- name: Test Python imports
run: |
cd projects/${{ matrix.project }}
python -c "import sys; sys.path.insert(0, 'src'); from pathlib import Path; import importlib.util; [importlib.util.find_spec(p.stem) for p in Path('src').rglob('*.py') if p.stem != '__init__']"
continue-on-error: true
- name: Run stub tests
run: |
cd projects/${{ matrix.project }}
if [ -d "tests" ]; then
pytest tests/ -v --tb=short || echo "Some tests expected to fail in stubs"
fi
continue-on-error: true
validate-structure:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate project structure
run: |
echo "Validating repository structure..."
# Check required directories exist
required_dirs=(
"projects"
"lessons"
"assessments"
"resources"
"progress"
"community"
)
for dir in "${required_dirs[@]}"; do
if [ ! -d "$dir" ]; then
echo "ERROR: Required directory '$dir' not found"
exit 1
fi
done
# Check each project has required files
for project in projects/project-*; do
echo "Checking $project..."
if [ ! -f "$project/README.md" ]; then
echo "ERROR: Missing README.md in $project"
exit 1
fi
if [ ! -f "$project/requirements.md" ]; then
echo "WARNING: Missing requirements.md in $project"
fi
if [ ! -f "$project/architecture.md" ]; then
echo "WARNING: Missing architecture.md in $project"
fi
if [ ! -d "$project/src" ]; then
echo "ERROR: Missing src/ directory in $project"
exit 1
fi
if [ ! -d "$project/tests" ]; then
echo "WARNING: Missing tests/ directory in $project"
fi
done
echo "Structure validation complete!"
documentation-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check documentation completeness
run: |
echo "Checking documentation..."
# Check main docs exist
if [ ! -f "README.md" ]; then
echo "ERROR: Missing README.md"
exit 1
fi
if [ ! -f "CURRICULUM.md" ]; then
echo "ERROR: Missing CURRICULUM.md"
exit 1
fi
if [ ! -f "CONTRIBUTING.md" ]; then
echo "WARNING: Missing CONTRIBUTING.md"
fi
if [ ! -f "LICENSE" ]; then
echo "WARNING: Missing LICENSE"
fi
# Check module READMEs
for module in lessons/module-*; do
if [ ! -f "$module/README.md" ]; then
echo "WARNING: Missing README.md in $module"
fi
done
echo "Documentation check complete!"
link-checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for broken links
run: |
# Simple check for relative links in markdown files
find . -name "*.md" -type f -exec grep -H "](.*)" {} \; > links.txt || true
echo "Link check complete (manual review required)"
continue-on-error: true