Skip to content

Commit c6c79ab

Browse files
authored
GitHub actions (ClickHouse#107)
GithubActons workflows: * Linux with gcc-7 and clang-6.0, tests against CH server ver 21.3 * macOS Fixed TravisCI flow to use 21.3 as CH server to run tests against. Fixed several minor compile-time issues.
1 parent 1415b59 commit c6c79ab

File tree

4 files changed

+122
-10
lines changed

4 files changed

+122
-10
lines changed

.github/workflows/linux.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Linux
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
11+
BUILD_TYPE: Release
12+
CH_SERVER_VERSION: 21.3.17.2
13+
14+
jobs:
15+
build:
16+
# The CMake configure and build commands are platform agnostic and should work equally
17+
# well on Windows or Mac. You can convert this to a matrix build if you need
18+
# cross-platform coverage.
19+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
build: [gcc-7, clang-6]
24+
include:
25+
- build: gcc-7
26+
os: ubuntu-latest
27+
INSTALL: gcc-7 g++-7
28+
C_COMPILER: gcc-7
29+
CXX_COMPILER: g++-7
30+
31+
- build: clang-6
32+
os: ubuntu-latest
33+
INSTALL: clang-6.0
34+
C_COMPILER: clang-6.0
35+
CXX_COMPILER: clang++-6.0
36+
37+
steps:
38+
- uses: actions/checkout@v2
39+
40+
- name: Install dependencies
41+
run: |
42+
sudo apt-get install -y ${{ matrix.INSTALL }}
43+
44+
- name: Configure CMake
45+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
46+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
47+
run: |
48+
cmake \
49+
-D CMAKE_C_COMPILER=${{ matrix.C_COMPILER}} \
50+
-D CMAKE_CXX_COMPILER=${{ matrix.CXX_COMPILER}} \
51+
-B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTS=ON
52+
53+
54+
- name: Build
55+
# Build your program with the given configuration
56+
run: |
57+
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target all
58+
59+
- name: Start ClickHouse server
60+
run: |
61+
sudo apt-get install apt-transport-https ca-certificates dirmngr
62+
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4
63+
echo "deb https://repo.clickhouse.com/deb/stable/ main/" | sudo tee /etc/apt/sources.list.d/clickhouse.list
64+
sudo apt-get update
65+
sudo apt-get install -y \
66+
clickhouse-server=${{env.CH_SERVER_VERSION}} \
67+
clickhouse-client=${{env.CH_SERVER_VERSION}} \
68+
clickhouse-common-static=${{env.CH_SERVER_VERSION}}
69+
sudo service clickhouse-server start
70+
71+
- name: Test
72+
working-directory: ${{github.workspace}}/build/ut
73+
# Execute tests defined by the CMake configuration.
74+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
75+
#run: ctest -C ${{env.BUILD_TYPE}}
76+
run: ./clickhouse-cpp-ut "${{env.GTEST_FILTER}}"
77+

.github/workflows/macos.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: macOS
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
BUILD_TYPE: Release
11+
# It is impossible to start CH server in docker on macos due to github actions limitations,
12+
# so limit tests to ones that do no require server interaction.
13+
GTEST_FILTER: --gtest_filter=-"Client/*:*Performance*"
14+
15+
jobs:
16+
build:
17+
runs-on: macos-11
18+
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- name: Configure CMake
23+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTS=ON
24+
25+
- name: Build
26+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target all
27+
28+
- name: Test
29+
working-directory: ${{github.workspace}}/build/ut
30+
run: ./clickhouse-cpp-ut "${{env.GTEST_FILTER}}"

.travis.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,23 @@ matrix:
4040

4141
before_install: |
4242
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
43+
export CH_SERVER_VERSION="21.3.17.2"
4344
sudo apt-get install apt-transport-https ca-certificates dirmngr
4445
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4
45-
echo "deb https://repo.clickhouse.tech/deb/stable/ main/" | sudo tee \
46-
/etc/apt/sources.list.d/clickhouse.list
47-
sudo apt-get update -q && sudo apt-get install -q -y --allow-unauthenticated clickhouse-server
46+
echo "deb https://repo.clickhouse.com/deb/stable/ main/" | sudo tee /etc/apt/sources.list.d/clickhouse.list
47+
sudo apt-get update
48+
sudo apt-get install -y \
49+
clickhouse-server=${CH_SERVER_VERSION} \
50+
clickhouse-client=${CH_SERVER_VERSION} \
51+
clickhouse-common-static=${CH_SERVER_VERSION}
4852
sudo service clickhouse-server start
4953
fi
5054
5155
# Build steps
52-
script:
53-
- eval "${MATRIX_EVAL}"
54-
- mkdir build
55-
- cd build
56-
- cmake .. -DBUILD_TESTS=ON && make
57-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./ut/clickhouse-cpp-ut ; fi
58-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./ut/clickhouse-cpp-ut --gtest_filter=-"Client/*:*Performance*" ; fi
56+
script: |
57+
eval "${MATRIX_EVAL}"
58+
mkdir build
59+
cd build
60+
cmake .. -DBUILD_TESTS=ON && make
61+
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./ut/clickhouse-cpp-ut ; fi
62+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./ut/clickhouse-cpp-ut --gtest_filter=-"Client/*:*Performance*" ; fi

clickhouse/columns/column.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "../columns/itemview.h"
77

88
#include <memory>
9+
#include <stdexcept>
910

1011
namespace clickhouse {
1112

0 commit comments

Comments
 (0)