Update README.md #15
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: Build ext_parallelx | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| if: startsWith(github.event.head_commit.message, '⚙️') | |
| runs-on: ubuntu-22.04 | |
| name: Build & Test (PHP ${{ matrix.php }}) | |
| strategy: | |
| matrix: | |
| php: [8.3.25, 8.4.14] | |
| env: | |
| PHP_VERSION: ${{ matrix.php }} | |
| CFLAGS: "-march=x86-64 -ftree-vectorize -fopt-info-vec" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential autoconf bison re2c valgrind pkg-config libssl-dev | |
| - name: Restore PHP build cache | |
| uses: actions/cache@v4 | |
| id: php-build-cache | |
| with: | |
| path: ${{ github.workspace }}/php-${{ matrix.php }} | |
| key: php-${{ matrix.php }} | |
| - name: Get number of CPU cores | |
| if: steps.php-build-cache.outputs.cache-hit != 'true' | |
| uses: SimenB/github-actions-cpu-cores@v2 | |
| id: cpu-cores | |
| - name: Download PHP | |
| if: steps.php-build-cache.outputs.cache-hit != 'true' | |
| working-directory: /tmp | |
| run: curl -L https://github.com/php/php-src/archive/refs/tags/php-${{ matrix.php }}.tar.gz | tar -xz | |
| - name: Compile PHP | |
| if: steps.php-build-cache.outputs.cache-hit != 'true' | |
| working-directory: /tmp/php-src-php-${{ matrix.php }} | |
| run: | | |
| ./buildconf --force | |
| ./configure \ | |
| --disable-all \ | |
| --enable-cli \ | |
| --enable-zts \ | |
| --disable-debug \ | |
| --with-valgrind \ | |
| --prefix="${{ github.workspace }}/php-${{ matrix.php }}" | |
| make -j ${{ steps.cpu-cores.outputs.count }} install | |
| - name: Dump PHP info | |
| run: $GITHUB_WORKSPACE/php-${{ matrix.php }}/bin/php -i | |
| - name: Build ext_parallelx | |
| run: | | |
| export PHP=$GITHUB_WORKSPACE/php-${{ matrix.php }} | |
| $PHP/bin/phpize | |
| ./configure --with-php-config=$PHP/bin/php-config CC=gcc | |
| make clean | |
| make CC=gcc -j$(nproc) | |
| make install | |
| echo "extension=parallelx.so" >> $PHP/lib/php.ini | |
| $PHP/bin/php -m | |
| - name: Run PHPT tests | |
| run: | | |
| REPORT_EXIT_STATUS=1 NO_INTERACTION=1 TEST_PHP_ARGS="-m" make test | |
| - name: Upload ext_parallelx artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ext_parallelx-${{ matrix.php }} | |
| path: | | |
| ${{ github.workspace }}/php-${{ matrix.php }}/lib/php/extensions/**/parallelx.so | |
| ${{ github.workspace }}/php-${{ matrix.php }}/lib/php.ini |