forked from zserge/jsmn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
83 lines (79 loc) · 2.53 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
# image: gcc has a bad version of lcov
# image: ubuntu needs to update tzdata noninteractively
image: ubuntu
build:
stage: build
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update && apt-get -y install build-essential cmake libcmocka-dev
script:
- cmake -DCMAKE_BUILD_TYPE=Debug ./
- make
artifacts:
paths:
- tests/jsmn_test_*
- tests/CMakeFiles/jsmn_test_*/*.gcda
- tests/CMakeFiles/jsmn_test_*/*.gcno
# depending on your build setup it's most likely a good idea to cache outputs to reduce the build time
# cache:
# paths:
# - "*.o"
doxygen:
stage: build
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update && apt-get -y install build-essential cmake doxygen
script:
- cmake -DCMAKE_BUILD_TYPE=Debug ./
- make jsmn_doc
artifacts:
paths:
- doxygen/
only:
- master
# run tests using the binary built before
test:
stage: test
needs: ["build"]
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update && apt-get -y install libcmocka-dev gcovr lcov
script:
- mkdir junit
- CMOCKA_XML_FILE='junit/%g.xml' CMOCKA_MESSAGE_OUTPUT=xml tests/jsmn_test_default
- CMOCKA_XML_FILE='junit/%g.xml' CMOCKA_MESSAGE_OUTPUT=xml tests/jsmn_test_default_low_memory
- CMOCKA_XML_FILE='junit/%g.xml' CMOCKA_MESSAGE_OUTPUT=xml tests/jsmn_test_default_mult_json_fail
- CMOCKA_XML_FILE='junit/%g.xml' CMOCKA_MESSAGE_OUTPUT=xml tests/jsmn_test_permissive
- CMOCKA_XML_FILE='junit/%g.xml' CMOCKA_MESSAGE_OUTPUT=xml tests/jsmn_test_permissive_low_memory
- CMOCKA_XML_FILE='junit/%g.xml' CMOCKA_MESSAGE_OUTPUT=xml tests/jsmn_test_permissive_mult_json_fail
after_script:
- mkdir coverage
- lcov --capture --base-directory . --directory . --output-file coverage/coverage.info
- genhtml coverage/coverage.info --output-directory coverage
- mkdir cobertura
- gcovr -r . --xml-pretty -o cobertura/coverage.xml
coverage: /^\s+lines\.+:\s(\d+\.\d\%)\s\(.*lines\)$/
artifacts:
paths:
- coverage/
reports:
cobertura:
- cobertura/coverage.xml
junit:
- junit/jsmn_test_*.xml
pages:
stage: deploy
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update && apt-get -y install rsync
script:
- mkdir -p public/coverage/
- rsync -avP coverage/ public/coverage/
- mkdir -p public/docs/
- rsync -avP doxygen/ public/docs/
artifacts:
paths:
- public
expire_in: 30 days
only:
- master