[FEAT][C++] Refactor the C++ SDK with forward declaration and shared ptr #623
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GraphAr C++ CI | |
on: | |
# Trigger the workflow on push or pull request, | |
# but only for the main branch | |
push: | |
branches: | |
- main | |
paths: | |
- 'cpp/**' | |
- '.github/workflows/ci.yml' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'cpp/**' | |
- '.github/workflows/ci.yml' | |
concurrency: | |
group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
GraphAr-ubuntu-arrow-installed: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install dependencies | |
run: | | |
# install the latest arrow deb to test arrow | |
wget -c 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 \ | |
-P /tmp/ | |
sudo apt-get install -y /tmp/apache-arrow-apt-source-latest-"$(lsb_release --codename --short)".deb | |
sudo apt-get update -y | |
sudo apt install -y libarrow-dev=14.0.1-1 \ | |
libarrow-dataset-dev=14.0.1-1 \ | |
libarrow-acero-dev=14.0.1-1 \ | |
libparquet-dev=14.0.1-1 | |
sudo apt-get install -y libboost-graph-dev ccache libcurl4-openssl-dev | |
- name: CMake | |
run: | | |
mkdir build | |
pushd build | |
cmake ../cpp -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON | |
popd | |
- name: Cpp Format and lint | |
run: | | |
# install clang-format | |
sudo curl -L https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-22538c65/clang-format-8_linux-amd64 --output /usr/bin/clang-format | |
sudo chmod +x /usr/bin/clang-format | |
pushd build | |
# validate format | |
function prepend() { while read line; do echo "${1}${line}"; done; } | |
make gar-clformat | |
GIT_DIFF=$(git diff --ignore-submodules) | |
if [[ -n $GIT_DIFF ]]; then | |
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | |
echo "| clang-format failures found!" | |
echo "|" | |
echo "$GIT_DIFF" | prepend "| " | |
echo "|" | |
echo "| Run: " | |
echo "|" | |
echo "| make clformat" | |
echo "|" | |
echo "| to fix this error." | |
echo "|" | |
echo "| Ensure you are working with clang-format-8, which can be obtained from" | |
echo "|" | |
echo "| https://github.com/muttleyxd/clang-tools-static-binaries/releases" | |
echo "|" | |
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | |
exit -1 | |
fi | |
function ec() { [[ "$1" == "-h" ]] && { shift && eval $* > /dev/null 2>&1; ec=$?; echo $ec; } || eval $*; ec=$?; } | |
ec make gar-cpplint | |
if [[ "$ec" != "0" ]]; then | |
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | |
echo "| cpplint failures found! Run: " | |
echo "|" | |
echo "| make vineyard_cpplint" | |
echo "|" | |
echo "| to fix this error." | |
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | |
exit -1 | |
fi | |
popd | |
- name: Build GraphAr | |
run: | | |
pushd build | |
make -j$(nproc) | |
popd | |
- name: Test | |
run: | | |
cd build | |
export ASAN_OPTIONS=detect_leaks=0 | |
export GAR_TEST_DATA=$PWD/../testing/ | |
make test | |
GraphAr-centos-arrow-installed: | |
runs-on: ubuntu-latest | |
container: | |
image: centos:7 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up devtoolset-8 | |
run: | | |
# install gcc and g++ 8 | |
yum install -y centos-release-scl | |
yum install -y devtoolset-8 | |
- name: Install dependencies | |
shell: scl enable devtoolset-8 -- bash --noprofile --norc -eo pipefail {0} | |
run: | | |
# install cmake | |
yum install -y wget | |
wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz -P /tmp/ && \ | |
tar -zxf /tmp/cmake-3.12.3.tar.gz -C /tmp/ && \ | |
pushd /tmp/cmake-3.12.3 && \ | |
./bootstrap --prefix=/usr/local && \ | |
make -j$(nproc) && \ | |
make install && \ | |
popd | |
echo "cmake version: $(cmake --version)" | |
#install arrow | |
yum install -y epel-release || yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(cut -d: -f5 /etc/system-release-cpe | cut -d. -f1).noarch.rpm | |
yum install -y https://apache.jfrog.io/artifactory/arrow/centos/$(cut -d: -f5 /etc/system-release-cpe | cut -d. -f1)/apache-arrow-release-latest.rpm | |
yum install -y --enablerepo=epel arrow-devel arrow-dataset-devel arrow-acero-devel parquet-devel | |
- name: Build GraphAr | |
shell: scl enable devtoolset-8 -- bash --noprofile --norc -eo pipefail {0} | |
run: | | |
mkdir build | |
pushd build | |
cmake ../cpp | |
make -j$(nproc) | |
popd |