-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (59 loc) · 1.83 KB
/
ci.yml
File metadata and controls
68 lines (59 loc) · 1.83 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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
validate:
name: Validate Exercise Files
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Check all exercise files exist
run: |
echo "Checking exercise files..."
files=(
"exercises/grade-1/grade_1.py"
"exercises/grade-2/grade_2.py"
"exercises/grade-3/grade_3.py"
"exercises/grade-4/grade_4.py"
"exercises/grade-5/grade_5.py"
"exercises/grade-6/grade_6.py"
"exercises/grade-7/grade_7.py"
"exercises/grade-8/grade_8.py"
"exercises/grade-9/grade_9_pandas.py"
"exercises/grade-9/grade_9_polars.py"
)
for f in "${files[@]}"; do
if [ ! -f "$f" ]; then
echo "❌ Missing: $f"
exit 1
else
echo "✅ Found: $f"
fi
done
- name: Check syntax of all exercise files
run: |
echo "Checking Python syntax..."
for f in exercises/**/*.py; do
python -m py_compile "$f" && echo "✅ $f" || { echo "❌ Syntax error: $f"; exit 1; }
done
- name: Check resources exist
run: |
if [ ! -f "resources/employees.csv" ]; then
echo "❌ Missing: resources/employees.csv"
exit 1
fi
echo "✅ resources/employees.csv found"
- name: All checks passed
run: echo "🎉 All checks passed!"