Skip to content

Commit 147b7db

Browse files
authored
Update classroom.yml
1 parent 8e21cf6 commit 147b7db

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

.github/workflows/classroom.yml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,49 @@ jobs:
2121
with:
2222
distribution: 'temurin'
2323
java-version: '25'
24-
- uses: actions/checkout@v5
25-
- name: Run autograder
26-
id: grading
27-
uses: education/autograding@v1
24+
- uses: actions/checkout@v5
25+
26+
# 🧪 Compilation
27+
- name: Compilation Check
28+
id: compile
29+
run: mvn -ntp compile
30+
31+
# ✅ Basic functionality
32+
- name: Basic Tests
33+
id: basic
34+
run: mvn -ntp test -Dtest=BasicTest
35+
36+
# ⚠️ Optional edge cases
37+
- name: Edge Case Tests
38+
id: edge
2839
continue-on-error: true
29-
- name: Fail if critical tests failed
40+
run: mvn -ntp test -Dtest=EdgeCaseTest
41+
42+
# 🧮 Scoring and conditional failure
43+
- name: Calculate and Report Points
3044
run: |
31-
RESULTS=".autograding/results.json"
32-
if jq -e '.tests[] | select(.name == "Compilation Check" and .status != "passed")' "$RESULTS"; then
45+
POINTS=0
46+
MAX=3
47+
48+
if [ "${{ steps.compile.outcome }}" == "success" ]; then
49+
POINTS=$((POINTS + 1))
50+
else
3351
echo "❌ Compilation failed"
3452
exit 1
3553
fi
36-
if jq -e '.tests[] | select(.name == "Basic Tests" and .status != "passed")' "$RESULTS"; then
54+
55+
if [ "${{ steps.basic.outcome }}" == "success" ]; then
56+
POINTS=$((POINTS + 1))
57+
else
3758
echo "❌ Basic tests failed"
3859
exit 1
3960
fi
61+
62+
if [ "${{ steps.edge.outcome }}" == "success" ]; then
63+
POINTS=$((POINTS + 1))
64+
fi
65+
66+
echo "Points ${POINTS}/${MAX}"
4067
ai_feedback:
4168
name: AI-Powered Feedback
4269
needs: autograding

0 commit comments

Comments
 (0)