-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
74 lines (70 loc) · 2.24 KB
/
.gitlab-ci.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
stages:
- test
- evaluate
variables:
DOCKER_DRIVER: overlay2
PYTHONUNBUFFERED: 1
public-testcases:
stage: test
image: northaeth/studentdocker:latest
script:
- "echo The project directory is: $CI_PROJECT_DIR"
- "mkdir -p $CI_PROJECT_DIR/.test-out/$CI_JOB_NAME"
- "find $CI_PROJECT_DIR -type f -iname \"*.sh\" -exec chmod +x {} \\;"
- "chmod +x $CI_PROJECT_DIR/compile $CI_PROJECT_DIR/run"
- "$CI_PROJECT_DIR/compile"
- "$CI_PROJECT_DIR/run -i $CI_PROJECT_DIR/inputs/ -o $CI_PROJECT_DIR/.test-out/$CI_JOB_NAME"
artifacts:
paths:
- ".test-out"
interruptible: true
only:
refs:
- master
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
hidden-testcases:
stage: test
image: northaeth/studentdocker:latest
script:
- "echo The project directory is: $CI_PROJECT_DIR"
- "mkdir hidden_inputs/"
- "curl -L https://course.netsec.inf.ethz.ch/iptables_hidden_testcases.tar | tar -xv -C hidden_inputs/"
- "mkdir -p $CI_PROJECT_DIR/.test-out/$CI_JOB_NAME"
- "find $CI_PROJECT_DIR -type f -iname \"*.sh\" -exec chmod +x {} \\;"
- "chmod +x $CI_PROJECT_DIR/compile $CI_PROJECT_DIR/run"
- "$CI_PROJECT_DIR/compile"
- "$CI_PROJECT_DIR/run -i $CI_PROJECT_DIR/hidden_inputs/ -o $CI_PROJECT_DIR/.test-out/$CI_JOB_NAME"
artifacts:
paths:
- ".test-out"
interruptible: true
only:
refs:
- master
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
give-score:
stage: evaluate
image: netsecethz/iptables-evaluator:latest
script:
- "mkdir $CI_PROJECT_DIR/test-results/"
- "mkdir $CI_PROJECT_DIR/all-outputs/"
- "pwd"
- "ls $CI_PROJECT_DIR/.test-out/"
- "rsync -a $CI_PROJECT_DIR/.test-out/public-testcases/ $CI_PROJECT_DIR/all-outputs/"
- "for TESTCASE in `ls $CI_PROJECT_DIR/.test-out/hidden-testcases/`; do cp -r $CI_PROJECT_DIR/.test-out/hidden-testcases/$TESTCASE $CI_PROJECT_DIR/all-outputs/10$TESTCASE; done"
- "ls $CI_PROJECT_DIR/all-outputs/"
- "evaluator -s $CI_PROJECT_DIR/all-outputs/ -o $CI_PROJECT_DIR/test-results/final_result.json"
artifacts:
paths:
- "test-results"
interruptible: true
only:
refs:
- master
except:
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/