forked from PRBonn/kiss-icp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
111 lines (104 loc) · 3.33 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
# 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 --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:
image: ubuntu:22.04
stage: build
before_script:
- apt-get update && apt-get install --no-install-recommends -y g++ cmake make
script:
- cmake -Bbuild src/cpp/kiss_icp/
- cmake --build build -j$(nproc --all)
pip_package:
image: python:3.8
stage: build
script:
- VERBOSE=1 pip install --verbose .
- kiss_icp_pipeline --version
ros1_wrapper:
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
#----- 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
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
- pipx run twine upload --verbose dist/*