|
| 1 | +name: Arrow Extension |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + secrets: |
| 6 | + CODECOV_TOKEN: |
| 7 | + required: false |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: Build and Test Extension |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + strategy: |
| 14 | + fail-fast: false |
| 15 | + matrix: |
| 16 | + os: ['ubuntu-latest', 'macos-latest'] |
| 17 | + php: ['8.3', '8.4', '8.5'] |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v5 |
| 21 | + with: |
| 22 | + submodules: true |
| 23 | + |
| 24 | + - name: Setup PHP Environment |
| 25 | + uses: ./.github/actions/setup-php-env |
| 26 | + with: |
| 27 | + php-version: ${{ matrix.php }} |
| 28 | + dependencies: locked |
| 29 | + extensions: ':psr, bcmath, dom, hash, json, mbstring, xml, xmlwriter, xmlreader, zlib' |
| 30 | + tools: 'composer:v2, php-config' |
| 31 | + install-dependencies: 'false' |
| 32 | + |
| 33 | + - name: Install Rust toolchain |
| 34 | + uses: dtolnay/rust-toolchain@stable |
| 35 | + |
| 36 | + - name: Cache cargo registry and build |
| 37 | + uses: actions/cache@v4 |
| 38 | + with: |
| 39 | + path: | |
| 40 | + ~/.cargo/registry |
| 41 | + ~/.cargo/git |
| 42 | + src/extension/arrow-ext/target |
| 43 | + key: ${{ runner.os }}-php${{ matrix.php }}-cargo-${{ hashFiles('src/extension/arrow-ext/Cargo.lock') }} |
| 44 | + restore-keys: | |
| 45 | + ${{ runner.os }}-php${{ matrix.php }}-cargo- |
| 46 | +
|
| 47 | + - name: Install build dependencies (Ubuntu) |
| 48 | + if: runner.os == 'Linux' |
| 49 | + run: | |
| 50 | + sudo apt-get update |
| 51 | + sudo apt-get install -y build-essential clang libclang-dev |
| 52 | +
|
| 53 | + - name: Install build dependencies (macOS) |
| 54 | + if: runner.os == 'macOS' |
| 55 | + run: | |
| 56 | + brew install llvm |
| 57 | + echo "LIBCLANG_PATH=$(brew --prefix llvm)/lib" >> $GITHUB_ENV |
| 58 | +
|
| 59 | + - name: Set LIBCLANG_PATH (Ubuntu) |
| 60 | + if: runner.os == 'Linux' |
| 61 | + run: | |
| 62 | + echo "LIBCLANG_PATH=$(llvm-config --libdir)" >> $GITHUB_ENV |
| 63 | +
|
| 64 | + - name: Build extension |
| 65 | + working-directory: src/extension/arrow-ext |
| 66 | + run: make build |
| 67 | + |
| 68 | + - name: Run PHPT tests |
| 69 | + working-directory: src/extension/arrow-ext |
| 70 | + run: make test |
| 71 | + |
| 72 | + - name: Install extension and verify |
| 73 | + working-directory: src/extension/arrow-ext |
| 74 | + run: | |
| 75 | + EXT_DIR=$(php -r 'echo ini_get("extension_dir");') |
| 76 | + sudo cp ext/modules/arrow.so "$EXT_DIR/" |
| 77 | + echo "extension=arrow.so" | sudo tee -a "$(php -r 'echo php_ini_loaded_file();')" |
| 78 | + php -m | grep arrow |
| 79 | +
|
| 80 | + - name: Install Composer Dependencies |
| 81 | + run: composer install --no-interaction --no-progress |
| 82 | + |
| 83 | + - name: Run Parquet Integration Tests with Arrow |
| 84 | + run: tools/phpunit/vendor/bin/phpunit --testsuite lib-parquet-integration --group apache-parquet-testing |
0 commit comments