@@ -32,18 +32,38 @@ jobs:
32
32
uses : dorny/test-reporter@v2
33
33
with :
34
34
name : JUnit Results
35
- path : " **/target/surefire-reports/**/* .xml"
35
+ path : " **/target/surefire-reports/*.xml"
36
36
reporter : java-junit
37
37
fail-on-empty : false
38
+ fail-on-error : false
38
39
39
- - name : Report score back to Classroom
40
- uses : github-education-resources/autograding-command-grader@v1
40
+ - name : Calculate total tests
41
+ id : calc-total
42
+ run : |
43
+ passed=${{ steps.parse.outputs.passed || 0 }}
44
+ failed=${{ steps.parse.outputs.failed || 0 }}
45
+ skipped=${{ steps.parse.outputs.skipped || 0 }}
46
+ total=$((passed + failed + skipped))
47
+ echo "total=$total" >> $GITHUB_OUTPUT
48
+
49
+ - name : Grade JUnit test scores
50
+ id : grade-junit
51
+ uses : cbfacademy/autograding-command-grader@dev
41
52
with :
42
53
test-name : JUnit-Suite
43
54
command : |
44
- if [ -z "$(find . -path '**/target/surefire-reports/**/*.xml' -type f)" ]; then
45
- echo "Passed 0 of 0 tests"
46
- else
47
- echo "Passed ${{ steps.parse.outputs.passed }} of ${{ steps.parse.outputs.total }} tests"
48
- fi
49
- max-score : ${{ steps.parse.outputs.total || 0 }}
55
+ ./.github/workflows/grade-junit.sh ${{ steps.parse.outputs.passed || 0 }} ${{ steps.parse.outputs.failed || 0 }} ${{ steps.parse.outputs.skipped || 0 }}
56
+ max-score : 70
57
+
58
+ - name : Test output
59
+ run : |
60
+ result=$(echo "${{steps.grade-junit.outputs.result}}" | base64 -d)
61
+ echo "GRADE-JUNIT_RESULTS: $result"
62
+
63
+ - name : Autograding Reporter
64
+ uses : cbfacademy/autograding-grading-reporter@dev
65
+ env :
66
+ GRADE-JUNIT_RESULTS : " ${{steps.grade-junit.outputs.result}}"
67
+ with :
68
+ runners : grade-junit
69
+
0 commit comments