-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
131 lines (124 loc) · 2.88 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
stages:
- test
- build
- deploy
.cpp:
image: registry.gitlab.com/signal9/cpp-env:14.0.6
variables:
CCACHE_DIR: "$CI_PROJECT_DIR/.ccache"
CCACHE_BASEDIR: "$CI_PROJECT_DIR"
CCACHE_LOGFILE: "$CI_PROJECT_DIR/ccache.log"
CCACHE_COMPRESS: "1"
CCACHE_COMPRESSLEVEL: "9"
CCACHE_SLOPPINESS: "system_headers,locale,include_file_ctime,include_file_mtime,time_macros"
ASAN_OPTIONS: "alloc_dealloc_mismatch=0"
only:
changes:
- src/**/*
- test/**/*
- meson.build
- conanfile.txt
- conan.lock
- meson_options.txt
- Makefile
cache:
key: "$CI_COMMIT_REF_SLUG-$CI_JOB_NAME"
paths:
- .ccache
before_script:
- conan remote add signal9
https://signal9.jfrog.io/artifactory/api/conan/conan --insert
- conan config set general.revisions_enabled=1
- make check/format
- export CCACHE_DISABLE=1
- make build/conaninfo.txt
- unset CCACHE_DISABLE
after_script:
- ccache --show-stats
- |
to_delete="$(sed -En \
'/(Retrieved|Stored)/s/.*\((.*)\)/\1/gp' \
$CCACHE_LOGFILE | sort -u)
$(find $CCACHE_DIR -type f)"
to_delete=$(echo "$to_delete" | sort | uniq -u)
if [[ -n "$to_delete" ]]; then
rm $to_delete
count_deleted=$(echo "$to_delete" | wc -l)
echo "Removed $count_deleted cache entries"
fi
test-cpp:
extends: .cpp
stage: test
coverage: '/\d+\.\d+%\s+\d+\s+\d+\s+\d+\.\d+%\s+\d+\s+\d+\s+\d+\.\d+%\s+\d+\s+\d+\s+\d+\.\d+%/'
script:
- make build/cov
- make test
- pip install --no-cache-dir pytest
- make test/functional
- make check/cov
- ln -sf /usr/bin/python{3,}
- rm -rf build
- |
pids=$(sed -En \
'/Result: .*miss/s/^\[[^ ]+ ([0-9]+) *\].*/\1/gp' \
$CCACHE_LOGFILE | sort -u)
pids=$(echo $pids | tr ' ' '|')
export CLANG_TIDY_FILES=$(sed -En \
"/^\[[^ ]+ ($pids) *\]/s%.*Source file: (\.\./src/.*\.cpp)$%\1%p" \
$CCACHE_LOGFILE | tr '\n' ' ')
- make check/tidy
build-cpp:
extends: .cpp
stage: build
artifacts:
paths:
- dist
- debug
expire_in: 1 day
script:
- make release
- make install
.js:
image: node
variables:
NODE_ENV: development
only:
changes:
- tools/visualizer/**/*
cache:
key: "$CI_COMMIT_REF_SLUG-js"
paths:
- tools/visualizer/node_modules
before_script:
- cd tools/visualizer
- yarn install
test-js:
extends: .js
stage: test
script:
- yarn lint
- yarn test
build-js:
extends: .js
stage: build
artifacts:
paths:
- tools/visualizer/dist
expire_in: 1 day
script:
- yarn build
pages:
stage: deploy
dependencies:
- build-js
only:
changes:
- tools/visualizer/**/*
refs:
- master
script:
- mkdir public
- mv tools/visualizer/dist public/visualizer
artifacts:
paths:
- public