-
Notifications
You must be signed in to change notification settings - Fork 129
232 lines (208 loc) · 11.3 KB
/
main.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
name: CI
on:
push:
paths-ignore:
- '**/*.md'
- 'doc/*.rst'
pull_request:
paths-ignore:
- '**/*.md'
- 'doc/*.rst'
schedule:
- cron: "0 0 * * *" # every day at midnight
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker://koalaman/shellcheck-alpine
with:
args: /bin/sh -c "shellcheck -x *.sh industrial_ci/scripts/*_ci industrial_ci/src/*.sh industrial_ci/src/*/*.sh"
distro:
strategy:
fail-fast: false
matrix:
distro:
- indigo
- jade
- kinetic
- lunar
- melodic
- noetic
- ardent
- bouncy
- crystal
- dashing
- eloquent
- foxy
- galactic
- humble
- iron
include:
- distro: rolling
ubuntu: jammy
- distro: rolling
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: ardent does not support conditions in package.xml
run: |
echo "BEFORE_BUILD_TARGET_WORKSPACE=sed -i /condition/d /root/target_ws/src/industrial_ci/industrial_ci/package.xml" >> "$GITHUB_ENV"
if: matrix.distro == 'ardent'
- name: set OS_CODE_NAME
run: |
echo "OS_CODE_NAME=${{ matrix.ubuntu }}" >> "$GITHUB_ENV"
if: ${{ matrix.ubuntu }}
- uses: './'
env:
ROS_DISTRO: ${{ matrix.distro }}
ici:
env:
TRACE: true
strategy:
fail-fast: false
matrix:
include:
- {ROS_DISTRO: melodic, TARGET_WORKSPACE: 'industrial_ci/mockups/industrial_ci_testpkg', VERBOSE_OUTPUT: true, CATKIN_LINT: true, AFTER_SCRIPT: '[ "$$(command -v catkin_lint)" = /usr/local/bin/catkin_lint ]'}
- {ROS_DISTRO: melodic, TARGET_WORKSPACE: 'industrial_ci/mockups/industrial_ci_testpkg', CATKIN_LINT: true, ADDITIONAL_DEBS: 'python-catkin-lint', AFTER_SCRIPT: '[ "$$(command -v catkin_lint)" = /usr/bin/catkin_lint ]'}
- {ROS_DISTRO: melodic, TARGET_WORKSPACE: 'industrial_ci/mockups/industrial_ci_testpkg', CMAKE_ARGS: '-DFAIL_CMAKE=true', EXPECT_EXIT_CODE: 1}
- {ROS_DISTRO: melodic, TARGET_WORKSPACE: 'industrial_ci/mockups/industrial_ci_testpkg', CATKIN_LINT: pedantic, EXPECT_EXIT_CODE: 1}
- {ROS_DISTRO: melodic, TARGET_WORKSPACE: 'industrial_ci/mockups/industrial_ci_testpkg', ROSDEP_SKIP_KEYS: "rospy_tutorials rostest", EXPECT_EXIT_CODE: 1}
- {ROS_DISTRO: melodic, TARGET_WORKSPACE: 'industrial_ci/mockups/testpkg_broken_install', EXPECT_EXIT_CODE: 1}
- {ROS_DISTRO: noetic, PRERELEASE: true, TARGET_WORKSPACE: 'industrial_ci/mockups/failing_test', PRERELEASE_REPONAME: "failing_test", EXPECT_EXIT_CODE: 1}
- {ROS_DISTRO: melodic, UPSTREAM_WORKSPACE: debian, AFTER_SCRIPT: 'ccache 2> /dev/null && exit 1; [ "$$?" = "127" ]'}
# Using default file name for ROSINSTALL_FILENAME, test CCACHE, verify cache was filled
- {ROS_DISTRO: kinetic, UPSTREAM_WORKSPACE: file, CCACHE_DIR: '/github/home/.ccache', AFTER_SCRIPT: 'num=($$(ccache -s | grep "files in cache")) && (( num[-1] > 0 ))'}
- {ROS_DISTRO: indigo, UPSTREAM_WORKSPACE: file, USE_DEB: true, EXPECT_EXIT_CODE: 1} # Expected to fail. See https://github.com/ros-industrial/industrial_ci/pull/74
- {ROS_DISTRO: kinetic, UPSTREAM_WORKSPACE: 'https://raw.githubusercontent.com/ros-industrial/industrial_ci/master/.travis.rosinstall'}
- {ROS_DISTRO: kinetic, ADDITIONAL_DEBS: 'ros-melodic-opencv3', DEBUG_BASH: true, EXPECT_EXIT_CODE: 100} # This should fail (trying from a wrong distro).
- {ROS_DISTRO: kinetic, UPSTREAM_WORKSPACE: file, ROSINSTALL_FILENAME: .ci.rosinstall} # Testing arbitrary file name without ROS_DISTRO suffix. As of 6/3/2016 this fails due to https://github.com/ros-industrial/industrial_core/pull/144#issuecomment-223186764
- {ROS_DISTRO: kinetic, UPSTREAM_WORKSPACE: file, ROSINSTALL_FILENAME: .i.do.not.exist, EXPECT_EXIT_CODE: 1}
- {ROS_DISTRO: noetic, AFTER_SCRIPT: 'grep -q ID=ubuntu /etc/os-release && grep -q VERSION_CODENAME=focal /etc/os-release'}
- {ROS_DISTRO: noetic, BEFORE_INIT: 'grep -q ID=debian /etc/os-release && grep -q VERSION_ID=\"10\" /etc/os-release', EXPECT_EXIT_CODE: 1}
- {ROS_DISTRO: noetic, OS_NAME: debian, OS_CODE_NAME: buster, AFTER_SCRIPT: 'grep -q ID=debian /etc/os-release && grep -q VERSION_ID=\"10\" /etc/os-release'}
- {ROS_DISTRO: noetic, OS_NAME: debian, EXPECT_EXIT_CODE: 1}
- {ROS_DISTRO: noetic, OS_NAME: debian, OS_CODE_NAME: focal, EXPECT_EXIT_CODE: 1}
- {ROS_DISTRO: melodic, ROS_REPO: ros, BUILDER: colcon, AFTER_SCRIPT: 'rosenv && [ "$$CMAKE_PREFIX_PATH" = "/root/target_ws/install/industrial_ci:/opt/ros/melodic" ]'}
- {DOCKER_IMAGE: "ros:noetic", AFTER_INIT: "grep -r ros-testing /etc/apt && ici_exit 1 || ici_exit 2", EXPECT_EXIT_CODE: 2}
- {DOCKER_IMAGE: "ros:noetic", ROS_REPO: testing, AFTER_INIT: "grep -r ros-testing /etc/apt && ici_exit 1 || ici_exit 2", EXPECT_EXIT_CODE: 1}
- {DOCKER_IMAGE: 'ros:noetic', ROS_REPO: ros, NOT_TEST_BUILD: true, DEBUG_BASH: true, VERBOSE_OUTPUT: false, DOCKER_COMMIT: img_temp, POST_PROCESS: 'eval docker image inspect $$DOCKER_COMMIT --format="$$DOCKER_COMMIT:\ \"{{.Size}}\" bytes"'}
- {ROS_DISTRO: noetic, PRERELEASE: true}
- {ROS_DISTRO: noetic, AFTER_SCRIPT: 'rosenv rosrun industrial_ci run_travis', ADDITIONAL_DEBS: "ros-noetic-rosbash"}
- {ROS_DISTRO: foxy, AFTER_SCRIPT: 'rosenv ros2 run industrial_ci run_travis', ADDITIONAL_DEBS: "ros-foxy-ros2run"}
# Are CXXFLAGS correctly passed? These tests should fail due to -Werror (exit code is for catkin tools: 1 and for colcon: 2)
- {ROS_DISTRO: melodic, CXXFLAGS: "-Werror", EXPECT_EXIT_CODE: 1, TARGET_WORKSPACE: 'industrial_ci/mockups/industrial_ci_testpkg'}
- {ROS_DISTRO: noetic, CXXFLAGS: "-Werror", EXPECT_EXIT_CODE: 1, TARGET_WORKSPACE: 'industrial_ci/mockups/industrial_ci_testpkg'}
- {ROS_DISTRO: melodic, CMAKE_ARGS: -DCMAKE_CXX_FLAGS="-Werror", EXPECT_EXIT_CODE: 1, TARGET_WORKSPACE: 'industrial_ci/mockups/industrial_ci_testpkg'}
- {ROS_DISTRO: noetic, CMAKE_ARGS: -DCMAKE_CXX_FLAGS="-Werror", EXPECT_EXIT_CODE: 1, TARGET_WORKSPACE: 'industrial_ci/mockups/industrial_ci_testpkg'}
- {ROS_DISTRO: noetic, BUILDER: colcon, CMAKE_ARGS: -DCMAKE_CXX_FLAGS="-Werror", EXPECT_EXIT_CODE: 2, TARGET_WORKSPACE: 'industrial_ci/mockups/industrial_ci_testpkg'}
- {ROS_DISTRO: melodic, ROS_REPO: main}
- {ROS_DISTRO: noetic, TEST: debians, TARGET_WORKSPACE: ". industrial_ci/mockups/industrial_ci_testpkg"}
# Format tests
- {ROS_DISTRO: indigo, TARGET_WORKSPACE: 'industrial_ci/mockups/format_tests/cpp/LLVM', CLANG_FORMAT_CHECK: 'LLVM', CLANG_FORMAT_VERSION: 3.8}
- {ROS_DISTRO: kinetic, TARGET_WORKSPACE: 'industrial_ci/mockups/format_tests/cpp/LLVM', CLANG_FORMAT_CHECK: 'LLVM'}
- {ROS_DISTRO: kinetic, TARGET_WORKSPACE: 'industrial_ci/mockups/format_tests/cpp/WebKit', CLANG_FORMAT_CHECK: 'LLVM', EXPECT_EXIT_CODE: 1}
- {ROS_DISTRO: kinetic, TARGET_WORKSPACE: 'industrial_ci/mockups/format_tests/cpp/WebKit', CLANG_FORMAT_CHECK: 'file'}
- {ROS_DISTRO: kinetic, TARGET_WORKSPACE: 'industrial_ci/mockups/format_tests/cpp/LLVM', CLANG_FORMAT_CHECK: 'WebKit', EXPECT_EXIT_CODE: 1}
# Tidy
- {ROS_DISTRO: noetic, TARGET_WORKSPACE: 'industrial_ci/mockups/test_clang_tidy', CLANG_TIDY: true}
- {ROS_DISTRO: melodic, TARGET_WORKSPACE: 'industrial_ci/mockups/test_clang_tidy', CLANG_TIDY: pedantic, EXPECT_EXIT_CODE: 1}
- {ROS_DISTRO: melodic, TARGET_WORKSPACE: 'industrial_ci/mockups/test_clang_tidy', CLANG_TIDY: pedantic, CLANG_TIDY_ARGS: "-checks=-*,modernize-use-nullptr", EXPECT_EXIT_CODE: 1}
- {ROS_DISTRO: noetic, PYLINT_ARGS: "--errors-only", PYLINT_EXCLUDE: "sample_talker.py", PYLINT_CHECK: "true"}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: './'
with:
config: ${{toJSON(matrix)}}
outputs:
strategy:
fail-fast: false
matrix:
include:
- {ROS_DISTRO: melodic, TARGET_WORKSPACE: 'industrial_ci/mockups/test_clang_tidy', CLANG_TIDY: pedantic, EXPECT_EXIT_CODE: 1}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: './'
id: ici
with:
config: ${{toJSON(matrix)}}
- name: Check output
run: |
test "${{ steps.ici.outputs.target_test_results}}" = "0" || exit 1
test "${{ steps.ici.outputs.clang_tidy_checks}}" = "1" || exit 1
abicheck:
strategy:
fail-fast: false
matrix:
include:
- repo: 'ros/actionlib'
ref: '38ce66e2ae2ec9c19cf12ab22d57a8134a9285be'
depth: 0 # All history will be cloned
env: {ROS_DISTRO: kinetic, ROS_REPO: ros, ABICHECK_URL: url, ABICHECK_MERGE: true} # actual URL will not be used in the case
- repo: 'ros-industrial/ros_canopen'
ref: '0.7.5'
env: {ROS_DISTRO: kinetic, ROS_REPO: ros, ABICHECK_URL: 'github:ros-industrial/ros_canopen#0.7.1', ABICHECK_MERGE: false, EXPECT_EXIT_CODE: 1}
- repo: 'ros-industrial/ros_canopen'
ref: '0.7.6'
env: {ROS_DISTRO: kinetic, ABICHECK_URL: 'github:ros-industrial/ros_canopen#0.7.5', ABICHECK_MERGE: false}
runs-on: ubuntu-latest
steps:
- name: Checkout external repository
uses: actions/checkout@v3
with:
repository: ${{matrix.repo}}
ref: ${{matrix.ref}}
fetch-depth: ${{matrix.depth}}
- uses: actions/checkout@v3
with:
path: .industrial_ci
- uses: './.industrial_ci/'
env: ${{matrix.env}}
isolated:
env:
ISOLATION: shell
strategy:
fail-fast: false
matrix:
env:
- {ROS_DISTRO: noetic, UBUNTU: 20.04}
- {ROS_DISTRO: noetic, PRERELEASE: true, UBUNTU: 20.04}
- {ROS_DISTRO: noetic, UBUNTU: 20.04, TEST: debians, TARGET_WORKSPACE: ". industrial_ci/mockups/industrial_ci_testpkg"}
- {ROS_DISTRO: foxy, UBUNTU: 20.04}
- {ROS_DISTRO: humble, PRERELEASE: true, UBUNTU: 22.04, TARGET_WORKSPACE: ". github:ros-controls/control_msgs#galactic-devel"}
runs-on: ubuntu-${{matrix.env.UBUNTU}}
steps:
- uses: actions/checkout@v3
- uses: './'
env: ${{matrix.env}}
builders:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
for BUILDER in $(ls industrial_ci/src/builders/*.sh); do
echo "##[group]BUILDER=$BUILDER"
.github/action.sh _FOLDING_TYPE=none DOCKER_IMAGE=ros:noetic BUILDER="$BUILDER" TARGET_WORKSPACE=industrial_ci/mockups/industrial_ci_testpkg
echo "##[endgroup]"
done
test_arm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v1
- uses: './'
env:
DOCKER_IMAGE: 'arm32v7/ros:melodic-ros-core'
BEFORE_INIT: '[[ $(uname -p) == armv7l ]] && exit 42'
EXPECT_EXIT_CODE: 42
run_travis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
sudo apt install -y python3-yaml
industrial_ci/scripts/run_travis
industrial_ci/scripts/run_travis 1