|
| 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 | + |
0 commit comments