-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathclassroom_legacy.yml
More file actions
85 lines (73 loc) · 3.35 KB
/
Copy pathclassroom_legacy.yml
File metadata and controls
85 lines (73 loc) · 3.35 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
name: GitHub Classroom Workflow
on: [push, pull_request]
jobs:
build:
name: Autograding
runs-on: ubuntu-18.04
timeout-minutes: 10
steps:
- uses: bazelbuild/setup-bazelisk@v2
- uses: actions/checkout@v2
- uses: actions/checkout@master
with:
repository: 'ee538/Summer22_HW5_CodingGrader'
path: 'coding_grader'
- name: Checkout code & Setup
env:
questions: 1 2 3 4
run: |
for f in $questions; do cp files/${f}/{q.cc,q.h} coding_grader/${f}; done
rm -rf grades
rm -rf ScoresCodingTotal.txt
mkdir grades
- name: Test Q1
if: always()
run: |
echo "--------- student test ---------"
bazel run --config=asan --ui_event_filters=-info,-stdout,-stderr //files/1:student_test 2>&1 | tee ST_Q1res.txt
echo "--------- grader test ---------"
bazel run --config=asan --ui_event_filters=-info,-stdout,-stderr //coding_grader/1:grader_test 2>&1 | tee Q1res.txt
grep "OK" Q1res.txt > Q1res_.txt
- name: Test Q2
if: always()
run: |
echo "--------- student test ---------"
bazel run --config=asan --ui_event_filters=-info,-stdout,-stderr //files/2:student_test 2>&1 | tee ST_Q2res.txt
echo "--------- grader test ---------"
bazel run --config=asan --ui_event_filters=-info,-stdout,-stderr //coding_grader/2:grader_test 2>&1 | tee Q2res.txt
grep "OK" Q2res.txt > Q2res_.txt
- name: Test Q3
if: always()
run: |
echo "--------- student test ---------"
bazel run --config=asan --ui_event_filters=-info,-stdout,-stderr //files/3:student_test 2>&1 | tee ST_Q3res.txt
echo "--------- grader test ---------"
bazel run --config=asan --ui_event_filters=-info,-stdout,-stderr //coding_grader/3:grader_test 2>&1 | tee Q3res.txt
grep "OK" Q3res.txt > Q3res_.txt
- name: Test Q4
if: always()
run: |
echo "--------- student test ---------"
bazel run --config=asan --ui_event_filters=-info,-stdout,-stderr //files/4:student_test 2>&1 | tee ST_Q4res.txt
echo "--------- grader test ---------"
bazel run --config=asan --ui_event_filters=-info,-stdout,-stderr //coding_grader/4:grader_test 2>&1 | tee Q4res.txt
grep "OK" Q4res.txt > Q4res_.txt
- name: Organize the total score (coding questions)
if: always()
run: |
rm -rf grades
rm -rf ScoresCodingTotal.txt
mkdir grades
mv Q*res.txt Q*res_.txt grades
ls coding_grader
python coding_grader/coding_grades_total.py 2>&1 | tee ScoresCodingTotal.txt
# clean temporary files
rm -rf grades
rm -rf ST_*
rm -rf coding_grader
TZ='America/Los_Angeles' date >> ScoresCodingTotal.txt
git config --global user.email "autograder@github.com"
git config --global user.name "autograder"
git add ScoresCodingTotal.txt
git commit -m "Add autograding results"
git push origin HEAD:main -f