Skip to content

Commit

Permalink
<fix>(workflow): workflows to adapt vcpkg.
Browse files Browse the repository at this point in the history
  • Loading branch information
kyonRay committed Nov 21, 2023
1 parent 0a0249e commit d0a2cd7
Show file tree
Hide file tree
Showing 19 changed files with 48 additions and 539 deletions.
113 changes: 44 additions & 69 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,28 @@ jobs:
fetch-depth: 5
- name: Nightly default
run: rustup default nightly
- uses: actions/cache@v2
- uses: actions/cache@v3
id: cache
with:
path: |
/home/runner/.hunter
/github/home/.hunter
/Users/runner/.hunter
/home/runner/.hunter/_Base/Download/
/github/home/.hunter/_Base/Download/
/Users/runner/.hunter/_Base/Download/
/usr/local/share/vcpkg
ccache
key: hunter-clang-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
key: vcpkg-clang-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
restore-keys: |
hunter-clang-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
hunter-clang-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-
hunter-clang-v3-notest-${{ runner.temp }}-
vcpkg-clang-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
vcpkg-clang-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-
vcpkg-clang-v1-notest-${{ runner.temp }}-
- name: install macOS dependencies
if: runner.os == 'macOS'
run: brew install ccache lcov
- name: install Ubuntu dependencies
if: runner.os == 'Linux'
run: sudo apt install -y git curl openssl build-essential clang cmake ccache lcov
- name: fetch vcpkg
run: cd /usr/local/share/vcpkg/ && git fetch && git reset --hard && git pull && cd -
- name: configure
if: runner.os == 'macOS'
run: export SDKROOT=$(xcrun --sdk macosx --show-sdk-path) && CC=/usr/bin/clang CXX=/usr/bin/clang++ mkdir build && cd build && cmake ../ -DBUILD_JNI=ON -DBUILD_SAMPLE=ON -DTESTS=ON -DCOVERAGE=ON
- name: configure
if: runner.os == 'Linux'
run: CC=/usr/bin/clang CXX=/usr/bin/clang++ mkdir build && cd build && cmake ../ -DBUILD_JNI=ON -DBUILD_SAMPLE=ON -DTESTS=ON -DCOVERAGE=ON
run: |
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path) && CC=/usr/bin/clang CXX=/usr/bin/clang++
mkdir build && cd build
cmake ../ -DBUILD_JNI=ON -DBUILD_SAMPLE=ON -DTESTS=ON -DCOVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: compile
run: export CFLAGS="${CFLAGS} -fPIC";export CXXFLAGS="${CXXFLAGS} -fPIC"; cd build && make -j4
- name: run test
Expand All @@ -80,38 +74,27 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 5
- uses: actions/cache@v2
- uses: actions/cache@v3
id: cache
with:
path: |
/home/runner/.hunter
/github/home/.hunter
/Users/runner/.hunter
/home/runner/.hunter/_Base/Download/
/github/home/.hunter/_Base/Download/
/Users/runner/.hunter/_Base/Download/
deps/src
/usr/local/share/vcpkg
ccache
key: hunter-gcc-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
key: vcpkg-gcc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
restore-keys: |
hunter-gcc-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
hunter-gcc-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-
hunter-gcc-v2-notest-${{ runner.temp }}-
- uses: actions/cache@v2
id: ccache
with:
path: ccache
key: cache-gcc-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
restore-keys: |
ccache-gcc-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
cache-gcc-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-
cache-gcc-v2-notest-${{ runner.temp }}-
vcpkg-gcc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
vcpkg-gcc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-
vcpkg-gcc-v1-notest-${{ runner.temp }}-
- name: install Ubuntu dependencies
run: sudo apt install -y git curl openssl build-essential cmake ccache lcov
- name: fetch vcpkg
run: cd /usr/local/share/vcpkg/ && git fetch && git reset --hard && git pull && cd -
- name: configure
run: |
export CC='gcc-10'; export CXX='g++-10'
export CFLAGS="${CFLAGS} -fPIC";export CXXFLAGS="${CXXFLAGS} -fPIC"; mkdir -p build && cd build && cmake ../ -DBUILD_JNI=ON -DBUILD_SAMPLE=ON -DTESTS=ON -DCOVERAGE=ON
export CFLAGS="${CFLAGS} -fPIC";export CXXFLAGS="${CXXFLAGS} -fPIC";
mkdir -p build && cd build
cmake ../ -DBUILD_JNI=ON -DBUILD_SAMPLE=ON -DTESTS=ON -DCOVERAGE=ON -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake || cat /usr/local/share/vcpkg/buildtrees/fisco-bcos-cpp-sdk/build-x64-linux-rel-out.log
- name: compile
run: cd build && make -j4
- name: run test
Expand All @@ -134,7 +117,7 @@ jobs:
container:
image: docker.io/centos:7
volumes:
- /github/home/.hunter:/github/home/.hunter
- /usr/local/share/vcpkg:/usr/local/share/vcpkg
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -144,28 +127,23 @@ jobs:
with:
toolchain: nightly-2021-06-17
override: true
- uses: actions/cache@v2
- uses: actions/cache@v3
id: cache
with:
path: |
/home/runner/.hunter
/github/home/.hunter
/Users/runner/.hunter
/home/runner/.hunter/_Base/Download/
/github/home/.hunter/_Base/Download/
/Users/runner/.hunter/_Base/Download/
ccache
deps/src
/usr/local/share/vcpkg
ccache
key: hunter-centos-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
key: vcpkg-centos-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
restore-keys: |
hunter-centos-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
hunter-centos-v2-notest-${{ runner.temp }}-${{ github.base_ref }}-
hunter-centos-v2-notest-${{ runner.temp }}-
vcpkg-centos-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
vcpkg-centos-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-
vcpkg-centos-v1-notest-${{ runner.temp }}-
- name: install CentOS dependencies
run: |
yum install -y epel-release centos-release-scl
yum install -y java-11-openjdk-devel git make gcc gcc-c++ glibc-static glibc-devel openssl cmake3 ccache devtoolset-11 llvm-toolset-7.0 rh-perl530-perl libzstd-devel zlib-devel flex bison python-devel python3-devel
- name: fetch vcpkg
run: cd /usr/local/share/vcpkg/ && git fetch && git reset --hard && git pull && cd - && cmake3 --version
- name: configure
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
Expand All @@ -178,7 +156,7 @@ jobs:
export CFLAGS="${CFLAGS} -fPIC"
export CXXFLAGS="${CXXFLAGS} -fPIC"
mkdir -p build && cd build
cmake3 ../ -DHUNTER_STATUS_DEBUG=ON -DBUILD_JNI=ON -DBUILD_SAMPLE=ON -DTESTS=ON
cmake3 ../ -DBUILD_JNI=ON -DBUILD_SAMPLE=ON -DTESTS=ON -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake
make -j4
- name: run test
run: cd build && CTEST_OUTPUT_ON_FAILURE=TRUE make test
Expand All @@ -200,29 +178,26 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 5
- uses: actions/cache@v2
- uses: actions/cache@v3
id: cache
with:
path: |
/home/runner/.hunter
/github/home/.hunter
/Users/runner/.hunter
/home/runner/.hunter/_Base/Download/
/github/home/.hunter/_Base/Download/
/Users/runner/.hunter/_Base/Download/
C:/.hunter/
C:/.hunter/_Base/Download/
C:\vcpkg
ccache
key: hunter-msvc-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
key: vcpkg-msvc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
restore-keys: |
hunter-msvc-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
hunter-msvc-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-
hunter-msvc-v3-notest-${{ runner.temp }}-
vcpkg-msvc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }}
vcpkg-msvc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-
vcpkg-msvc-v1-notest-${{ runner.temp }}-
- name: Add MSbuild to PATH
uses: microsoft/[email protected]
- name: fetch vcpkg
run: cd C:\vcpkg && git fetch && git reset --hard && git pull && cd -
- name: configure
if: runner.os == 'Windows'
run: mkdir -p build && cd build && cmake -G "Visual Studio 16 2019" -A x64 ../ -DHUNTER_CONFIGURATION_TYPES=Release -DHUNTER_STATUS_DEBUG=ON -DTESTS=ON -DBUILD_JNI=ON
run: |
mkdir -p build && cd build
cmake -G "Visual Studio 16 2019" -A x64 ../ -DTESTS=ON -DBUILD_JNI=ON -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake || cat C:\vcpkg\buildtrees\hsm-crypto\build-x64-windows-dbg-out.log
- name: compile
run: cd build && MSBuild bcos-c-sdk.sln /p:Configuration=Release /p:Platform=x64
- uses: actions/upload-artifact@v2
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ set(JAVA_SDK_JNI_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake" CACHE PATH "The c
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
list(APPEND CMAKE_MODULE_PATH ${JAVA_SDK_JNI_CMAKE_DIR})

# include hunter
include(Options)
set(ARCH_NATIVE OFF)

Expand Down Expand Up @@ -70,7 +69,7 @@ include(InstallInclude)
include(IncludeDirectories)
include(GNUInstallDirs)

find_package(Boost COMPONENTS log serialization)
find_package(Boost COMPONENTS log serialization unit_test_framework)
find_package(OpenSSL REQUIRED)
find_package(Microsoft.GSL CONFIG REQUIRED)
find_package(fmt REQUIRED)
Expand Down
4 changes: 0 additions & 4 deletions bindings/java/jni/src/main/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ target_link_libraries(${FISCO_BCOS_JNI_TARGET} PUBLIC wedprcrypto::crypto wedprc
add_library(${FISCO_BCOS_JNI_STATIC_TARGET} ${SOURCES})
target_link_libraries(${FISCO_BCOS_JNI_STATIC_TARGET} PUBLIC wedprcrypto::crypto wedprcrypto::zkp fiscobcos::bcos-cpp-sdk ${BCOS_C_SDK_STATIC_TARGET})

if(BUILD_EXEC_TEST)
add_subdirectory(test/exe)
endif()

SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../resources/META-INF/native/)

message(STATUS "CMAKE_INSTALL_INCLUDEDIR => ${CMAKE_INSTALL_INCLUDEDIR}")
Expand Down

This file was deleted.

30 changes: 0 additions & 30 deletions bindings/java/jni/src/main/c/test/config/bcos_c_sdk_sample.ini

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions bindings/java/jni/src/main/c/test/exe/CMakeLists.txt

This file was deleted.

63 changes: 0 additions & 63 deletions bindings/java/jni/src/main/c/test/exe/broadcast.c

This file was deleted.

Loading

0 comments on commit d0a2cd7

Please sign in to comment.