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

Add C++ compile Github Action, add third_party for dependencies #475

Merged
merged 3 commits into from
Mar 9, 2024
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
45 changes: 45 additions & 0 deletions .github/workflows/check_cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Check C++ Code

on:
push:
branches: [ main ]
paths:
- 'cpp/**'
pull_request:
branches: [ main ]
paths:
- 'cpp/**'
workflow_dispatch: {}

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug

jobs:
build:
name: Check C++ Code
timeout-minutes: 30

runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Add Arrow remote package repository
run: >-
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb &&
sudo apt install ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb

- name: Install Dependencies
run: >-
sudo apt update &&
sudo apt install libarrow-dev libarrow-flight-dev libarrow-flight-sql-dev sqlite3 libboost-all-dev

- name: Configure Project using CMake
working-directory: ${{github.workspace}}/cpp
run: cmake -B ${{github.workspace}}/cpp/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Compile Project
working-directory: ${{github.workspace}}/cpp/build
run: make -j
timeout-minutes: 15
15 changes: 4 additions & 11 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,10 @@ project(brad)
find_package(Arrow REQUIRED)
find_package(ArrowFlight REQUIRED)
find_package(ArrowFlightSql REQUIRED)

find_package(gflags REQUIRED)

find_package(SQLite3 REQUIRED)
find_package(Boost REQUIRED)

include(FetchContent)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11.git
GIT_TAG v2.11.1
)
FetchContent_MakeAvailable(pybind11)
add_subdirectory(third_party)

add_library(brad_server_lib OBJECT
server/brad_server_simple.cc
Expand Down Expand Up @@ -60,7 +52,8 @@ target_link_libraries(flight_sql_example_server
PRIVATE ArrowFlightSql::arrow_flight_sql_shared
PRIVATE sqlite_server_lib
gflags
${SQLite3_LIBRARIES})
${SQLite3_LIBRARIES}
${Boost_LIBRARIES})

add_executable(flight_sql_brad_server flight_sql_brad_server.cc)
target_link_libraries(flight_sql_brad_server
Expand Down
2 changes: 0 additions & 2 deletions cpp/server/brad_server_simple.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "brad_server_simple.h"

#define BOOST_NO_CXX98_FUNCTION_BASE // ARROW-17805
#include <boost/algorithm/string.hpp>
#include <mutex>
#include <random>
#include <sstream>
Expand Down
15 changes: 15 additions & 0 deletions cpp/third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include(FetchContent)

FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11.git
GIT_TAG v2.11.1
)

FetchContent_Declare(
gflags
GIT_REPOSITORY https://github.com/gflags/gflags
GIT_TAG v2.2.2
)

FetchContent_MakeAvailable(pybind11 gflags)