Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse groups #14

Closed
wants to merge 7 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 28 additions & 7 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ APT_DEPENDENCIES=$1
CODECOV_TOKEN=$2
CMAKE_ARGS=$3

SOURCE_DEPENDENCIES=".github/ci-bionic/dependencies.yaml"
SCRIPT_BEFORE_CMAKE="../.github/ci-bionic/before_cmake.sh"
SCRIPT_BETWEEN_CMAKE_MAKE="../.github/ci-bionic/between_cmake_make.sh"
SCRIPT_AFTER_MAKE="../.github/ci-bionic/after_make.sh"
SCRIPT_AFTER_MAKE_TEST="../.github/ci-bionic/after_make_test.sh"
SOURCE_DEPENDENCIES="`pwd`/.github/ci-bionic/dependencies.yaml"
SCRIPT_BEFORE_CMAKE="`pwd`/.github/ci-bionic/before_cmake.sh"
SCRIPT_BETWEEN_CMAKE_MAKE="`pwd`/.github/ci-bionic/between_cmake_make.sh"
SCRIPT_AFTER_MAKE="`pwd`/.github/ci-bionic/after_make.sh"
SCRIPT_AFTER_MAKE_TEST="`pwd`/.github/ci-bionic/after_make_test.sh"

cd $GITHUB_WORKSPACE

echo ::group::Dependencies from binaries
apt update
apt -y install wget lsb-release gnupg
sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" > /etc/apt/sources.list.d/gazebo-stable.list'
Expand All @@ -31,18 +32,25 @@ apt -y install \
$APT_DEPENDENCIES

pip3 install -U pip vcstool colcon-common-extensions
echo ::endgroup::

echo ::group::GCC 8
update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-8 800 \
--slave /usr/bin/g++ g++ /usr/bin/g++-8 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-8
echo ::endgroup::

git clone https://github.com/linux-test-project/lcov.git -b v1.14
echo ::group::Install LCOV
git clone https://github.com/linux-test-project/lcov.git -b v1.14 2>&1
cd lcov
make install
cd ..
echo ::endgroup::

sh tools/code_check.sh
echo ::group::Code check
sh tools/code_check.sh 2>&1
echo ::endgroup::

echo ::group::Dependencies from source
if [ -f "$SOURCE_DEPENDENCIES" ] ; then
Expand All @@ -56,38 +64,50 @@ fi

mkdir build
cd build
echo ::endgroup::

echo ::group::Script before cmake
if [ -f "$SCRIPT_BEFORE_CMAKE" ] ; then
. $SCRIPT_BEFORE_CMAKE
fi
echo ::endgroup::

echo ::group::cmake
if [ ! -z "$CODECOV_TOKEN" ] ; then
cmake .. $CMAKE_ARGS -DCMAKE_BUILD_TYPE=coverage
else
cmake .. $CMAKE_ARGS
fi
echo ::endgroup::

echo ::group::Script between cmake and make
if [ -f "$SCRIPT_BETWEEN_CMAKE_MAKE" ] ; then
. $SCRIPT_BETWEEN_CMAKE_MAKE 2>&1
fi
echo ::endgroup::

echo ::group::make
make
echo ::endgroup::

echo ::group::Script after make
if [ -f "$SCRIPT_AFTER_MAKE" ] ; then
. $SCRIPT_AFTER_MAKE 2>&1
fi
echo ::endgroup::

echo ::group::make test
export CTEST_OUTPUT_ON_FAILURE=1
make test
echo ::endgroup::

echo ::group::Script after make test
if [ -f "$SCRIPT_AFTER_MAKE_TEST" ] ; then
. $SCRIPT_AFTER_MAKE_TEST 2>&1
fi
echo ::endgroup::

echo ::group::codecov
if [ ! -z "$CODECOV_TOKEN" ] ; then
make coverage VERBOSE=1

Expand All @@ -96,3 +116,4 @@ if [ ! -z "$CODECOV_TOKEN" ] ; then
# disable gcov output with `-X gcovout -X gcov`
bash codecov.sh -t $CODECOV_TOKEN -X gcovout -X gcov
fi
echo ::endgroup::