-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
112 lines (96 loc) · 3.18 KB
/
.gitlab-ci.yml
File metadata and controls
112 lines (96 loc) · 3.18 KB
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
108
109
110
111
112
# Copyright (c) 2020 Timothy Brackett
# Licensed under the MIT license
before_script:
- apt-get update
- apt-get install -y cmake cmake-data curl libncurses-dev libvterm-dev doxygen graphviz tmux valgrind
include:
- template: SAST.gitlab-ci.yml
format:
image: gcc:latest
stage: build
before_script:
- apt-get update
- apt-get install -y clang-format
script:
- make check_format
build:
image: gcc:latest
stage: build
script:
- git submodule init
- git submodule update
- rm -rf build
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE:String=Release -DBUILD_TESTING:Bool=OFF
- cmake --build .
semgrep-sast:
before_script:
- "true"
build_test:
image: gcc:latest
stage: test
script:
- git submodule init
- git submodule update
- rm -rf build_test
- mkdir build_test
- cd build_test
- cmake .. -DCMAKE_BUILD_TYPE:String=Debug -DTEST_COVERAGE:Bool=ON
- cmake --build .
- ../run_in_tmux.sh ctest --schedule-random
- cmake --build . --target coverage
after_script:
- apt-get install -y gcovr
- gcovr --xml-pretty -o coverage.xml --root . --gcov-ignore-parse-errors --print-summary
artifacts:
name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
expire_in: 365 days
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
memcheck:
image: gcc:latest
stage: test
when: manual
script:
- git submodule init
- git submodule update
- rm -rf leak_test
- mkdir leak_test
- cd leak_test
- cmake ../ -DCMAKE_BUILD_TYPE:String=Debug -DUSE_INTERNAL_NCURSES_BUILD:Bool=ON
- cmake --build .
- cmake .
- cmake --build .
- ../run_in_tmux.sh ctest --schedule-random -L memcheck -D ExperimentalMemCheck
- cat Testing/Temporary/MemoryChecker.*.log
- '[ $(cat Testing/Temporary/MemoryChecker.*.log | wc -l) == "0" ]'
coverity-image:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
stage: build
when: manual
before_script:
- 'true'
script:
- /kaniko/executor
--context "${CI_PROJECT_DIR}/.coverity"
--dockerfile "${CI_PROJECT_DIR}/.coverity/Dockerfile"
--build-arg "COVERITY_TOKEN=${COVERITY_TOKEN}"
--destination "registry.gitlab.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/coverity:latest"
coverity:
image: registry.gitlab.com/bracketttc/ncpty/coverity:latest
stage: test
script:
- rm -rf build
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE:String=Release -DBUILD_TESTING:Bool=OFF
- cov-build --dir cov-int make
- tar -jcf ncpty.tbz cov-int
after_script:
- cd build
- curl --form token=${COVERITY_TOKEN} --form email=brackett.tc@gmail.com --form file=@ncpty.tbz --form version=$(grep CMAKE_PROJECT_VERSION:STATIC -r | cut -d = -f 2 | tail -n 1)-$(git rev-parse --short=8 HEAD) --form description="" https://scan.coverity.com/builds?project=bracketttc%2Fncpty