Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

[1.8.x] Actions for community PRs. #8611

Merged
merged 2 commits into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
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
33 changes: 8 additions & 25 deletions .cicd/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@
set -eo pipefail
. ./.cicd/helpers/general.sh
mkdir -p $BUILD_DIR
CMAKE_EXTRAS="-DCMAKE_BUILD_TYPE='Release' -DENABLE_MULTIVERSION_PROTOCOL_TEST=true"
CMAKE_EXTRAS="-DCMAKE_BUILD_TYPE='Release' -DENABLE_MULTIVERSION_PROTOCOL_TEST=true -DBUILD_MONGO_DB_PLUGIN=true"
if [[ "$(uname)" == 'Darwin' ]]; then
# You can't use chained commands in execute
if [[ "$TRAVIS" == 'true' ]]; then
if [[ "$GITHUB_ACTIONS" == 'true' ]]; then
export PINNED=false
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/1d91e94e8ecdf6877ad2c24a7cda1114e50f2a14/Formula/llvm@4.rb # Workaround for Travis cannot build LLVM4 from source.
brew reinstall openssl@1.1 # Fixes issue where builds in Travis cannot find libcrypto.
ccache -s
CMAKE_EXTRAS="$CMAKE_EXTRAS -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
else
CMAKE_EXTRAS="$CMAKE_EXTRAS -DBUILD_MONGO_DB_PLUGIN=true"
fi
[[ ! "$PINNED" == 'false' ]] && CMAKE_EXTRAS="$CMAKE_EXTRAS -DCMAKE_TOOLCHAIN_FILE=$HELPERS_DIR/clang.make"
cd $BUILD_DIR
Expand All @@ -21,27 +15,16 @@ if [[ "$(uname)" == 'Darwin' ]]; then
echo "make -j$JOBS"
make -j$JOBS
else # Linux
CMAKE_EXTRAS="$CMAKE_EXTRAS -DBUILD_MONGO_DB_PLUGIN=true"
ARGS=${ARGS:-"--rm --init -v $(pwd):$MOUNTED_DIR"}
PRE_COMMANDS="cd $MOUNTED_DIR/build"
# PRE_COMMANDS: Executed pre-cmake
# CMAKE_EXTRAS: Executed within and right before the cmake path (cmake CMAKE_EXTRAS ..)
[[ ! "$IMAGE_TAG" =~ 'unpinned' ]] && CMAKE_EXTRAS="$CMAKE_EXTRAS -DCMAKE_TOOLCHAIN_FILE=$MOUNTED_DIR/.cicd/helpers/clang.make -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
if [[ "$IMAGE_TAG" == 'amazon_linux-2-pinned' ]]; then
PRE_COMMANDS="$PRE_COMMANDS && export PATH=/usr/lib64/ccache:\\\$PATH"
elif [[ "$IMAGE_TAG" == 'centos-7.7-pinned' ]]; then
PRE_COMMANDS="$PRE_COMMANDS && export PATH=/usr/lib64/ccache:\\\$PATH"
elif [[ "$IMAGE_TAG" == 'ubuntu-16.04-pinned' ]]; then
PRE_COMMANDS="$PRE_COMMANDS && export PATH=/usr/lib/ccache:\\\$PATH"
elif [[ "$IMAGE_TAG" == 'ubuntu-18.04-pinned' ]]; then
PRE_COMMANDS="$PRE_COMMANDS && export PATH=/usr/lib/ccache:\\\$PATH"
elif [[ "$IMAGE_TAG" == 'amazon_linux-2-unpinned' ]]; then
PRE_COMMANDS="$PRE_COMMANDS && export PATH=/usr/lib64/ccache:\\\$PATH"
[[ ! "$IMAGE_TAG" =~ 'unpinned' ]] && CMAKE_EXTRAS="$CMAKE_EXTRAS -DCMAKE_TOOLCHAIN_FILE=$MOUNTED_DIR/.cicd/helpers/clang.make"
if [[ "$IMAGE_TAG" == 'amazon_linux-2-unpinned' ]]; then
CMAKE_EXTRAS="$CMAKE_EXTRAS -DCMAKE_CXX_COMPILER='clang++' -DCMAKE_C_COMPILER='clang'"
elif [[ "$IMAGE_TAG" == 'centos-7.7-unpinned' ]]; then
PRE_COMMANDS="$PRE_COMMANDS && source /opt/rh/devtoolset-8/enable && source /opt/rh/rh-python36/enable && export PATH=/usr/lib64/ccache:\\\$PATH"
PRE_COMMANDS="$PRE_COMMANDS && source /opt/rh/devtoolset-8/enable && source /opt/rh/rh-python36/enable"
elif [[ "$IMAGE_TAG" == 'ubuntu-18.04-unpinned' ]]; then
PRE_COMMANDS="$PRE_COMMANDS && export PATH=/usr/lib/ccache:\\\$PATH"
CMAKE_EXTRAS="$CMAKE_EXTRAS -DCMAKE_CXX_COMPILER='clang++' -DCMAKE_C_COMPILER='clang'"
fi
BUILD_COMMANDS="cmake $CMAKE_EXTRAS .. && make -j$JOBS"
Expand All @@ -52,9 +35,9 @@ else # Linux
[[ "$ENABLE_INSTALL" == 'true' ]] && COMMANDS="cp -r $MOUNTED_DIR /root/eosio && cd /root/eosio/build &&"
COMMANDS="$COMMANDS $BUILD_COMMANDS"
[[ "$ENABLE_INSTALL" == 'true' ]] && COMMANDS="$COMMANDS && make install"
elif [[ "$TRAVIS" == 'true' ]]; then
ARGS="$ARGS -v /usr/lib/ccache -v $HOME/.ccache:/opt/.ccache -e JOBS -e TRAVIS -e CCACHE_DIR=/opt/.ccache"
COMMANDS="ccache -s && $BUILD_COMMANDS"
elif [[ "$GITHUB_ACTIONS" == 'true' ]]; then
ARGS="$ARGS -e JOBS"
COMMANDS="$BUILD_COMMANDS"
fi
. $HELPERS_DIR/file-hash.sh $CICD_DIR/platforms/$PLATFORM_TYPE/$IMAGE_TAG.dockerfile
COMMANDS="$PRE_COMMANDS && $COMMANDS"
Expand Down
5 changes: 1 addition & 4 deletions .cicd/platforms/pinned/amazon_linux-2-pinned.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,4 @@ RUN curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r3.4.0.tar.gz -o
cd / && \
rm -rf mongo-cxx-driver-r3.4.0.tar.gz /mongo-cxx-driver-r3.4.0
# add mongodb to path
ENV PATH=${PATH}:/mongodb-linux-x86_64-amazon-3.6.3/bin
# install ccache
RUN curl -LO http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/c/ccache-3.3.4-1.el7.x86_64.rpm && \
yum install -y ccache-3.3.4-1.el7.x86_64.rpm
ENV PATH=${PATH}:/mongodb-linux-x86_64-amazon-3.6.3/bin
8 changes: 1 addition & 7 deletions .cicd/platforms/pinned/centos-7.7-pinned.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,4 @@ RUN curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r3.4.0.tar.gz -o
cd / && \
rm -rf mongo-cxx-driver-r3.4.0.tar.gz /mongo-cxx-driver-r3.4.0
# add mongodb to path
ENV PATH=${PATH}:/mongodb-linux-x86_64-amazon-3.6.3/bin
# install ccache
RUN curl -LO http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/c/ccache-3.3.4-1.el7.x86_64.rpm && \
yum install -y ccache-3.3.4-1.el7.x86_64.rpm
# fix ccache for centos
RUN cd /usr/lib64/ccache && ln -s ../../bin/ccache c++
ENV CCACHE_PATH="/opt/rh/devtoolset-8/root/usr/bin"
ENV PATH=${PATH}:/mongodb-linux-x86_64-amazon-3.6.3/bin
11 changes: 1 addition & 10 deletions .cicd/platforms/pinned/ubuntu-16.04-pinned.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,4 @@ RUN curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r3.4.0.tar.gz -o
cd / && \
rm -rf mongo-cxx-driver-r3.4.0.tar.gz /mongo-cxx-driver-r3.4.0
# add mongodb to path
ENV PATH=${PATH}:/mongodb-linux-x86_64-ubuntu1604-3.6.3/bin
# install ccache
RUN curl -LO https://github.com/ccache/ccache/releases/download/v3.4.1/ccache-3.4.1.tar.gz && \
tar -xzf ccache-3.4.1.tar.gz && \
cd ccache-3.4.1 && \
./configure && \
make && \
make install && \
cd / && \
rm -rf ccache-3.4.1.tar.gz /ccache-3.4.1
ENV PATH=${PATH}:/mongodb-linux-x86_64-ubuntu1604-3.6.3/bin
2 changes: 1 addition & 1 deletion .cicd/platforms/pinned/ubuntu-18.04-pinned.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update && \
autotools-dev libicu-dev python2.7 python2.7-dev python3 \
python3-dev python-configparser python-requests python-pip \
autoconf libtool g++ gcc curl zlib1g-dev sudo ruby libusb-1.0-0-dev \
libcurl4-gnutls-dev pkg-config patch ccache vim-common jq
libcurl4-gnutls-dev pkg-config patch vim-common jq
# build cmake.
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz && \
tar -xzf cmake-3.13.2.tar.gz && \
Expand Down
5 changes: 1 addition & 4 deletions .cicd/platforms/unpinned/amazon_linux-2-unpinned.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,4 @@ RUN curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r3.4.0.tar.gz -o
cd / && \
rm -rf mongo-cxx-driver-r3.4.0.tar.gz /mongo-cxx-driver-r3.4.0
# add mongodb to path
ENV PATH=${PATH}:/mongodb-linux-x86_64-amazon-3.6.3/bin
# install ccache
RUN curl -LO http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/c/ccache-3.3.4-1.el7.x86_64.rpm && \
yum install -y ccache-3.3.4-1.el7.x86_64.rpm
ENV PATH=${PATH}:/mongodb-linux-x86_64-amazon-3.6.3/bin
8 changes: 1 addition & 7 deletions .cicd/platforms/unpinned/centos-7.7-unpinned.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,4 @@ RUN curl -L https://github.com/mongodb/mongo-cxx-driver/archive/r3.4.0.tar.gz -o
cd / && \
rm -rf mongo-cxx-driver-r3.4.0.tar.gz /mongo-cxx-driver-r3.4.0
# add mongodb to path
ENV PATH=${PATH}:/mongodb-linux-x86_64-amazon-3.6.3/bin
# install ccache
RUN curl -LO http://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/c/ccache-3.3.4-1.el7.x86_64.rpm && \
yum install -y ccache-3.3.4-1.el7.x86_64.rpm
# fix ccache for centos
RUN cd /usr/lib64/ccache && ln -s ../../bin/ccache c++
ENV CCACHE_PATH="/opt/rh/devtoolset-8/root/usr/bin"
ENV PATH=${PATH}:/mongodb-linux-x86_64-amazon-3.6.3/bin
2 changes: 1 addition & 1 deletion .cicd/platforms/unpinned/ubuntu-18.04-unpinned.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN apt-get update && \
bzip2 automake libbz2-dev libssl-dev doxygen graphviz libgmp3-dev \
autotools-dev libicu-dev python2.7 python2.7-dev python3 python3-dev \
autoconf libtool g++ gcc curl zlib1g-dev sudo ruby libusb-1.0-0-dev \
libcurl4-gnutls-dev pkg-config patch llvm-4.0 clang ccache vim-common jq
libcurl4-gnutls-dev pkg-config patch llvm-4.0 clang vim-common jq
# build cmake.
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz && \
tar -xzf cmake-3.13.2.tar.gz && \
Expand Down
29 changes: 13 additions & 16 deletions .cicd/submodule-regression-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
set -eo pipefail
declare -A PR_MAP
declare -A BASE_MAP
# Support Travis and BK
if ${TRAVIS:-false}; then
[[ -z $TRAVIS_PULL_REQUEST_BRANCH ]] && echo "Unable to find TRAVIS_PULL_REQUEST_BRANCH ENV. Skipping submodule regression check." && exit 0
BASE_BRANCH=$TRAVIS_BRANCH
CURRENT_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
[[ ! -z $TRAVIS_PULL_REQUEST_SLUG ]] && CURRENT_BRANCH=$TRAVIS_COMMIT # When we're not running from a PR, the slug is not set. When we are, we need to use the TRAVIS_COMMIT to be sure we're supporting the Forked PR's merge/code that's in the EOS repo. This is needed for the git log below.
else

if [[ $BUILDKITE == true ]]; then
[[ -z $BUILDKITE_PULL_REQUEST_BASE_BRANCH ]] && echo "Unable to find BUILDKITE_PULL_REQUEST_BASE_BRANCH ENV. Skipping submodule regression check." && exit 0
BASE_BRANCH=$BUILDKITE_PULL_REQUEST_BASE_BRANCH
CURRENT_BRANCH=$BUILDKITE_BRANCH
else
[[ -z $GITHUB_BASE_REF ]] && echo "Cannot find \$GITHUB_BASE_REF, so we have nothing to compare submodules to. Skipping submodule regression check." && exit 0
BASE_BRANCH=$GITHUB_BASE_REF
CURRENT_BRANCH=$GITHUB_SHA
fi

echo "getting submodule info for $CURRENT_BRANCH"
Expand All @@ -27,17 +26,15 @@ while read -r a b; do
done < <(git submodule --quiet foreach --recursive 'echo $path `git log -1 --format=%ct`')

# We need to switch back to the PR ref/head so we can git log properly
if [[ $TRAVIS == true && ! -z $TRAVIS_PULL_REQUEST_SLUG ]]; then
echo "git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge:"
git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge: 1> /dev/null
echo "switching back to $TRAVIS_COMMIT"
echo 'git checkout -qf FETCH_HEAD'
git checkout -qf FETCH_HEAD 1> /dev/null
elif [[ $BUILDKITE == true ]]; then
echo "switching back to $CURRENT_BRANCH"
git checkout -f $CURRENT_BRANCH 1> /dev/null
if [[ $BUILDKITE != true ]]; then
echo "git fetch origin +$GITHUB_REF:"
git fetch origin +${GITHUB_REF}: 1> /dev/null
fi

echo "switching back to $CURRENT_BRANCH..."
echo "git checkout -qf $CURRENT_BRANCH"
git checkout -qf $CURRENT_BRANCH 1> /dev/null

for k in "${!BASE_MAP[@]}"; do
base_ts=${BASE_MAP[$k]}
pr_ts=${PR_MAP[$k]}
Expand Down
Loading