-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<feat>(project): project adapt vcpkg construct. (#188)
- Loading branch information
Showing
43 changed files
with
549 additions
and
726 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ on: | |
- "Changelog.md" | ||
- "README.md" | ||
release: | ||
types: [published, created, edited] | ||
types: [ published, created, edited ] | ||
env: | ||
CCACHE_DIR: ${{ github.workspace }}/ccache | ||
|
||
|
@@ -21,47 +21,39 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest] | ||
os: [ macos-latest ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
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 | ||
run: cd build && CTEST_OUTPUT_ON_FAILURE=TRUE make test | ||
- name: run coverage | ||
run: cd build && make cov | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: libbcos-c-sdk.dylib.zip | ||
|
@@ -75,43 +67,32 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04] | ||
os: [ ubuntu-20.04 ] | ||
steps: | ||
- 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') }} | ||
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') }} | ||
key: vcpkg-gcc-v1-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 | ||
- name: compile | ||
run: cd build && make -j4 | ||
- name: run test | ||
|
@@ -134,7 +115,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: | ||
|
@@ -144,41 +125,43 @@ 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/ | ||
/usr/local/share/vcpkg | ||
ccache | ||
deps/src | ||
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 | ||
yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm | ||
yum install -y java-11-openjdk-devel wget git make gcc gcc-c++ glibc-static glibc-devel openssl openssl-devel ccache devtoolset-11 llvm-toolset-7.0 rh-perl530-perl libzstd-devel zlib-devel flex bison python-devel python3-devel | ||
- name: reinstall cmake | ||
run: | | ||
wget -c https://github.com/Kitware/CMake/releases/download/v3.27.8/cmake-3.27.8-linux-x86_64.tar.gz | ||
tar -zxvf cmake-3.27.8-linux-x86_64.tar.gz && mkdir -p /usr/local/cmake && cd cmake-3.27.8-linux-x86_64 && cp -r * /usr/local/cmake | ||
ln -s /usr/local/cmake/bin/cmake /usr/bin/cmake | ||
cmake --version | ||
git --version | ||
- name: fetch vcpkg | ||
run: cd /usr/local/share/vcpkg/ && git fetch && git reset --hard && git pull && cd - | ||
- name: configure | ||
run: | | ||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
. /opt/rh/devtoolset-11/enable | ||
. /opt/rh/rh-perl530/enable | ||
export LIBCLANG_PATH=/opt/rh/llvm-toolset-7.0/root/lib64/ | ||
. /opt/rh/llvm-toolset-7.0/enable | ||
alias cmake='cmake3' | ||
java -version | ||
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 | ||
cmake ../ -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 | ||
|
@@ -191,53 +174,50 @@ jobs: | |
name: libbcos-sdk-jni.so.zip | ||
path: bindings/java/jni/src/main/resources/META-INF/native/libbcos-sdk-jni.so | ||
build_with_windows: | ||
name: build_with_windows | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-2019] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 5 | ||
- uses: actions/cache@v2 | ||
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/ | ||
ccache | ||
key: hunter-msvc-v3-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 }}- | ||
- name: Add MSbuild to PATH | ||
uses: microsoft/[email protected] | ||
- 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 | ||
- name: compile | ||
run: cd build && MSBuild bcos-c-sdk.sln /p:Configuration=Release /p:Platform=x64 | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: bcos-c-sdk.lib.zip | ||
path: D:\a\bcos-c-sdk\bcos-c-sdk\build\Release\bcos-c-sdk.lib | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: bcos-c-sdk.dll.zip | ||
path: D:\a\bcos-c-sdk\bcos-c-sdk\build\Release\bcos-c-sdk.dll | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: bcos-sdk-jni.lib.zip | ||
path: D:\a\bcos-c-sdk\bcos-c-sdk\bindings\java\jni\src\main\resources\META-INF\native\Release\bcos-sdk-jni.lib | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: bcos-sdk-jni.dll.zip | ||
path: D:\a\bcos-c-sdk\bcos-c-sdk\bindings\java\jni\src\main\resources\META-INF\native\Release\bcos-sdk-jni.dll | ||
name: build_with_windows | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ windows-2019 ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 5 | ||
- uses: actions/cache@v3 | ||
id: cache | ||
with: | ||
path: | | ||
C:\vcpkg | ||
ccache | ||
key: vcpkg-msvc-v1-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }} | ||
restore-keys: | | ||
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 ../ -DCMAKE_BUILD_TYPE=Release -DBOOST_USE_WINAPI_VERSION=BOOST_WINAPI_VERSION_WIN7 -D_WIN32_WINNT=0x0601 -DTESTS=ON -DBUILD_JNI=ON -DVCPKG_TARGET_TRIPLET='x64-windows-static' -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake | ||
- name: compile | ||
run: cd build && MSBuild bcos-c-sdk.sln /p:Configuration=Release /p:Platform=x64 | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: bcos-c-sdk.lib.zip | ||
path: D:\a\bcos-c-sdk\bcos-c-sdk\build\Release\bcos-c-sdk.lib | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: bcos-c-sdk.dll.zip | ||
path: D:\a\bcos-c-sdk\bcos-c-sdk\build\Release\bcos-c-sdk.dll | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: bcos-sdk-jni.lib.zip | ||
path: D:\a\bcos-c-sdk\bcos-c-sdk\bindings\java\jni\src\main\resources\META-INF\native\Release\bcos-sdk-jni.lib | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: bcos-sdk-jni.dll.zip | ||
path: D:\a\bcos-c-sdk\bcos-c-sdk\bindings\java\jni\src\main\resources\META-INF\native\Release\bcos-sdk-jni.dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,3 +42,4 @@ deps | |
.vscode/ | ||
.idea/ | ||
.DS_Store | ||
vcpkg_installed** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "vcpkg"] | ||
path = vcpkg | ||
url = https://github.com/microsoft/vcpkg |
Oops, something went wrong.