-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
68 lines (59 loc) · 1.99 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
# This file is a template, and might need editing before it works on your project.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/C++.gitlab-ci.yml
# use the official gcc image, based on debian
# can use verions as well, like gcc:5.2
# see https://hub.docker.com/_/gcc/
image: gcc
stages:
- build
- test
include:
- template: Code-Quality.gitlab-ci.yml
before_script:
- apt update && apt -y install cmake libgpgme-dev libgcrypt-dev libfuse-dev makepasswd encfs python3-pgpdump opensc-pkcs11 libc6-dev pcscd automake libpcsclite-dev libgtk-3-dev libcmocka-dev gcovr
- ln -s /usr/lib/x86_64-linux-gnu/libopensc.so.7.0.0 /usr/lib/x86_64-linux-gnu/libopensc.so
build:
stage: build
script:
- cd build
- GPG_KEY_FINGERPRINT=0102030405060708090A0B0C0D0E0F1011121314 cmake ..
- make install
artifacts:
paths:
- build/bin
# depending on your build setup it's most likely a good idea to cache outputs to reduce the build time
cache:
key: build-cache
paths:
- build/
# run tests using the binary built before
test:
stage: test
script:
- cd build
- CTEST_OUTPUT_ON_FAILURE=1 make test
- gcovr --exclude-unreachable-branches --exclude .*_test\.c --html-details -o coverage.html --root ${CI_PROJECT_DIR}
- gcovr --xml-pretty --exclude-unreachable-branches --exclude .*_test\.c --print-summary -o coverage.xml --root ${CI_PROJECT_DIR}
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
reports:
cobertura: build/coverage.xml
paths:
- build/coverage*.html
cache:
key: build-cache
paths:
- build/
code_quality:
before_script:
- ''
stage: test
variables:
REPORT_FORMAT: html
artifacts:
paths:
- gl-code-quality-report.html