-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (99 loc) · 3.44 KB
/
quality-check.yml
File metadata and controls
120 lines (99 loc) · 3.44 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
name: Curriculum Quality Check
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
syntax-check:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- 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
pip install ruff
pip install pgzero # For weeks 13-18
- name: Syntax Check (compileall)
run: |
# Check all Python files for syntax errors
python -m compileall -q week*/week*.py week*/student_tasks*.py 2>&1 | tee compile_results.txt
if grep -q "SyntaxError" compile_results.txt; then
echo "❌ Syntax errors found!"
exit 1
else
echo "✅ All Python files have valid syntax"
fi
- name: Linting with Ruff
run: |
# Run ruff on all Python files (lenient for educational code)
ruff check week*/week*.py --ignore E501,F841 --format github || true
- name: Check file structure
run: |
echo "📁 Checking curriculum structure..."
# Check that each week has required files
for i in {01..24}; do
week="week${i}_*"
echo "Checking week $i..."
# Find the actual week directory
weekdir=$(ls -d week${i}_* 2>/dev/null | head -1)
if [ -z "$weekdir" ]; then
echo "❌ Week $i directory not found!"
exit 1
fi
# Check for required files
if [ ! -f "$weekdir/teacher_notes.md" ]; then
echo "❌ Missing teacher_notes.md in $weekdir"
exit 1
fi
if [ ! -f "$weekdir/student_tasks.md" ]; then
echo "❌ Missing student_tasks.md in $weekdir"
exit 1
fi
# Check for at least one .py file
if ! ls $weekdir/*.py 1> /dev/null 2>&1; then
echo "❌ No Python file found in $weekdir"
exit 1
fi
echo "✅ Week $i structure valid"
done
echo "✅ All 24 weeks have required files!"
- name: Check documentation exists
run: |
echo "📚 Checking documentation..."
required_docs=(
"docs/QUICKSTART.md"
"docs/TROUBLESHOOTING.md"
"docs/FAQ.md"
"docs/pygame_zero_setup.md"
"docs/microbit_setup.md"
"docs/week6_milestone_rubric.md"
"docs/week12_milestone_rubric.md"
"docs/week18_milestone_rubric.md"
"docs/week24_milestone_rubric.md"
"LICENSE"
"CONTRIBUTING.md"
"CHANGELOG.md"
"requirements.txt"
)
for doc in "${required_docs[@]}"; do
if [ ! -f "$doc" ]; then
echo "❌ Missing required documentation: $doc"
exit 1
fi
done
echo "✅ All required documentation present!"
- name: Summary
if: success()
run: |
echo "🎉 Quality check passed!"
echo "✅ All Python syntax valid across Python ${{ matrix.python-version }}"
echo "✅ All 24 weeks have required files"
echo "✅ All documentation present"