forked from ucsb-cs/turnin
-
Notifications
You must be signed in to change notification settings - Fork 8
51 lines (48 loc) · 1.36 KB
/
main.yml
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
name: turnin test suite
on:
push:
paths:
- "src/**"
- "scripts/**"
- "Makefile"
- ".github/workflows/main.yml"
pull_request:
paths:
- "src/**"
- "scripts/**"
- "Makefile"
- ".github/workflows/main.yml"
env:
COURSE: hy999
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo make install
- run: turnin --version
- name: Create user for course
run: |
sudo useradd -m $COURSE
grep $COURSE /etc/passwd
- name: Create TURNIN directory for new user
run: |
sudo -u $COURSE mkdir -p /home/$COURSE/TURNIN/{ex1,ex2}
- name: Turn something in
run: |
whoami
yes | turnin ex1@$COURSE src/turnin.c
- name: Verify turn in
run: |
verify-turnin ex1@$COURSE
sudo -u $COURSE find /home/$COURSE/TURNIN/ex1/
sudo -u $COURSE find /home/$COURSE/TURNIN/ex1/ | grep `whoami` > /dev/null
- name: Verify turn in without submission
run: |
verify-turnin ex2@$COURSE || test $? -ne 0
- name: Verify turn in in non existing directory
run: |
verify-turnin ex3@$COURSE || test $? -ne 0
- name: Verify turn in in non existing course
run: |
verify-turnin ex1@mycourse || test $? -ne 0