forked from gitschooldude/hello
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
56 lines (48 loc) · 1.08 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
stages:
- Build
- Run
- Verify
Build code:
only:
- merge_requests
image: gcc
stage: Build
script:
- make
artifacts:
paths:
- hello
Nominal Run:
only:
- merge_requests
image: gcc
stage: Run
script:
- ./hello | tee output/nominal.txt
artifacts:
paths:
- output
Cmd-line Run:
only:
- merge_requests
image: gcc
stage: Run
script:
- ./hello a b c d e f g h i j k l m n o p q r s t u v w x y z
artifacts:
paths:
- output
Nominal Width Check:
only:
- merge_requests
stage: Verify
script:
- "ls output/nominal.txt" # File must exist
- "! grep 'Width: [^2]' output/nominal.txt" # If any width is not 4, fail
Cmd-line Length Check:
only:
- merge_requests
stage: Verify
script:
- "ls output/[abcdefghijklmnopqrstuvwxyz].txt" # Files must exist
- "! grep 'Length: [^1]' output/[abcdefghijklmnopqrstuvwxyz].txt" # If any length is not 3, fail