-
Notifications
You must be signed in to change notification settings - Fork 10
/
.gitlab-ci.yml
81 lines (66 loc) · 3.08 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
# The following block is needed for the shared Docker-based runner
# For local runners you might want to enable the overlay driver:
# https://docs.gitlab.com/ce/ci/docker/using_docker_build.html#using-the-overlayfs-driver
image: docker:git # docker and git clients
# enable docker-in-docker
services:
- docker:dind
# The docker runner does not expose /tmp to the docker-in-docker service
# This config ensures that the temp folder is located inside the project directory (e.g. for prerelease tests or SSH agent forwarding)
variables:
TMPDIR: "${CI_PROJECT_DIR}.tmp"
# Create a upstream workspace with the dependencies from the specified repos file
UPSTREAM_WORKSPACE: ".ci.repos"
ROS_DISTRO: "melodic"
# This causes too much output by default and the Gitlab log output is truncated
# VERBOSE_OUTPUT: "true"
VERBOSE_TESTS: "true"
# repos file content to ensure the rll_sdk dependency is installed
PROJECT_REPOS_FILENAME: ".ci.repos" # Used to generate the file if it does not exist
REPOS_SDK: "{repositories: {rll_sdk: {type: git, url: 'https://gitlab.ipr.kit.edu/rll/rll_sdk.git', version: 'master'}}}"
before_script:
- apk add --update bash coreutils tar # install industrial_ci dependencies
- git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci .industrial_ci
# create the .repos file if it does not exist
- test ! -f ${PROJECT_REPOS_FILENAME} && echo ${REPOS_SDK} >> ${PROJECT_REPOS_FILENAME}
- sed -i 's/https\:\/\/gitlab\.ipr\.kit\.edu/https\:\/\/gitlab-ci-token\:'${CI_JOB_TOKEN}'\@gitlab\.ipr\.kit\.edu/g' ${CI_PROJECT_DIR}/${PROJECT_REPOS_FILENAME}
# download config files if they do not exist
- test ! -f .clang-format && wget https://gitlab.ipr.kit.edu/rll/rll_sdk/raw/master/.clang-format
- test ! -f .clang-tidy && wget https://gitlab.ipr.kit.edu/rll/rll_sdk/raw/master/.clang-tidy
- test ! -f .flake8 && wget https://gitlab.ipr.kit.edu/rll/rll_sdk/raw/master/.flake8
- test ! -f .pylintrc && wget https://gitlab.ipr.kit.edu/rll/rll_sdk/raw/master/.pylintrc
# Format checks are run for every branch regardless of the ROS_DISTRO
format-check:
variables:
# run clang format check
CLANG_FORMAT_VERSION: "6.0"
CLANG_FORMAT_CHECK: "file"
AFTER_SCRIPT: "apt -yq install python-pip && pip -q install flake8 && python -m flake8"
script: .industrial_ci/gitlab.sh
tags:
- docker # use docker runner
kinetic-build-rostests:
variables:
ROS_DISTRO: "kinetic" # override ROS_DISTRO variable
AFTER_SETUP_UPSTREAM_WORKSPACE: "apt -yq install python-pip && pip -q install typing"
# run default -> build
script: .industrial_ci/gitlab.sh
tags:
- docker
melodic-build-rostests:
# run default -> build
script: .industrial_ci/gitlab.sh
tags:
- docker
warningbuild-linting:
variables:
ADDITIONAL_DEBS: "python-pip clang-tidy-7 clang-7"
CATKIN_LINT: "pedantic"
CATKIN_LINT_ARGS: "--ignore unknown_package --ignore unknown_depend"
CMAKE_ARGS: "-DCMAKE_CXX_FLAGS=-Werror"
NOT_TEST_BUILD: "true"
AFTER_SCRIPT: .ci/linting.sh
# run default -> build
script: .industrial_ci/gitlab.sh
tags:
- docker