forked from PRBonn/kiss-icp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
149 lines (138 loc) · 4.66 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# MIT License
#
# Copyright (c) 2022 Ignacio Vizzo, Tiziano Guadagnino, Benedikt Mersch, Cyrill
# Stachniss.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
stages:
- format
- build
- deploy
cache:
paths:
- .cache/pip
#----- format stage --------------------------------------------------------------------------------
black:
image: python:3.8
stage: format
before_script:
- pip install black
script:
- black --line-length 100 --check $CI_PROJECT_DIR
clang-format:
image: ubuntu:22.04
stage: format
before_script:
- apt-get update && apt-get install --no-install-recommends -y clang-format
script:
- clang-format -Werror --dry-run $(find . -regextype posix-extended -regex ".*\.(cpp|hpp|h)")
#----- build stage ---------------------------------------------------------------------------------
cpp_api:gcc:
image: ubuntu:22.04
stage: build
before_script:
- apt-get update && apt-get install --no-install-recommends -y g++ cmake make
script:
- cmake -Bbuild cpp/kiss_icp/
- cmake --build build -j$(nproc --all)
cpp_api:clang:
image: ubuntu:22.04
stage: build
before_script:
- apt-get update && apt-get install --no-install-recommends -y clang cmake make
script:
- cmake cmake -DCMAKE_CXX_COMPILER=clang++ -Bbuild cpp/kiss_icp/
- cmake --build build -j$(nproc --all)
pip_package:
image: python:3.8
stage: build
script:
- VERBOSE=1 pip install --verbose ./python/
- kiss_icp_pipeline --version
ros1_melodic:
image: osrf/ros:melodic-desktop-full
stage: build
before_script:
- apt-get update && sudo apt-get install -y gpg wget
- wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
- echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ bionic main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null && apt update
- rm /usr/share/keyrings/kitware-archive-keyring.gpg
- apt-get install -y kitware-archive-keyring
- apt-get install -y cmake
script:
- rm -rf ~/catkin_ws/
- mkdir -p ~/catkin_ws/
- cp -r ${CI_PROJECT_DIR} ~/catkin_ws/src
- cd ~/catkin_ws/
- catkin_make
ros1_noetic:
image: osrf/ros:noetic-desktop-full
stage: build
before_script:
- rm -rf ~/catkin_ws/
- mkdir -p ~/catkin_ws/
- cp -r ${CI_PROJECT_DIR} ~/catkin_ws/src
script:
- cd ~/catkin_ws/
- catkin_make
ros2_foxy:
image: osrf/ros:foxy-desktop
stage: build
script:
- colcon build --event-handlers console_direct+
ros2_humble:
image: osrf/ros:humble-desktop
stage: build
script:
- colcon build --event-handlers console_direct+
#----- deployment stage ----------------------------------------------------------------------------
cibuildwheel:
stage: deploy
image: python:3.8
rules:
- if: $CI_COMMIT_TAG
services:
- name: docker:dind
entrypoint: ["env", "-u", "DOCKER_HOST"]
command: ["dockerd-entrypoint.sh"]
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
script:
- curl -sSL https://get.docker.com/ | sh
- python -m pip install pipx
- pipx run cibuildwheel --output-dir wheelhouse ./python/
artifacts:
paths:
- wheelhouse/
pypi:
stage: deploy
image: python:3.8
needs: ["cibuildwheel"]
rules:
- if: $CI_COMMIT_TAG
variables:
TWINE_PASSWORD: "${PYPI_ACCESS_TOKEN}"
TWINE_USERNAME: "__token__"
script:
- rm -rf dist && mkdir -p dist/ && mv wheelhouse/*.whl dist/
- python -m pip install pipx
- pipx run build --sdist ./python/
- pipx run twine upload --verbose dist/*