Merge pull request #67 from yuvalif/increase-test-coverage #191
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.lib_type }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| lib_type: [shared] | |
| include: | |
| - os: ubuntu-latest | |
| lib_type: static | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install dependencies (Ubuntu) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y lsb-release valgrind | |
| 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-get install -y ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb | |
| sudo apt-get update | |
| sudo apt-get install -y libarrow-dev libboost-coroutine-dev libboost-context-dev | |
| - name: Install dependencies (macOS) | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| brew install apache-arrow protobuf boost | |
| - name: Configure CMake | |
| run: | | |
| mkdir -p build | |
| cd build | |
| cmake .. -G Ninja -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release \ | |
| -DBUILD_SHARED_LIBS=${{ matrix.lib_type == 'shared' && 'ON' || 'OFF' }} | |
| - name: Build | |
| run: ninja -C build | |
| - name: Check | |
| if: matrix.lib_type == 'shared' | |
| run: ninja -C build check | |
| - name: Test | |
| run: ctest --test-dir build -j | |
| build_almalinux: | |
| name: Build on AlmaLinux 10 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: almalinux:10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Enable CRB and EPEL repos | |
| run: | | |
| dnf install -y dnf-plugins-core epel-release | |
| dnf config-manager --set-enabled crb | |
| - name: Install Apache Arrow repo | |
| run: > | |
| dnf install -y | |
| "https://packages.apache.org/artifactory/arrow/almalinux/10/apache-arrow-release-latest.rpm" | |
| - name: Install build tools | |
| run: dnf install -y gcc gcc-c++ cmake ninja-build protobuf-compiler protobuf-devel rust cargo arrow-devel valgrind git boost-devel | |
| - name: Configure CMake | |
| run: | | |
| mkdir -p build | |
| cd build | |
| cmake .. -G Ninja -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DSTRIP_FORTIFY_SOURCE=ON | |
| - name: Build | |
| run: ninja -C build | |
| - name: Test | |
| run: ctest --test-dir build -j | |
| cross_compile: | |
| name: Cross-compile Windows on Linux | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup CMake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: '4.1' | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-pc-windows-gnu | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y mingw-w64 protobuf-compiler | |
| - name: Create toolchain file | |
| run: | | |
| cat <<EOF > toolchain.cmake | |
| set(CMAKE_SYSTEM_NAME Windows) | |
| set(CMAKE_SYSTEM_PROCESSOR x86_64) | |
| set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-posix) | |
| set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix) | |
| set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) | |
| set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | |
| set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | |
| set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | |
| EOF | |
| - name: Cache Arrow | |
| id: cache-arrow | |
| uses: actions/cache@v4 | |
| with: | |
| path: arrow-install | |
| key: ${{ runner.os }}-mingw-arrow-22.0.0 | |
| - name: Build Arrow | |
| if: steps.cache-arrow.outputs.cache-hit != 'true' | |
| run: | | |
| wget https://archive.apache.org/dist/arrow/arrow-22.0.0/apache-arrow-22.0.0.tar.gz | |
| tar xzf apache-arrow-22.0.0.tar.gz | |
| mkdir -p arrow-install | |
| cd apache-arrow-22.0.0/cpp | |
| mkdir -p build && cd build | |
| cmake .. -G Ninja \ | |
| -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/toolchain.cmake \ | |
| -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/arrow-install \ | |
| -DARROW_BUILD_SHARED=OFF \ | |
| -DARROW_BUILD_STATIC=ON \ | |
| -DARROW_WITH_RE2=OFF \ | |
| -DARROW_WITH_UTF8PROC=OFF \ | |
| -DCMAKE_BUILD_TYPE=Release | |
| ninja install | |
| - name: Configure CMake | |
| run: | | |
| mkdir -p build | |
| cd build | |
| cmake .. -G Ninja \ | |
| -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/toolchain.cmake \ | |
| -DCMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/arrow-install \ | |
| -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release | |
| - name: Build | |
| run: ninja -C build |