Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 25 additions & 60 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,80 +7,45 @@ on:
- "master"
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
name: PHP ${{ matrix.php }} ZTS ${{ matrix.zts }} OPcache ${{ matrix.opcache }}
# The type of runner that the job will run on
runs-on: ubuntu-20.04
name: PHP ${{ matrix.php }} PHPTS ${{ matrix.phpts }} OPcache ${{ matrix.opcache }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php:
- 7.4.14
- 8.0.1
- 8.1snapshot
- 8.2snapshot
- 8.3snapshot
- 8.4snapshot
zts: [on, off]
opcache: [on, off]
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"
phpts: ["ts", "nts"]
opcache: [1, 0]

steps:
- uses: actions/checkout@v2

- name: Restore PHP build cache
id: php-build-cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/php
key: php-build-${{ matrix.php }}-zts-${{ matrix.zts }}

- name: Clone php-build/php-build
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
repository: php-build/php-build
path: ${{ github.workspace }}/php-build

- name: Install PHP dependencies
run: ${{ github.workspace }}/php-build/install-dependencies.sh

- name: Compile PHP
if: steps.php-build-cache.outputs.cache-hit != 'true'
run: |
cd ${{ github.workspace }}/php-build
./install-dependencies.sh
PHP_BUILD_ZTS_ENABLE=${{ matrix.zts }} ./bin/php-build ${{ matrix.php }} ${{ github.workspace }}/php
php-version: ${{ matrix.php }}
ini-values: opcache.enable_cli=${{ matrix.opcache }}
env:
phpts: ${{ matrix.phpts }}

- name: Install extension
working-directory: ${{ github.workspace }}
run: |
cd ${{ github.workspace }}
${{ github.workspace }}/php/bin/phpize
./configure --with-php-config=${{ github.workspace }}/php/bin/php-config
make -j8 install
echo "extension=ds.so" > ${{ github.workspace }}/php/etc/conf.d/ds.ini
rm ${{ github.workspace }}/php/etc/conf.d/xdebug.ini || true

- name: Prefix PHP to PATH
run: echo "${{ github.workspace }}/php/bin" >> $GITHUB_PATH
phpize
./configure --with-php-config=/usr/bin/php-config
sudo make -j8 install

- name: Generate OPcache configuration
run: echo "opcache.enable_cli=${{ matrix.opcache }}" > ${{ github.workspace }}/php/etc/conf.d/opcache.ini

- name: Install Composer
run: curl -sS https://getcomposer.org/installer | php
- name: Restore Composer package cache
uses: actions/cache@v2
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v3"
with:
path: |
~/.cache/composer/files
~/.cache/composer/vcs
key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.json') }}"
restore-keys: |
composer-v2-cache-

- name: Install Composer dependencies
run: php composer.phar install --prefer-dist --no-interaction
composer-options: "--prefer-dist"

- name: Run PHPUnit tests
run: php composer.phar test
run: composer test