Skip to content

Commit 670a294

Browse files
authored
add release ci workflow and remove global no-access-control (#32)
1 parent 34f1fa6 commit 670a294

File tree

11 files changed

+100
-26
lines changed

11 files changed

+100
-26
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright 2025-present Alibaba Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Build Release
16+
17+
on:
18+
push:
19+
branches:
20+
- '**'
21+
tags:
22+
- '**'
23+
pull_request:
24+
25+
concurrency:
26+
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
27+
cancel-in-progress: true
28+
29+
permissions:
30+
contents: read
31+
32+
jobs:
33+
clang-release:
34+
runs-on: ubuntu-24.04
35+
timeout-minutes: 120
36+
strategy:
37+
fail-fast: false
38+
steps:
39+
- name: Checkout paimon-cpp
40+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
41+
with:
42+
lfs: true
43+
- name: Build Paimon
44+
shell: bash
45+
env:
46+
CC: clang
47+
CXX: clang++
48+
run: ci/scripts/build_paimon.sh $(pwd) false false Release
49+
gcc-release:
50+
runs-on: ubuntu-24.04
51+
timeout-minutes: 120
52+
strategy:
53+
fail-fast: false
54+
steps:
55+
- name: Checkout paimon-cpp
56+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
57+
with:
58+
lfs: true
59+
- name: Build Paimon
60+
shell: bash
61+
env:
62+
CC: gcc-14
63+
CXX: g++-14
64+
run: ci/scripts/build_paimon.sh $(pwd) false false Release

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ if(PAIMON_BUILD_TESTS)
319319
-L
320320
unittest
321321
--output-on-failure)
322-
add_compile_options(-fno-access-control)
323322
add_dependencies(unittest paimon-tests)
324323

325324
include_directories(SYSTEM ${GTEST_INCLUDE_DIR})

ci/scripts/build_paimon.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ set -eux
1919
source_dir=${1}
2020
enable_sanitizer=${2:-false}
2121
check_clang_tidy=${3:-false}
22+
build_type=${4:-Debug}
2223
build_dir=${1}/build
2324

2425
mkdir ${build_dir}
2526
pushd ${build_dir}
2627

2728
CMAKE_ARGS=(
2829
"-G Ninja"
29-
"-DCMAKE_BUILD_TYPE=Debug"
30+
"-DCMAKE_BUILD_TYPE=${build_type}"
3031
"-DPAIMON_BUILD_TESTS=ON"
3132
"-DPAIMON_ENABLE_LANCE=ON"
3233
"-DPAIMON_ENABLE_JINDO=ON"

cmake_modules/BuildUtils.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ function(add_test_case REL_TEST_NAME)
256256
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
257257
target_compile_options(${TEST_NAME} PRIVATE -Wno-global-constructors)
258258
endif()
259+
target_compile_options(${TEST_NAME} PRIVATE -fno-access-control)
259260

260261
add_test(${TEST_NAME}
261262
${BUILD_SUPPORT_DIR}/run-test.sh

include/paimon/utils/roaring_bitmap32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
namespace paimon {
3131
class ByteArrayInputStream;
32+
class RoaringBitmap64;
3233

3334
/// A compressed bitmap for 32-bit integer.
3435
class PAIMON_EXPORT RoaringBitmap32 {
@@ -160,7 +161,6 @@ class PAIMON_EXPORT RoaringBitmap32 {
160161
/// Fast union multiple bitmaps.
161162
static RoaringBitmap32 FastUnion(const std::vector<RoaringBitmap32>& inputs);
162163

163-
class RoaringBitmap64;
164164
friend class RoaringBitmap64;
165165

166166
private:

src/paimon/common/utils/decimal_utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
namespace paimon {
3030
Status DecimalUtils::CheckDecimalType(const arrow::DataType& type) {
31-
auto* decimal_type = arrow::internal::checked_cast<const arrow::Decimal128Type*>(&type);
31+
auto* decimal_type = dynamic_cast<const arrow::Decimal128Type*>(&type);
3232
if (!decimal_type) {
3333
return Status::Invalid(fmt::format("Invalid decimal type: {}", type.ToString()));
3434
}

src/paimon/core/casting/cast_executor_test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ TEST_F(CastExecutorTest, TestNumericPrimitiveCastExecutorCastArray) {
582582
CheckArrayResult(cast_executor, arrow::int8(), src_array, expected_array);
583583
}
584584
{
585+
#ifndef NDEBUG
585586
// Java Paimon cast MAX_FLOAT to -1 while C++ Paimon cast to 0
586587
// Java Paimon cast INFINITY to -1 while C++ Paimon cast to 0
587588
std::vector<float> src_data = {1.1, 2.2, 3.3, -10.01, 0,
@@ -591,6 +592,7 @@ TEST_F(CastExecutorTest, TestNumericPrimitiveCastExecutorCastArray) {
591592
auto expected_array =
592593
MakeArrowArray<int16_t, arrow::Int16Builder>(arrow::int16(), expected_data);
593594
CheckArrayResult(cast_executor, arrow::int16(), src_array, expected_array);
595+
#endif
594596
}
595597
{
596598
// Java Paimon cast MAX_FLOAT to 2147483647 while C++ Paimon cast to -2147483648

src/paimon/core/operation/file_store_commit_impl_test.cpp

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,6 @@
7171
namespace paimon::test {
7272
class GmockFileSystem : public LocalFileSystem {
7373
public:
74-
GmockFileSystem() {
75-
ON_CALL(*this, ListDir(testing::_, testing::_))
76-
.WillByDefault(testing::Invoke(
77-
[&](const std::string& directory,
78-
std::vector<std::unique_ptr<BasicFileStatus>>* file_status_list) {
79-
return this->LocalFileSystem::ListDir(directory, file_status_list);
80-
}));
81-
ON_CALL(*this, ReadFile(testing::_, testing::_))
82-
.WillByDefault(testing::Invoke([&](const std::string& path, std::string* content) {
83-
return this->FileSystem::ReadFile(path, content);
84-
}));
85-
ON_CALL(*this, AtomicStore(::testing::_, ::testing::_))
86-
.WillByDefault(
87-
testing::Invoke([&](const std::string& path, const std::string& content) {
88-
return this->FileSystem::AtomicStore(path, content);
89-
}));
90-
}
91-
9274
MOCK_METHOD(Status, ReadFile, (const std::string& path, std::string* content), (override));
9375
MOCK_METHOD(Status, ListDir,
9476
(const std::string& directory,
@@ -106,7 +88,29 @@ class GmockFileSystemFactory : public LocalFileSystemFactory {
10688

10789
Result<std::unique_ptr<FileSystem>> Create(
10890
const std::string& path, const std::map<std::string, std::string>& options) const override {
109-
return std::make_unique<GmockFileSystem>();
91+
auto fs = std::make_unique<GmockFileSystem>();
92+
using ::testing::A;
93+
using ::testing::Invoke;
94+
95+
ON_CALL(*fs, ListDir(A<const std::string&>(),
96+
A<std::vector<std::unique_ptr<BasicFileStatus>>*>()))
97+
.WillByDefault(
98+
Invoke([&](const std::string& directory,
99+
std::vector<std::unique_ptr<BasicFileStatus>>* file_status_list) {
100+
return fs->LocalFileSystem::ListDir(directory, file_status_list);
101+
}));
102+
103+
ON_CALL(*fs, ReadFile(A<const std::string&>(), A<std::string*>()))
104+
.WillByDefault(Invoke([&](const std::string& path, std::string* content) {
105+
return fs->FileSystem::ReadFile(path, content);
106+
}));
107+
108+
ON_CALL(*fs, AtomicStore(A<const std::string&>(), A<const std::string&>()))
109+
.WillByDefault(Invoke([&](const std::string& path, const std::string& content) {
110+
return fs->FileSystem::AtomicStore(path, content);
111+
}));
112+
113+
return fs;
110114
}
111115
};
112116

test/inte/data_evolution_table_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1898,7 +1898,8 @@ TEST_P(DataEvolutionTableTest, TestWithRowIds) {
18981898
}
18991899

19001900
std::vector<std::string> GetTestValuesForDataEvolutionTableTest() {
1901-
std::vector<std::string> values = {"parquet"};
1901+
std::vector<std::string> values;
1902+
values.emplace_back("parquet");
19021903
#ifdef PAIMON_ENABLE_ORC
19031904
values.emplace_back("orc");
19041905
#endif

test/inte/global_index_test.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,8 @@ TEST_P(GlobalIndexTest, TestScanIndexWithTwoIndexes) {
16831683
}
16841684

16851685
std::vector<std::string> GetTestValuesForGlobalIndexTest() {
1686-
std::vector<std::string> values = {"parquet"};
1686+
std::vector<std::string> values;
1687+
values.emplace_back("parquet");
16871688
#ifdef PAIMON_ENABLE_ORC
16881689
values.emplace_back("orc");
16891690
#endif

0 commit comments

Comments
 (0)