Skip to content

Commit

Permalink
feat(CI): upload static link library as artifact (apache#642)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elssky committed Oct 25, 2024
1 parent 46ec380 commit 83cdc2c
Showing 1 changed file with 10 additions and 23 deletions.
33 changes: 10 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ jobs:

- 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/
Expand All @@ -62,40 +61,33 @@ jobs:
libarrow-acero-dev \
libparquet-dev
sudo apt-get install -y libboost-graph-dev ccache libcurl4-openssl-dev doxygen lcov
# install benchmark
git clone --branch v1.8.3 https://github.com/google/benchmark.git --depth 1
pushd benchmark
cmake -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_TESTING=OFF -DBENCHMARK_ENABLE_GTEST_TESTS=OFF .
sudo make install
popd
# install Catch2 v3
git clone --branch v3.6.0 https://github.com/catchorg/Catch2.git --depth 1
pushd Catch2
cmake -Bbuild -H. -DBUILD_TESTING=OFF
sudo cmake --build build/ --target install
popd
git clone https://github.com/apache/incubator-graphar-testing.git $GAR_TEST_DATA --depth 1
- name: CMake
working-directory: "cpp"
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_BENCHMARKS=ON -DCMAKE_CXX_FLAGS="--coverage" -DCMAKE_C_FLAGS="--coverage"
- name: Cpp Format and lint
working-directory: "cpp/build"
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
# validate format
function prepend() { while read line; do echo "${1}${line}"; done; }
make graphar-clformat
GIT_DIFF=$(git diff --ignore-submodules)
if [[ -n $GIT_DIFF ]]; then
Expand All @@ -117,9 +109,7 @@ jobs:
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
exit -1
fi
function ec() { [[ "$1" == "-h" ]] && { shift && eval $* > /dev/null 2>&1; ec=$?; echo $ec; } || eval $*; ec=$?; }
ec make graphar-cpplint
if [[ "$ec" != "0" ]]; then
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
Expand All @@ -131,13 +121,11 @@ jobs:
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
exit -1
fi
- name: Build Docs
working-directory: "cpp/build"
run: |
cmake -DENABLE_DOCS=ON ..
make docs
- name: Build GraphAr
working-directory: "cpp/build"
run: make -j$(nproc)
Expand All @@ -154,18 +142,16 @@ jobs:
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
lcov --list coverage.info
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Benchmark
working-directory: "cpp/build"
run: |
./graph_info_benchmark
./arrow_chunk_reader_benchmark
- name: Use Static Arrow
working-directory: "cpp"
run: |
Expand All @@ -176,7 +162,11 @@ jobs:
export ASAN_OPTIONS=detect_leaks=0
ctest --output-on-failure
popd
- name: Upload libgraphar.a artifact
uses: actions/upload-artifact@v3
with:
name: ubuntu-libgraphar.a
path: cpp/build-static/libgraphar.a
macos:
name: ${{ matrix.architecture }} macOS ${{ matrix.macos-version }} C++
runs-on: macos-${{ matrix.macos-version }}
Expand Down Expand Up @@ -209,13 +199,11 @@ jobs:
cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_BENCHMARKS=ON
make -j$(nproc)
popd
- name: Running Test
working-directory: "cpp/build"
run: |
export ASAN_OPTIONS=detect_leaks=0
ctest --output-on-failure
- name: Use Static Arrow
working-directory: "cpp"
run: |
Expand All @@ -227,9 +215,8 @@ jobs:
export ASAN_OPTIONS=detect_container_overflow=0
ctest --output-on-failure
popd
- name: Upload libgraphar.a artifact
uses: actions/upload-artifact@v3
with:
name: libgraphar
path: cpp/build-static/libgraphar.a
uses: actions/upload-artifact@v3
with:
name: macos-${{ matrix.macos-version }}-libgraphar.a
path: cpp/build-static/libgraphar.a

0 comments on commit 83cdc2c

Please sign in to comment.