Unverified Commit b5b6528f authored by Carlos Mastalli's avatar Carlos Mastalli Committed by GitHub
Browse files

Merge pull request #1028 from loco-3d/topic/increase-ci-coverage

Increase CI coverage: multi-threading, format check
parents 3faee5b6 0a2610b3
Pipeline #17291 passed with stage
in 88 minutes and 49 seconds
......@@ -11,9 +11,23 @@ jobs:
strategy:
matrix:
env:
- {ROS_DISTRO: melodic}
- {ROS_DISTRO: noetic}
- {ROS_DISTRO: noetic, ADDITIONAL_DEBS: clang, CC: clang, CXX: clang++}
# Ubuntu 18.04, g++, Release
- {name: "Bionic / g++ / Release", ROS_DISTRO: melodic}
# Ubuntu 20.04, g++, Release
- {name: "Focal / g++ / Release", ROS_DISTRO: noetic}
# Ubuntu 20.04, clang, Release
- {name: "Focal / clang / Release", ROS_DISTRO: noetic, ADDITIONAL_DEBS: clang, CC: clang, CXX: clang++}
# Ubuntu 20.04, clang, Release, multi-threading
- {name: "Focal / clang / Release / Multi-threading", ROS_DISTRO: noetic, ADDITIONAL_DEBS: clang, CC: clang, CXX: clang++, CMAKE_ARGS: "-DBUILD_WITH_MULTITHREADS=ON -DBUILD_WITH_NTHREADS=2"}
# Format check
- {name: "Format check", ROS_DISTRO: noetic, CLANG_FORMAT_CHECK: file, CLANG_FORMAT_VERSION: "6.0", BEFORE_RUN_CLANG_FORMAT_CHECK: "wget https://raw.githubusercontent.com/Gepetto/linters/master/.clang-format-6.0 -O /tmp/clang_format_check/crocoddyl/.clang-format", ADDITIONAL_DEBS: wget}
## Working configs for Debug mode. However, tests take too long in Debug mode (~1h on a laptop).
## Hence, not active on GitHub Actions
# # Ubuntu 20.04, g++, Debug
# - {name: "Focal / g++ / Debug", ROS_DISTRO: noetic, CMAKE_ARGS: '-DCMAKE_BUILD_TYPE=Debug'}
# Ubuntu 20.04, clang, Debug
- {name: "Focal / clang / Debug", ROS_DISTRO: noetic, ADDITIONAL_DEBS: clang, CC: clang, CXX: clang++, CMAKE_ARGS: '-DCMAKE_BUILD_TYPE=Debug'}
name: ${{ matrix.env.name }}
env:
CCACHE_DIR: /github/home/.ccache # Enable ccache
UPSTREAM_WORKSPACE: dependencies.rosinstall # to build example-robot-data from source as it's not released via the ROS buildfarm
......@@ -37,6 +51,9 @@ jobs:
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}
# Run industrial_ci
- uses: 'ros-industrial/industrial_ci@master'
# Run industrial_ci - use fork until awaits https://github.com/ros-industrial/industrial_ci/issues/767 is resolved
- uses: 'wxmerkt/industrial_ci@topic/clang-format-check-in-deterministic-location'
env: ${{ matrix.env }}
# # Run industrial_ci
# - uses: 'ros-industrial/industrial_ci@master'
# env: ${{ matrix.env }}
language: cpp
os: [
"linux"
]
jobs:
fast_finish: true
include:
- dist: bionic
env: CMAKE_BUILD_TYPE=Debug DIST=bionic CTEST_OUTPUT_ON_FAILURE=1 PYTHONPATH=/opt/openrobots/lib/python2.7/site-packages:$PYTHONPATH
- dist: bionic
env: CMAKE_BUILD_TYPE=Release DIST=bionic CTEST_OUTPUT_ON_FAILURE=1 PYTHONPATH=/opt/openrobots/lib/python2.7/site-packages:$PYTHONPATH
- dist: focal
env: CMAKE_BUILD_TYPE=Debug DIST=focal CTEST_OUTPUT_ON_FAILURE=1 PYTHONPATH=/opt/openrobots/lib/python3.8/site-packages:$PYTHONPATH
- dist: focal
env: CMAKE_BUILD_TYPE=Release DIST=focal CTEST_OUTPUT_ON_FAILURE=1 PYTHONPATH=/opt/openrobots/lib/python3.8/site-packages:$PYTHONPATH
- dist: bionic
env: CHECK_CLANG_FORMAT=1
allow_failures:
- dist: bionic
env: CMAKE_BUILD_TYPE=Debug DIST=bionic CTEST_OUTPUT_ON_FAILURE=1 PYTHONPATH=/opt/openrobots/lib/python2.7/site-packages:$PYTHONPATH
- dist: bionic
env: CMAKE_BUILD_TYPE=Release DIST=bionic CTEST_OUTPUT_ON_FAILURE=1 PYTHONPATH=/opt/openrobots/lib/python2.7/site-packages:$PYTHONPATH
- dist: focal
env: CMAKE_BUILD_TYPE=Debug DIST=focal CTEST_OUTPUT_ON_FAILURE=1 PYTHONPATH=/opt/openrobots/lib/python3.8/site-packages:$PYTHONPATH
- dist: focal
env: CMAKE_BUILD_TYPE=Release DIST=focal CTEST_OUTPUT_ON_FAILURE=1 PYTHONPATH=/opt/openrobots/lib/python3.8/site-packages:$PYTHONPATH
before_install:
- echo "deb [arch=amd64] http://robotpkg.openrobots.org/wip/packages/debian/pub $(lsb_release -sc) robotpkg" | sudo tee -a /etc/apt/sources.list.d/robotpkg.list && echo "deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -sc) robotpkg" | sudo tee -a /etc/apt/sources.list.d/robotpkg.list && curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add -
install:
- sudo apt update -qq
- /bin/bash .travis/install-prerequisites.sh
- export PATH=/opt/openrobots/bin:$PATH
- export PKG_CONFIG_PATH=/opt/openrobots/lib/pkgconfig:$PKG_CONFIG_PATH
- export LD_LIBRARY_PATH=/opt/openrobots/lib:$LD_LIBRARY_PATH
- export CMAKE_PREFIX_PATH=/opt/openrobots:$CMAKE_PREFIX_PATH
- export ROS_PACKAGE_PATH=/opt/openrobots/share
script:
- travis_wait 90 /bin/bash .travis/build-and-test.sh
- travis_wait 60 /bin/bash .travis/check-formatting.sh
#!/bin/bash
set -xe
# Exit if in format testing mode
if [ $CHECK_CLANG_FORMAT ]; then exit 0; fi
mkdir _build ; cd _build
if [ $DIST = focal ]
then
cmake .. -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE -DPYTHON_EXECUTABLE=$(which python3)
else
cmake .. -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE
fi
make -j1
make test
#!/bin/bash
set -xe
# Exit if not in format testing mode
if [ -z $CHECK_CLANG_FORMAT ]; then exit 0; fi
sudo pip install flake8 isort yapf==0.29.0
sudo apt install -y -qq clang-format-6.0
cd $TRAVIS_BUILD_DIR && wget https://raw.githubusercontent.com/Gepetto/linters/master/.clang-format
yapf -ri . && flake8 . && clang-format-6.0 -i $(find . -path ./cmake -prune -o -iregex '.*\.\(h\|c\|hh\|cc\|hpp\|cpp\|hxx\|cxx\)$' -print)
git diff --ignore-submodules
exit $(git diff --ignore-submodules | wc -l)
#!/bin/bash
set -xe
# Exit if in format testing mode
if [ $CHECK_CLANG_FORMAT ]; then exit 0; fi
#sudo apt upgrade -y -qq
if [ $DIST = focal ]
then
sudo apt install -y -qq libeigen3-dev doxygen robotpkg-py38-eigenpy robotpkg-py38-pinocchio robotpkg-py38-example-robot-data python3-scipy
else
sudo apt install -y -qq libeigen3-dev doxygen robotpkg-py27-eigenpy robotpkg-py27-pinocchio robotpkg-py27-example-robot-data python-scipy
fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment