Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 16 additions & 24 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_call:
inputs:
extra_cmake_flags:
required: false
type: string
extra_install:
required: false
type: string
gtest_filter:
required: false
type: string
default: "*"

env:
BUILD_TYPE: Release
Expand All @@ -26,37 +14,41 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
build: [clang-6, gcc-7, gcc-8, gcc-9]
compiler: [clang-6, gcc-7, gcc-8, gcc-9]
ssl: [ssl_ON, ssl_OFF]
include:
- build: clang-6
os: ubuntu-latest
- compiler: clang-6
INSTALL: clang-6.0
C_COMPILER: clang-6.0
CXX_COMPILER: clang++-6.0

- build: gcc-7
os: ubuntu-latest
- compiler: gcc-7
INSTALL: gcc-7 g++-7
C_COMPILER: gcc-7
CXX_COMPILER: g++-7

- build: gcc-8
os: ubuntu-latest
- compiler: gcc-8
INSTALL: gcc-8 g++-8
C_COMPILER: gcc-8
CXX_COMPILER: g++-8

- build: gcc-9
os: ubuntu-latest
- compiler: gcc-9
INSTALL: gcc-9 g++-9
C_COMPILER: gcc-9
CXX_COMPILER: g++-9

- ssl: ssl_ON
INSTALL_SSL: libssl-dev
EXTRA_CMAKE_FLAGS: -DWITH_OPENSSL=ON

- ssl: ssl_OFF
EXTRA_CMAKE_FLAGS: -DWITH_OPENSSL=OFF

steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: sudo apt-get install -y cmake ${{ matrix.INSTALL }} ${{ inputs.extra_install }}
run: sudo apt-get install -y cmake ${{ matrix.INSTALL }} ${{ matrix.INSTALL_SSL }}

- name: Configure CMake
run: |
Expand All @@ -65,7 +57,7 @@ jobs:
-DCMAKE_CXX_COMPILER=${{ matrix.CXX_COMPILER}} \
-B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTS=ON \
${{ inputs.extra_cmake_flags }}
${{ matrix.EXTRA_CMAKE_FLAGS }}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target all
Expand All @@ -84,4 +76,4 @@ jobs:

- name: Test
working-directory: ${{github.workspace}}/build/ut
run: ./clickhouse-cpp-ut --gtest_filter="${{inputs.gtest_filter}}"
run: ./clickhouse-cpp-ut
16 changes: 0 additions & 16 deletions .github/workflows/linux_ssl.yml

This file was deleted.

46 changes: 31 additions & 15 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,58 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_call:
inputs:
extra_cmake_flags:
required: false
type: string
extra_install:
required: false
type: string
gtest_filter:
required: false
type: string
default: "*"

env:
BUILD_TYPE: Release
CLICKHOUSE_USER: clickhouse_cpp_cicd
CLICKHOUSE_PASSWORD: clickhouse_cpp_cicd

jobs:
build:
runs-on: macos-latest

strategy:
fail-fast: false
matrix:
ssl: [ssl_ON, ssl_OFF]
include:
- build: ssl_OFF
EXTRA_CMAKE_FLAGS: -DWITH_OPENSSL=OFF

- build: ssl_ON
EXTRA_CMAKE_FLAGS: -DWITH_OPENSSL=ON -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/
INSTALL_SSL: openssl

steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: brew install cmake ${{inputs.extra_install}}
run: brew install cmake ${{matrix.INSTALL_SSL}}

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTS=ON ${{inputs.extra_cmake_flags}}
run: |
cmake \
-B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DBUILD_TESTS=ON \
${{matrix.EXTRA_CMAKE_FLAGS}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target all

- name: Start tls offoader proxy
# that mimics non-secure clickhouse running on localhost
# by tunneling queries to remote tls server
# (needed because we can't start real clickhouse instance on MacOS)
run: |
wget https://github.com/filimonov/go-tlsoffloader/releases/download/v0.1.2/go-tlsoffloader_0.1.2_Darwin_x86_64.tar.gz
tar -xvzf go-tlsoffloader_0.1.2_Darwin_x86_64.tar.gz
./go-tlsoffloader -l localhost:9000 -b github.demo.trial.altinity.cloud:9440 &

- name: Test
working-directory: ${{github.workspace}}/build/ut
env:
# It is impossible to start CH server in docker on macOS due to github actions limitations,
# so limit tests to ones that do no require server interaction.
GTEST_FILTER_ONLY_LOCAL: "-Client/*"
run: ./clickhouse-cpp-ut --gtest_filter="${{inputs.gtest_filter}}:${{env.GTEST_FILTER_ONLY_LOCAL}}"
run: ./clickhouse-cpp-ut
17 changes: 0 additions & 17 deletions .github/workflows/macos_ssl.yml

This file was deleted.

1 change: 1 addition & 0 deletions ut/connection_failed_client_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace {
using namespace clickhouse;
}

GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ConnectionFailedClientTest);
TEST_P(ConnectionFailedClientTest, ValidateConnectionError) {

const auto & client_options = std::get<0>(GetParam());
Expand Down
2 changes: 2 additions & 0 deletions ut/readonly_client_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ void ReadonlyClientTest::TearDown() {
client_.reset();
}

// Sometimes gtest fails to detect that this test is instantiated elsewhere, suppress the error explicitly.
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ReadonlyClientTest);
TEST_P(ReadonlyClientTest, Select) {

const auto & queries = std::get<1>(GetParam());
Expand Down