forked from ros2/ros2_tracing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
134 lines (123 loc) · 4.24 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
132
133
134
variables:
DOCKER_DRIVER: overlay2
PACKAGES_LIST: ros2trace tracetools tracetools_launch tracetools_read tracetools_test tracetools_trace test_tracetools
BASE_IMAGE_ID: registry.gitlab.com/ros-tracing/ci_base
DISTRO: rolling
stages:
- build
- test
- report
.before_script_build: &before_script_build
before_script:
- vcs import < instrumented.repos
- . /root/ws/install/setup.sh
.build_artifacts: &build_artifacts
artifacts:
paths:
- install/
- build/
.test_artifacts: &test_artifacts
artifacts:
paths:
- build/*/test_results/*/*.xunit.xml
- build/*/pytest.xml
reports:
junit:
- build/*/test_results/*/*.xunit.xml
- build/*/pytest.xml
# Normal build with LTTng installed
tracing_enabled:build:
stage: build
image: $BASE_IMAGE_ID:$DISTRO
<<: *before_script_build
script:
- lttng --version && apt list lttng-tools liblttng-ust-dev python3-lttng python3-babeltrace
- colcon build --event-handlers console_cohesion+ --packages-up-to $PACKAGES_LIST
<<: *build_artifacts
tracing_enabled:test:
stage: test
image: $BASE_IMAGE_ID:$DISTRO
needs:
- tracing_enabled:build
dependencies:
- tracing_enabled:build
script:
- (source install/setup.sh && ./build/tracetools/status)
- . /root/ws/install/local_setup.sh
- colcon test --event-handlers console_direct+ --executor sequential --retest-until-pass 2 --packages-select $PACKAGES_LIST
- colcon test-result --all --verbose
<<: *test_artifacts
# Build with LTTng installed but tracing disabled
tracing_disabled:build:
stage: build
image: $BASE_IMAGE_ID:$DISTRO
<<: *before_script_build
script:
- colcon build --event-handlers console_cohesion+ --cmake-args " -DTRACETOOLS_DISABLED=ON" --packages-up-to $PACKAGES_LIST
<<: *build_artifacts
tracing_disabled:test:
stage: test
image: $BASE_IMAGE_ID:$DISTRO
needs:
- tracing_disabled:build
dependencies:
- tracing_disabled:build
script:
- (source install/setup.sh && (! ./build/tracetools/status))
- . /root/ws/install/local_setup.sh
- colcon test --event-handlers console_direct+ --executor sequential --retest-until-pass 2 --packages-select $PACKAGES_LIST
- colcon test-result --all --verbose
<<: *test_artifacts
# Normal build without LTTng being installed
no_lttng:build:
stage: build
image: $BASE_IMAGE_ID:$DISTRO-base
<<: *before_script_build
script:
- colcon build --event-handlers console_cohesion+ --packages-up-to $PACKAGES_LIST
<<: *build_artifacts
no_lttng:test:
stage: test
image: $BASE_IMAGE_ID:$DISTRO-base
needs:
- no_lttng:build
dependencies:
- no_lttng:build
script:
- (source install/setup.sh && (! ./build/tracetools/status))
- (source install/setup.sh && (! ros2 trace))
- . /root/ws/install/local_setup.sh
- colcon test --event-handlers console_direct+ --executor sequential --retest-until-pass 2 --packages-select $PACKAGES_LIST
- colcon test-result --all --verbose
<<: *test_artifacts
# Coverage job (with LTTng)
coverage:
stage: report
image: $BASE_IMAGE_ID:$DISTRO
needs:
- tracing_enabled:test
<<: *before_script_build
script:
- colcon build --symlink-install --event-handlers console_cohesion+ --packages-up-to $PACKAGES_LIST --mixin coverage-gcc coverage-pytest --cmake-args -DBUILD_TESTING=ON --no-warn-unused-cli
- colcon lcov-result --initial
- colcon test --event-handlers console_direct+ --executor sequential --retest-until-pass 2 --packages-select $PACKAGES_LIST --mixin coverage-pytest
- colcon test-result --all --verbose
- colcon lcov-result --packages-select tracetools --filter **/tracetools/test/* --verbose
- colcon coveragepy-result --packages-select ros2trace tracetools_launch tracetools_read tracetools_test tracetools_trace --verbose --coverage-report-args -m
- pip3 install -U codecov
- codecov --no-gcov-out --file lcov/total_coverage.info coveragepy/.coverage
allow_failure: true
# DCO-checking job (see CONTRIBUTING.md)
dco:
stage: report
image: $BASE_IMAGE_ID:$DISTRO-base
script:
- pip3 install -U dco-check
- dco-check --verbose --default-branch $DISTRO
# Trigger docs generation
trigger_gen_docs:
stage: report
only:
refs:
- rolling
trigger: ros-tracing/ros2_tracing-api