Skip to content
Open
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
3 changes: 3 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
service_name: travis-pro
coverage_clover: coverage.xml
parallel: false
20 changes: 15 additions & 5 deletions .travis/coveralls-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#!/bin/bash

if [ "$TEST_SUITE" == "travis-build.sh" ]; then
lcov --capture --directory . --output-file coverage-all.info > /dev/null
lcov --remove coverage-all.info -o coverage-all.info '/usr/include/*' '/usr/local/include/*' '*/test/*' > /dev/null
export COVERALLS_SERVICE_NAME=travis-pro
coveralls --lcov-file coverage-all.info --exclude '/usr/include' --exclude '/usr/local/include' --exclude-pattern '.*/test/.*' --gcov-options '\-lp' > /dev/null
fi
echo "Generating coverage report..."
lcov --capture --directory . --output-file coverage-all.info > /dev/null 2>&1
lcov --remove coverage-all.info -o coverage-all.info \
'/usr/include/*' '/usr/local/include/*' '*/test/*' > /dev/null 2>&1

echo "Uploading to coveralls.io..."
cpp-coveralls \
--lcov-file coverage-all.info \
--exclude '/usr/include' \
--exclude '/usr/local/include' \
--exclude-pattern '.*/test/.*' \
--gcov-options '\-lp' > /dev/null 2>&1

echo "Coverage upload complete."
fi
48 changes: 33 additions & 15 deletions .travis/install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
#!/bin/bash

set -o errtrace
set -x

git clone https://github.com/eddyxu/cpp-coveralls
pushd cpp-coveralls
sudo ./setup.py install
popd
python3 -m pip install --upgrade --user pip setuptools wheel packaging
python3 -m pip install --upgrade --user cpp-coveralls PyYAML
export PATH="$HOME/.local/bin:$PATH"

# Patch cpp-coveralls for PyYAML Loader API
COVERALLS_INIT=$(python3 -c "import site, os; print(os.path.join(site.getusersitepackages(), 'cpp_coveralls', '__init__.py'))")
sed -i 's/yaml.load(fp)/yaml.safe_load(fp)/' "$COVERALLS_INIT"

# Install .deb artifacts
wget https://travisci-static-artifacts-dd485362-9714-11ea-bb37-0242ac130002.s3.us-east-2.amazonaws.com/artifacts.tgz
tar -xvzf artifacts.tgz
sudo dpkg -i jammy/libnoiro-openvswitch_2.12.0-1_amd64.deb
sudo dpkg -i jammy/libnoiro-openvswitch-dev_2.12.0-1_amd64.deb
sudo dpkg -i prometheus-cpp_1.0.1_amd64.deb

# Ensure pkgconfig dir exists
sudo mkdir -p /usr/local/share/pkgconfig

# Build grpc
mkdir -p ../grpc
pushd ../grpc
if ! [ "$(ls -A .)" ]; then
Expand All @@ -23,20 +30,31 @@ if ! [ "$(ls -A .)" ]; then
mkdir -p cmake/build
pushd cmake/build
cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local \
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF -DgRPC_BUILD_CSHARP_EXT=OFF -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF -DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF -DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF ../..
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF -DgRPC_BUILD_CSHARP_EXT=OFF -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF -DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF -DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF ../..
make -j4
sudo make install
popd
popd
else
echo "using cached grpc"
pushd grpc
# Ensure cmake/build exists + is configured
mkdir -p cmake/build
pushd cmake/build
if [ ! -f Makefile ]; then
cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local ../..
make -j4
fi
sudo make install
popd
popd
fi
pushd grpc/cmake/build
sudo make install
sudo cp ../../third_party/re2/re2.pc /usr/local/share/pkgconfig/
sudo cp third_party/protobuf/*.pc /usr/local/share/pkgconfig/
sudo cp libs/opt/pkgconfig/*.pc /usr/local/share/pkgconfig/
popd
popd

# Copy .pc files
sudo cp ../grpc/third_party/re2/re2.pc /usr/local/share/pkgconfig/
sudo cp ../grpc/third_party/protobuf/*.pc /usr/local/share/pkgconfig/
sudo cp ../grpc/libs/opt/pkgconfig/*.pc /usr/local/share/pkgconfig/

popd