-
Notifications
You must be signed in to change notification settings - Fork 8
/
.gitlab-ci.yml
119 lines (108 loc) · 3.73 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
variables:
CI_SCRIPTS_BRANCH: master
ENABLE_COVERAGE_TESTING: "true"
DEB_BUILD: "false"
DOCS_SOURCE: "ros_bt_py/doc/source"
AFTER_INSTALL_TARGET_DEPENDENCIES: "pip3 install coverage[toml]"
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
stages:
- check
- build
- upload
- deploy
.default_rules:
rules:
- if: '$ROS_DISTRO == "rolling"'
when: on_success
allow_failure: true
- if: '$ROS_DISTRO'
when: on_success
allow_failure: false
.deploy_rules:
rules:
- if: '$DEB_BUILD && $DEB_BUILD == "false"'
when: never
- if: '$UPSTREAM_WORKSPACE != null'
when: never
- if: '$CI_COMMIT_REF_NAME == $UPLOAD_BRANCH_NAME && $CI_APTLY_TOKEN && $CI_APTLY_USERNAME'
- if: '$UPLOAD_BRANCH_NAME == null && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_APTLY_TOKEN && $CI_APTLY_USERNAME'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
.build_matrix:
parallel:
matrix:
- ROS_DISTRO: humble
CI_IMAGE: ids-git.fzi.de:5555/continuous_integration/ci_docker_images/ubuntu_22.04_ros2:humble
- ROS_DISTRO: iron
CI_IMAGE: ids-git.fzi.de:5555/continuous_integration/ci_docker_images/ubuntu_22.04_ros2:iron
- ROS_DISTRO: rolling
CI_IMAGE: ids-git.fzi.de:5555/continuous_integration/ci_docker_images/ubuntu_22.04_ros2:rolling
include:
- project: 'continuous_integration/ci_scripts'
ref: master
file: '/gitlab-ci-yml/ros2_pipeline.yml'
- project: 'continuous_integration/ci_scripts'
ref: master
file: '/gitlab-ci-yml/doc_sphinx.yml'
build_sphinx_doc:
stage: build
needs: []
image: ids-git.fzi.de:5555/continuous_integration/ci_docker_images/ubuntu_22.04_ros2:iron
script:
- export LC_ALL=C.UTF-8
- export LC_LANG=C.UTF-8
- export DEBIAN_FRONTEND=noninteractive
- apt-get update
- apt-get install -y python3-pip python3-sphinx-autodoc-typehints
- pip3 install -U sphinx furo
- apt-get install -f -y
- source /opt/ros/iron/setup.sh
- rosdep update
- rosdep install --from-paths . --ignore-src -r -y
- colcon build --packages-up-to ros_bt_py
- source install/setup.sh
- if [ ! -z "$PYTHON_INSTALL_PACKAGE_PATH" ]; then pip install --user -e $PYTHON_INSTALL_PACKAGE_PATH; fi
- sphinx-build -b html $DOCS_SOURCE doc_public
artifacts:
paths:
- doc_public
pre-commit:
image: $CI_IMAGE
stage: check
variables:
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
script:
- source /opt/ros/${ROS_DISTRO}/setup.bash
- pip3 install pre-commit # install pre-commit
- pre-commit run -a
cache:
paths:
- ${PRE_COMMIT_HOME}
parallel: !reference [.build_matrix, parallel]
rules:
- !reference [.default_rules, rules]
industrial_ci:
after_script:
- ${HOME}/ci_scripts/catkin_build_scripts/python_coverage.sh "/root/target_ws/build" || true
- ${HOME}/ci_scripts/catkin_build_scripts/combine_coverage.sh "/root/target_ws" || true
- gcovr --xml-pretty --exclude-unreachable-branches -o coverage_cpp.xml -e ".*test/.*" -e ".*devel/.*" -e ".*tests/.*" --root /root/target_ws || true
- cp -r /root/target_ws/build ./build
- sed -i 's/\/root\/target_ws\/install\/ros_bt_py\/lib\/python3.10\/site-packages/ros_bt_py\/src/g' coverage_python.xml
rules:
- !reference [.default_rules, rules]
clang_format:
rules:
- !reference [.default_rules, rules]
create_deb_package:
rules:
- !reference [.deploy_rules, rules]
- !reference [.default_rules, rules]
upload_debs:
rules:
- !reference [.deploy_rules, rules]
- !reference [.default_rules, rules]