CI #2598
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
- '**.rst' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '**.rst' | |
schedule: | |
- cron: "0 0 * * *" # every day at midnight | |
jobs: | |
shellcheck: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 | |
- jazzy | |
include: | |
- distro: rolling | |
ubuntu: jammy | |
- distro: rolling | |
ubuntu: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 }} | |
prerelease: | |
strategy: | |
fail-fast: false | |
matrix: | |
ROS_DISTRO: [noetic, humble, jazzy] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: ros industrial-ci | |
uses: './' | |
env: | |
PRERELEASE: true | |
ROS_DISTRO: ${{ matrix.ROS_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, 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@v4 | |
- 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@v4 | |
- 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@v4 | |
with: | |
repository: ${{matrix.repo}} | |
ref: ${{matrix.ref}} | |
fetch-depth: ${{matrix.depth}} | |
- uses: actions/checkout@v4 | |
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@v4 | |
- uses: './' | |
env: ${{matrix.env}} | |
builders: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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@v4 | |
- 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@v4 | |
- run: | | |
sudo apt install -y python3-yaml | |
industrial_ci/scripts/run_travis | |
industrial_ci/scripts/run_travis 1 |