Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow macOS builds to compile and run SSL tests #116

Merged
merged 3 commits into from
Jan 6, 2022
Merged
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
13 changes: 5 additions & 8 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ on:
extra_install:
required: false
type: string
gtest_args:
gtest_filter:
required: false
type: string
default: "*"

env:
BUILD_TYPE: Release
Expand Down Expand Up @@ -44,8 +45,7 @@ jobs:
- uses: actions/checkout@v2

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

- name: Configure CMake
run: |
Expand All @@ -56,11 +56,8 @@ jobs:
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_TESTS=ON \
${{ inputs.extra_cmake_flags }}


- name: Build
# Build your program with the given configuration
run: |
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target all
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target all

- name: Start ClickHouse server
run: |
Expand All @@ -76,4 +73,4 @@ jobs:

- name: Test
working-directory: ${{github.workspace}}/build/ut
run: ./clickhouse-cpp-ut "${{ inputs.gtest_args }}"
run: ./clickhouse-cpp-ut --gtest_filter="${{inputs.gtest_filter}}"
4 changes: 2 additions & 2 deletions .github/workflows/linux_ssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:

jobs:
build-and-test:
uses: Enmk/clickhouse-cpp/.github/workflows/linux.yml@master
uses: ClickHouse/clickhouse-cpp/.github/workflows/linux.yml@master
with:
extra_cmake_flags: -DWITH_OPENSSL=ON
extra_install: libssl-dev
# gtest_args: --gtest_filter="-*LocalhostTLS*"
# gtest_filter: "-*LocalhostTLS*"
28 changes: 22 additions & 6 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,42 @@ 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
# 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: --gtest_filter=-"Client/*:*Performance*"

jobs:
build:
runs-on: macos-11
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

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

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

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

- name: Test
working-directory: ${{github.workspace}}/build/ut
run: ./clickhouse-cpp-ut "${{env.GTEST_FILTER}}"
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}}"
16 changes: 16 additions & 0 deletions .github/workflows/macos_ssl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: macOS-ssl
# Almost the same as regular macOS builds, BUT with enabled SSL support, requires OpenSSL installed via Homebrew ([email protected])

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-and-test:
uses: ClickHouse/clickhouse-cpp/.github/workflows/macos.yml@master
with:
extra_cmake_flags: -DWITH_OPENSSL=ON
extra_install: openssl
# gtest_filter: "-*LocalhostTLS*"
2 changes: 2 additions & 0 deletions ut/ssl_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ namespace {
// On Ubuntu 20.04 /etc/ssl/certs is a default directory with the CA files
const auto DEAFULT_CA_DIRECTORY_PATH = "/etc/ssl/certs";
#elif defined(__APPLE__)
// On macOS we will rely on Homebrew's OpenSSL installation
const auto DEAFULT_CA_DIRECTORY_PATH = "/usr/local/etc/[email protected]/cert.pem";
#elif defined(_win_)
#endif

Expand Down