From f3ec290da12a869ffa18a0d869eb8005afad2b9c Mon Sep 17 00:00:00 2001 From: bxq2011hust Date: Mon, 13 May 2024 17:51:50 +0800 Subject: [PATCH] fix macOS ci use apple silicon --- .ci/integration_test.sh | 12 +++++++++--- .github/workflows/workflow.yml | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.ci/integration_test.sh b/.ci/integration_test.sh index 615c3b79..924a8f32 100755 --- a/.ci/integration_test.sh +++ b/.ci/integration_test.sh @@ -307,13 +307,19 @@ get_csdk_lib() if [ ! -d "/usr/local/lib/" ];then sudo mkdir -p /usr/local/lib fi + local platform_arch=$(uname -p) + local suffix="so" if [ ! -z "${macOS}" ];then # macOS suffix="dylib" fi - if [ ! -f "/usr/local/lib/libbcos-c-sdk.${suffix}" ];then - curl -#LO "https://github.com/FISCO-BCOS/bcos-c-sdk/releases/download/${c_sdk_version}/libbcos-c-sdk.${suffix}" - sudo cp "libbcos-c-sdk.${suffix}" /usr/local/lib/ + local c_sdk_lib_name="libbcos-c-sdk.${suffix}" + if [ "${platform_arch}" == "arm" ];then + c_sdk_lib_name="libbcos-c-sdk-aarch64.${suffix}" + fi + if [ ! -f "/usr/local/lib/${c_sdk_lib_name}" ];then + curl -#LO "https://github.com/FISCO-BCOS/bcos-c-sdk/releases/download/${c_sdk_version}/${c_sdk_lib_name}" + sudo cp "${c_sdk_lib_name}" /usr/local/lib/ fi } diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 9c255e8f..c062c4ac 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -46,6 +46,9 @@ jobs: - name: test all if: ${{ runner.os == 'Linux' }} run: bash -x .ci/integration_test.sh -a + - name: install zlib + if: ${{ runner.os == 'macOS' }} + run: brew install zlib - name: test without amop if: ${{ runner.os == 'macOS' }} run: bash .ci/integration_test.sh \ No newline at end of file