-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
63 lines (58 loc) · 1.5 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
image: gcc
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "web"'
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
stages:
- static_analysis
- unit_tests
- build
clang-format:
stage: static_analysis
before_script:
- apt-get update
- apt-get install -y clang-format git
script:
- find . -type f -maxdepth 1 -iname "*.cpp" -o -iname "*.h" | xargs clang-format -i --style=file
- git update-index -q --refresh
- |
git diff-index --exit-code HEAD || {
ret=$?
echo "Inconsistent formatting, please apply patch from artifacts"
git diff > correct-formatting.patch
exit $ret
}
artifacts:
paths:
- correct-formatting.patch
when: on_failure
expire_in: 1 week
allow_failure: true
googletest:
stage: unit_tests
before_script:
- apt-get update
- apt-get install -y git make
script:
- git submodule update --init --recursive
- cd tests
- make
- find . -maxdepth 1 -type f -executable -exec {} \;
allow_failure: false
check_build:
stage: build
before_script:
- apt-get update
- apt-get install -y git make cmake libnl-3-dev libnl-genl-3-dev libpcap-dev
script:
- git clone https://github.com/radiotap/radiotap-library.git
- cd radiotap-library
- mkdir -p .build
- cd .build
- cmake ..
- make -j && make install
- cd ../..
- make -j
allow_failure: false