-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
107 lines (97 loc) · 2.23 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# see https://hub.docker.com/_/gcc/
image: gcc
stages:
- install
- build
- build-test
- run-test
- build-example-cgi-hello-world
- run-example-cgi-hello-world
- build-example-cgi-application
- run-example-cgi-application
install:
stage: install
# instead of calling g++ directly you can also use some build toolkit like make
# install the necessary build tools when needed
script:
- apt update && apt -y install make cmake libboost-dev libboost-program-options-dev libgtest-dev
- mkdir -p /usr/src/googletest/googletest/build
- cd /usr/src/googletest/googletest/build
- cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ..
- cmake --build . -- -j
artifacts:
paths:
- build/
cache:
key: builddirs
paths:
- build/
- /usr/src/googletest/googletest/build/
build:
stage: build
script:
- cd "$CI_PROJECT_DIR"
- mkdir -p build
- cd ./build
- cmake -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles" ..
- cmake --build . -- -j
artifacts:
paths:
- build/
cache:
key: builddirs
paths:
- build/
- /usr/src/googletest/googletest/build/
# run tests using the binary built before
build-test:
stage: build-test
script:
- cd $CI_PROJECT_DIR/build
- make webpp-test -j
cache:
key: builddirs
paths:
- build/
run-test:
stage: run-test
script:
- $CI_PROJECT_DIR/build/webpp-test
cache:
key: builddirs
paths:
- build/
build-example-cgi-hello-world:
stage: build-example-cgi-hello-world
script:
- cd $CI_PROJECT_DIR/build
- make cgi-hello-world -j
cache:
key: builddirs
paths:
- build/
run-example-cgi-hello-world:
stage: run-example-cgi-hello-world
script:
- REQUIRES_URI=/ REQUEST_METHOD=GET $CI_PROJECT_DIR/build/cgi-hello-world
cache:
key: builddirs
paths:
- build/
build-example-cgi-application:
stage: build-example-cgi-application
script:
- cd $CI_PROJECT_DIR/build
- make cgi-application -j
cache:
key: builddirs
paths:
- build/
run-example-cgi-application:
stage: run-example-cgi-application
script:
- REQUIRES_URI=/ REQUEST_METHOD=GET $CI_PROJECT_DIR/build/cgi-application
cache:
key: builddirs
paths:
- build/