-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
59 lines (54 loc) · 1.41 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
# Use the buildpack dependencies docker image
image: buildpack-deps:xenial
stages:
- build
- test
# Install build dependencies
before_script:
- apt-get update -q=2 && apt-get install --assume-yes cmake -q=2
# Build the application
build:release:
stage: build
script:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release ..
#Gitlab runners tend to have two containers. Source: `nproc -all`
- make -j2
artifacts:
paths:
- build/submission
expire_in: 1 week
#If release fails, try building Debug
build:debug:
stage: test
when: on_failure
script:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Debug ..
#Gitlab runners tend to have two containers. Source: `nproc -all`
- make -j2
artifacts:
paths:
- build/submission
when: on_failure
expire_in: 1 day
#If building release succeeds, test it
test:
stage: test
when: on_success
before_script:
- echo "How many cores do we have? " `nproc --all`
script:
- cd build
#check border values: 32 for space and 125 for }
- ./submission `echo -n " " | sha256sum | cut -d " " -f1`
- ./submission `echo -n "}}" | sha256sum | cut -d " " -f1`
- ./submission `echo -n "xyz" | sha256sum | cut -d " " -f1`
- ./submission `echo -n "dell" | sha256sum | cut -d " " -f1`
dependencies:
- build:release
#so that we only use artifacts:
variables:
GIT_STRATEGY: none