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

Feature/integrate cpp #33

Merged
merged 6 commits into from
Apr 13, 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
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop

jobs:
build:
runs-on: ubuntu-latest
container: veriblock/btcdev:cpp
env:
CC: gcc
CXX: g++
ALTINTEGRATION_VERSION: eb8d5128a8df6ee7eb96cec042f1c78ed71dc722
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: install alt-integration-cpp
run: |
(
cd /opt;
wget https://github.com/VeriBlock/alt-integration-cpp/archive/${ALTINTEGRATION_VERSION}.tar.gz;
tar -xf ${ALTINTEGRATION_VERSION}.tar.gz;
cd alt-integration-cpp-${ALTINTEGRATION_VERSION};
mkdir build;
cd build;
cmake .. -DCMAKE_BUILD_TYPE=Release -DTESTING=OFF;
make -j2 install
)
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure
--without-gui
--enable-werror
--disable-bench
--disable-tests

# --enable-lcov
# --enable-lcov-branch-coverage

- name: make
run: make -j2
- name: make check
timeout-minutes: 10
run: make check
# - name: Collect coverage
# run: |
# lcov -c -d src -o cov.info
# gcovr --xml cov.xml -j2 -v -s -b -r src
# - name: Run sonarqube
# run: sonar-scanner -Dsonar.login=${{ secrets.SONAR_TOKEN }}
40 changes: 0 additions & 40 deletions .github/workflows/fast.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.tar.gz
.vscode

src/vbk/grpc_integration/*.pb.cc
src/vbk/grpc_integration/*.pb.h
Expand Down Expand Up @@ -149,4 +150,4 @@ compile_commands.json
.cproject
.settings
configure.lineno
*.pb.*
*.pb.*
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "proto"]
path = src/vbk/alt-integration-proto
url = https://github.com/VeriBlock/alt-integration-proto/
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
FROM veriblock/prerelease-btc

ENV ALTINTEGRATION_VERSION=eb8d5128a8df6ee7eb96cec042f1c78ed71dc722
RUN ( \
cd /tmp; \
wget https://github.com/VeriBlock/alt-integration-cpp/archive/${ALTINTEGRATION_VERSION}.tar.gz; \
tar -xf ${ALTINTEGRATION_VERSION}.tar.gz; \
cd alt-integration-cpp-${ALTINTEGRATION_VERSION}; \
mkdir build; \
cd build; \
cmake .. -DCMAKE_BUILD_TYPE=Release -DTESTING=OFF; \
make -j2 install; \
)

ADD . /app
WORKDIR /app
RUN ./autogen.sh
Expand Down
79 changes: 9 additions & 70 deletions btcdev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,74 +70,6 @@ RUN update-alternatives --install /usr/bin/gcov gcov /usr/bin/gc

WORKDIR /tmp

# install gflags
RUN git clone --progress -b v2.2.2 https://github.com/gflags/gflags && \
( \
cd gflags; \
mkdir build; \
cd build; \
cmake .. -DCMAKE_BUILD_TYPE=Release; \
make -j4 install; \
) && \
rm -rf gflags

# install c-ares
RUN git clone --progress -b cares-1_15_0 https://github.com/c-ares/c-ares && \
( \
cd c-ares; \
mkdir build; \
cd build; \
cmake .. -DCMAKE_BUILD_TYPE=Release; \
make -j4 install; \
) && \
rm -rf c-ares

# install protobuf
RUN git clone --progress -b v3.10.0 https://github.com/protocolbuffers/protobuf && \
( \
cd protobuf; \
mkdir build; \
cd build; \
cmake ../cmake \
-DCMAKE_BUILD_TYPE=Release \
-Dprotobuf_BUILD_SHARED_LIBS=ON \
-Dprotobuf_BUILD_TESTS=OFF; \
make -j4 install; \
) && \
rm -rf protobuf

# install grpc; depends on protobuf, c-ares, gflags
RUN git clone --progress -b v1.26.x http://github.com/grpc/grpc/ && \
( \
cd grpc; \
git submodule update --init third_party/udpa; \
mkdir build; \
cd build; \
cmake .. \
-DCMAKE_C_FLAGS="-Wno-error" \
-DCMAKE_CXX_FLAGS="-Wno-error" \
-DCMAKE_BUILD_TYPE=Release \
-DgRPC_BENCHMARK_PROVIDER="" \
-DgRPC_ZLIB_PROVIDER=package \
-DgRPC_CARES_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_GFLAGS_PROVIDER=package \
-DgRPC_BUILD_CSHARP_EXT=OFF \
-DgRPC_BUILD_TESTS=OFF \
-DBUILD_SHARED_LIBS=ON \
-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_CPP_PLUGIN=ON \
; \
make -j8 install; \
) && \
rm -rf grpc

RUN git clone --progress -b release-1.10.0 https://github.com/google/googletest.git && \
( \
cd googletest; \
Expand All @@ -148,8 +80,6 @@ RUN git clone --progress -b release-1.10.0 https://github.com/google/googletest.
) && \
rm -rf googletest

RUN ldconfig

ENV SONAR_CLI_VERSION=4.2.0.1873
RUN set -e; \
mkdir -p /opt/sonar; \
Expand All @@ -159,6 +89,15 @@ RUN set -e; \
ln -s -f /opt/sonar/scanner/bin/sonar-scanner /usr/local/bin/sonar-scanner; \
rm -rf /tmp/sonar*


# install vcpkg
RUN git clone --progress -b master https://github.com/microsoft/vcpkg /opt/vcpkg && \
( \
cd /opt/vcpkg; \
./bootstrap-vcpkg.sh -disableMetrics; \
)
ENV VCPKG_PATH=/opt/vcpkg
ENV PATH="${PATH}:${VCPKG_PATH}"
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN pip3 install --upgrade setuptools wheel bashlex compiledb gcovr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,28 @@
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{7BBD9829-AA10-426A-99E4-4B6215763086}</ProjectGuid>
<RootNamespace>VeriBlockIntegrationTest</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down
14 changes: 1 addition & 13 deletions build_msvc/bitcoin-cli/bitcoin-cli.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\common.init.vcxproj" />
<PropertyGroup Label="Globals">
<ProjectGuid>{0B2D7431-F876-4A58-87BF-F748338CD3BF}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup>
<ConfigurationType>Application</ConfigurationType>
Expand All @@ -29,18 +29,6 @@
<Project>{5724ba7d-a09a-4ba8-800b-c4c1561b3d69}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="..\common.vcxproj" />
Expand Down
14 changes: 1 addition & 13 deletions build_msvc/bitcoin-qt/bitcoin-qt.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ProjectGuid>{7E99172D-7FF2-4CB6-B736-AC9B76ED412A}</ProjectGuid>
<ConfigurationType>Application</ConfigurationType>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\..\src\qt\main.cpp" />
Expand Down Expand Up @@ -74,18 +74,6 @@
<PreprocessorDefinitions>HAVE_CONFIG_H;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
14 changes: 1 addition & 13 deletions build_msvc/bitcoin-tx/bitcoin-tx.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,12 @@
<Import Project="..\common.init.vcxproj" />
<PropertyGroup Label="Globals">
<ProjectGuid>{D3022AF6-AD33-4CE3-B358-87CB6A1B29CF}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile />
</ItemDefinitionGroup>
Expand Down
14 changes: 1 addition & 13 deletions build_msvc/bitcoin-wallet/bitcoin-wallet.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,12 @@
<Import Project="..\common.init.vcxproj" />
<PropertyGroup Label="Globals">
<ProjectGuid>{84DE8790-EDE3-4483-81AC-C32F15E861F4}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile />
</ItemDefinitionGroup>
Expand Down
Loading