Skip to content

Commit

Permalink
fix: git detected dubious ownership in repository (#4002)
Browse files Browse the repository at this point in the history
* fix: git detected dubious ownership in repository at '/__w/OpenMLDB/OpenMLDB' for some workflow actions

Signed-off-by: shouren <[email protected]>

* feat: Avoid downloading precompiled third-party and zetasql package in CMakeList.txt in third-party dir when envs are set.

Signed-off-by: shouren <[email protected]>

* fix: fix errors in coverage.yml and sdk.yml

Signed-off-by: shouren <[email protected]>

* fix: fix error for make coverage-cpp in Makefile

Signed-off-by: shouren <[email protected]>

---------

Signed-off-by: shouren <[email protected]>
  • Loading branch information
Shouren authored Dec 20, 2024
1 parent d3229f1 commit 7d9dfbe
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 45 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ on:

jobs:
coverage:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
container:
image: ghcr.io/4paradigm/hybridsql:latest
env:
CTEST_PARALLEL_LEVEL: 1 # parallel test level for ctest (make test)
CMAKE_BUILD_TYPE: Debug
Expand All @@ -47,17 +49,17 @@ jobs:
with:
submodules: true

- name: download lcov
uses: actions/checkout@v4
with:
repository: linux-test-project/lcov
ref: v1.16
path: lcov

- name: install lcov
working-directory: lcov
run: |
sudo make install
# - name: download lcov
# uses: actions/checkout@v4
# with:
# repository: linux-test-project/lcov
# ref: v1.16
# path: lcov
#
# - name: install lcov
# working-directory: lcov
# run: |
# sudo make install

- name: coverage configure
run: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ jobs:
container:
image: ghcr.io/4paradigm/hybridsql:latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: build openmldb
run: |
git config --system --add safe.directory $(pwd)
make configure SQL_JAVASDK_ENABLE=ON CMAKE_INSTALL_PREFIX=openmldb
make build SQL_JAVASDK_ENABLE=ON CMAKE_INSTALL_PREFIX=openmldb
make install SQL_JAVASDK_ENABLE=ON CMAKE_INSTALL_PREFIX=openmldb
Expand All @@ -55,7 +56,7 @@ jobs:
- name: upload ut results
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: openmldb-test-python-${{ github.sha }}
path: pytest.xml
1 change: 0 additions & 1 deletion .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ jobs:
runs-on: ubuntu-latest
container:
image: ghcr.io/4paradigm/hybridsql:latest
env:
env:
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
Expand Down
4 changes: 4 additions & 0 deletions src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# WARN: do not link in production

add_library(openmldb_test_base base_test.cc util.cc)
target_compile_options(openmldb_test_base PRIVATE
$<$<COMPILE_LANGUAGE:CXX>:-Wno-error=nonnull>
$<$<COMPILE_LANGUAGE:C>:-Wno-error=nonnull>
)

add_dependencies(openmldb_test_base openmldb_sdk tablet nameserver)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.1")
Expand Down
35 changes: 19 additions & 16 deletions third-party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,23 +117,26 @@ endif()

# Fetch hybridsql asserts
if(NOT BUILD_BUNDLED)
init_hybridsql_thirdparty_urls()

message(STATUS "Download pre-compiled hybridsql assert from ${HYBRIDSQL_ASSERTS_URL}")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm64)|(ARM64)|(aarch64)|(AARCH64)")
message(WARNING pre-compiled hybridsql aseerts for arm64 may out-of-date, consider build from source by '-DBUILD_BUNDLED=ON')
if (DEFINED ENV{THIRDPARTY_VERSION} AND "$ENV{THIRDPARTY_VERSION}" STREQUAL "${HYBRIDSQL_ASSERTS_VERSION}")
message(STATUS "THIRDPARTY_VERSION matches HYBRIDSQL_ASSERTS_VERSION, skipping download.")
else()
init_hybridsql_thirdparty_urls()
message(STATUS "Download pre-compiled hybridsql assert from ${HYBRIDSQL_ASSERTS_URL}")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm64)|(ARM64)|(aarch64)|(AARCH64)")
message(WARNING pre-compiled hybridsql aseerts for arm64 may out-of-date, consider build from source by '-DBUILD_BUNDLED=ON')
endif()
ExternalProject_Add(
hybridsql-asserts
URL ${HYBRIDSQL_ASSERTS_URL}
URL_HASH SHA256=${HYBRIDSQL_ASSERTS_HASH}
PREFIX ${DEPS_BUILD_DIR}
DOWNLOAD_DIR "${DEPS_DOWNLOAD_DIR}/hybridsql-asserts"
DOWNLOAD_NO_EXTRACT True
INSTALL_DIR ${DEPS_INSTALL_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND bash -c "tar xzf <DOWNLOADED_FILE> -C ${DEPS_INSTALL_DIR} --strip-components=1")
endif()
ExternalProject_Add(
hybridsql-asserts
URL ${HYBRIDSQL_ASSERTS_URL}
URL_HASH SHA256=${HYBRIDSQL_ASSERTS_HASH}
PREFIX ${DEPS_BUILD_DIR}
DOWNLOAD_DIR "${DEPS_DOWNLOAD_DIR}/hybridsql-asserts"
DOWNLOAD_NO_EXTRACT True
INSTALL_DIR ${DEPS_INSTALL_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND bash -c "tar xzf <DOWNLOADED_FILE> -C ${DEPS_INSTALL_DIR} --strip-components=1")
endif()

if (BUILD_BUNDLED_GTEST)
Expand Down
31 changes: 17 additions & 14 deletions third-party/cmake/FetchZetasql.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,23 @@ endfunction()


if (NOT BUILD_BUNDLED_ZETASQL)
init_zetasql_urls()

message(STATUS "Download pre-compiled zetasql from ${ZETASQL_URL}")
# download pre-compiled zetasql from GitHub Release
ExternalProject_Add(zetasql
URL ${ZETASQL_URL}
URL_HASH SHA256=${ZETASQL_HASH}
PREFIX ${DEPS_BUILD_DIR}
DOWNLOAD_DIR "${DEPS_DOWNLOAD_DIR}/zetasql"
DOWNLOAD_NO_EXTRACT True
INSTALL_DIR ${DEPS_INSTALL_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND bash -c "tar xzf <DOWNLOADED_FILE> -C ${DEPS_INSTALL_DIR} --strip-components=1")
if (DEFINED ENV{ZETASQL_VERSION} AND "$ENV{ZETASQL_VERSION}" STREQUAL "${ZETASQL_VERSION}")
message(STATUS "ZETASQL_VERSION from env matches ZETASQL_VERSION, skipping download.")
else()
init_zetasql_urls()
message(STATUS "Download pre-compiled zetasql from ${ZETASQL_URL}")
# download pre-compiled zetasql from GitHub Release
ExternalProject_Add(zetasql
URL ${ZETASQL_URL}
URL_HASH SHA256=${ZETASQL_HASH}
PREFIX ${DEPS_BUILD_DIR}
DOWNLOAD_DIR "${DEPS_DOWNLOAD_DIR}/zetasql"
DOWNLOAD_NO_EXTRACT True
INSTALL_DIR ${DEPS_INSTALL_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND bash -c "tar xzf <DOWNLOADED_FILE> -C ${DEPS_INSTALL_DIR} --strip-components=1")
endif()
else()
find_program(BAZEL_EXE NAMES bazel REQUIRED DOC "Compile zetasql require bazel or bazelisk")
find_program(PYTHON_EXE NAMES python REQUIRED DOC "Compile zetasql require python")
Expand Down

0 comments on commit 7d9dfbe

Please sign in to comment.