@@ -8,43 +8,93 @@ image: docker:git # docker and git clients
8
8
services :
9
9
- docker:dind
10
10
11
- # The docker runner does not expose /tmp to the docker-in-docker service
12
- # This config ensures that the temp folder is located inside the project directory (e.g. for prerelease tests or SSH agent forwarding)
13
- variables :
14
- TMPDIR : " ${CI_PROJECT_DIR}.tmp"
15
- UPSTREAM_WORKSPACE : " .ci.rosinstall"
16
-
17
- ROS_DISTRO : " melodic"
18
- ROS_REPO : " ros"
19
-
20
- # rosinstall file content to ensure the rll_sdk dependency is installed
21
- PROJECT_ROSINSTALL_FILENAME : " .ci.rosinstall" # Used to generate the file if it does not exist
22
- ROSINSTALL_SDK_TEMPLATE : " {repositories: {rll_sdk: {type: git, url: 'https://gitlab.ipr.kit.edu/rll/rll_sdk.git', version: master}}}"
23
-
24
- before_script :
25
- - apk add --update bash coreutils tar # install industrial_ci dependencies
26
- - git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci.git .industrial_ci
27
- # create the .rosinstall file if it does not exist
28
- - test ! -f ${PROJECT_ROSINSTALL_FILENAME} && echo ${ROSINSTALL_SDK_TEMPLATE} >> ${PROJECT_ROSINSTALL_FILENAME}
29
- - sed -i 's/https\:\/\/gitlab\.ipr\.kit\.edu/https\:\/\/gitlab-ci-token\:'${CI_JOB_TOKEN}'\@gitlab\.ipr\.kit\.edu/g' ${CI_PROJECT_DIR}/${PROJECT_ROSINSTALL_FILENAME}
30
- # Creating rll_stack config files from samples
31
- - cp rll_common/config/common.yaml.sample rll_common/config/common.yaml
32
- - cp rll_server/config/server.yaml.sample rll_server/config/server.yaml
33
- - cp rll_worker/config/worker.yaml.sample rll_worker/config/worker.yaml
34
- # download config files if they do not exist
35
- - test ! -f .flake8 && wget https://gitlab.ipr.kit.edu/rll/rll_sdk/raw/master/.flake8
36
- - test ! -f .pylintrc && wget https://gitlab.ipr.kit.edu/rll/rll_sdk/raw/master/.pylintrc
37
-
38
11
melodic-build-tests :
39
12
variables :
13
+ # The docker runner does not expose /tmp to the docker-in-docker service
14
+ # This config ensures that the temp folder is located inside the project directory (e.g. for prerelease tests or SSH agent forwarding)
15
+ TMPDIR : " ${CI_PROJECT_DIR}.tmp"
16
+ UPSTREAM_WORKSPACE : " .ci.repos"
17
+ ROS_DISTRO : " melodic"
18
+ ROS_REPO : " ros"
19
+
20
+ # repos file content to ensure the rll_sdk dependency is installed (this is also used as the upstream workspace)
21
+ PROJECT_REPOS_FILENAME : " .ci.repos" # Used to generate the file if it does not exist
22
+ REPOS_SDK_TEMPLATE : " {repositories: {rll_sdk: {type: git, url: 'https://gitlab.ipr.kit.edu/rll/rll_sdk.git', version: master}}}"
23
+
40
24
CATKIN_LINT : " pedantic"
41
25
CATKIN_LINT_ARGS : " --ignore unknown_package --ignore unknown_depend"
26
+ VERBOSE_TESTS : " true"
42
27
# -e = setting ROS_IP variable inside the container
43
28
# -v = turning /var/lib/docker into a volume which is necessary for writing to disk while using aufs storage driver
44
29
# --privileged is needed for running docker in docker (which we do)
45
30
DOCKER_RUN_OPTS : " -e ROS_IP=172.18.0.2 --privileged -v aufsvol:/var/lib/docker"
46
- AFTER_BUILD_TARGET_WORKSPACE : .ci/before_script .sh
31
+ AFTER_BUILD_TARGET_WORKSPACE : .ci/after_build_target_workspace .sh
47
32
AFTER_SCRIPT : .ci/after_script.sh
33
+
34
+ before_script :
35
+ - apk add --update bash coreutils tar # install industrial_ci dependencies
36
+ - git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci.git .industrial_ci
37
+ # create the .repos file if it does not exist
38
+ - test ! -f ${PROJECT_REPOS_FILENAME} && echo ${REPOS_SDK_TEMPLATE} >> ${PROJECT_REPOS_FILENAME}
39
+ - 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}
40
+
41
+ # Create rll_stack config files from samples
42
+ - cp rll_common/config/common.yaml.sample rll_common/config/common.yaml
43
+ - cp rll_server/config/server.yaml.sample rll_server/config/server.yaml
44
+ - cp rll_worker/config/worker.yaml.sample rll_worker/config/worker.yaml
45
+ - test ! -f .pylintrc && wget https://gitlab.ipr.kit.edu/rll/rll_sdk/raw/master/.pylintrc
46
+
47
+
48
+
49
+
48
50
script : .industrial_ci/gitlab.sh
49
51
tags :
50
52
- docker
53
+
54
+ py3_pylint :
55
+ before_script :
56
+ - apk add --no-cache --update python3 python3-dev py3-pip gcc musl-dev libffi-dev build-base
57
+ - pip3 install pylint
58
+ - pip3 install -r rll_server/requirements.txt
59
+ # Install the python modules from their directories (note the trailing slash)
60
+ - pip3 install rll_common/ rll_server/ rll_test/
61
+ - test ! -f .pylintrc && wget https://gitlab.ipr.kit.edu/rll/rll_sdk/raw/master/.pylintrc -O .pylintrc
62
+
63
+ script :
64
+ # Run pylint for every Python3 sub-project separately to get better statistics
65
+ # for directories with an __init__.py you can pass the directory, otherwise specify separate files
66
+ # Tornado handlers set class attributes outside of the __init__ function: W0201 disables this check
67
+ #
68
+ - pylint --rcfile=.pylintrc -d W0201 rll_server/src/rll_server/ rll_server/scripts/*.py
69
+ - pylint --rcfile=.pylintrc rll_common/src/rll_common/ rll_common/scripts/*.py
70
+ - pylint --rcfile=.pylintrc rll_test/src/rll_test/ rll_test/scripts/*.py
71
+
72
+
73
+ py3_flake8 :
74
+ before_script :
75
+ - apk add --no-cache --update python3 python3-dev py3-pip musl-dev libffi-dev build-base
76
+ - pip3 install flake8
77
+ - pip3 install -r rll_server/requirements.txt
78
+ - pip3 install rll_common/ rll_server/ rll_test/
79
+ - test ! -f .flake8 && wget https://gitlab.ipr.kit.edu/rll/rll_sdk/raw/master/.flake8
80
+
81
+ script :
82
+ - python3 -m flake8 rll_server/
83
+ - python3 -m flake8 rll_common/
84
+ - python3 -m flake8 rll_test/
85
+
86
+ mypy :
87
+ before_script :
88
+ # If you want to generate reports, you need to add the commented out dependencies for lxml
89
+ - apk add --no-cache --update python3 python3-dev py3-pip musl-dev libffi-dev build-base # libxml2-dev libxslt-dev
90
+ - pip3 install mypy # lxml
91
+ - pip3 install -r rll_server/requirements.txt
92
+ - pip3 install rll_common/ rll_server/ rll_test/ rll_worker/
93
+
94
+ allow_failure : true
95
+ script :
96
+ # Run mypy for every sub-project separately
97
+ - mypy rll_server/src/ rll_server/scripts/
98
+ - mypy rll_common/src/ rll_common/scripts/
99
+ - mypy rll_test/src/ rll_test/scripts/
100
+ - mypy --py2 rll_worker/src/ rll_worker/scripts
0 commit comments