6.0.8 #690
Workflow file for this run
This file contains 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: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build-php: | |
name: Build PHP ${{ matrix.php }}, Valgrind ${{ matrix.valgrind }} | |
concurrency: php-debug-${{ matrix.php }}-valgrind-${{ matrix.valgrind }}-ubuntu2004-${{ github.ref }} | |
strategy: | |
matrix: | |
php: [8.1.14, 8.2.1] | |
valgrind: [0, 1] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Install PHP build dependencies | |
run: sudo apt-get update && sudo apt-get install libzip5 | |
- name: Restore PHP build cache | |
uses: actions/cache@v3 | |
id: php-build-cache | |
with: | |
path: ${{ github.workspace }}/php | |
key: php-debug-${{ matrix.php }}-valgrind-${{ matrix.valgrind }}-ubuntu2004 | |
- name: Clone php-build repository | |
if: steps.php-build-cache.outputs.cache-hit != 'true' | |
uses: actions/checkout@v3 | |
with: | |
repository: php-build/php-build | |
path: php-build | |
- name: Install Valgrind | |
if: matrix.valgrind == '1' && steps.php-build-cache.outputs.cache-hit != 'true' | |
run: | | |
sudo apt-get update && sudo apt-get install valgrind | |
echo "TEST_PHP_ARGS=-m" >> $GITHUB_ENV | |
echo "CFLAGS=-DZEND_TRACK_ARENA_ALLOC=1" >> $GITHUB_ENV | |
echo "PHP_BUILD_CONFIGURE_OPTS=--with-valgrind" >> $GITHUB_ENV | |
- 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=on PHP_BUILD_CONFIGURE_OPTS="$PHP_BUILD_CONFIGURE_OPTS --enable-debug" ./bin/php-build ${{ matrix.php }} $GITHUB_WORKSPACE/php | |
test-extension: | |
name: Test (PHP ${{ matrix.php }}, OPcache ${{ matrix.opcache }}, Valgrind ${{ matrix.valgrind }}) | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [8.1.14, 8.2.1] | |
valgrind: [0, 1] | |
opcache: | |
- "off" | |
- "on" | |
- "jit" | |
#- "jit-tracing" #borked until 8.3 due to php-src bugs | |
needs: build-php | |
runs-on: ubuntu-20.04 | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- name: Install PHP build dependencies | |
run: sudo apt-get update && sudo apt-get install libzip5 | |
- name: Restore PHP build cache | |
uses: actions/cache@v3 | |
id: php-build-cache | |
with: | |
path: ${{ github.workspace }}/php | |
key: php-debug-${{ matrix.php }}-valgrind-${{ matrix.valgrind }}-ubuntu2004 | |
- name: Install Valgrind | |
if: matrix.valgrind == '1' | |
run: | | |
sudo apt-get update && sudo apt-get install valgrind | |
echo "TEST_PHP_ARGS=-m" >> $GITHUB_ENV | |
echo "CFLAGS=-DZEND_TRACK_ARENA_ALLOC=1" >> $GITHUB_ENV | |
- name: Compile extension | |
run: | | |
$GITHUB_WORKSPACE/php/bin/phpize | |
./configure --with-php-config=$GITHUB_WORKSPACE/php/bin/php-config | |
make install | |
- name: Generate php.ini | |
run: | | |
echo "extension=pmmpthread.so" > $GITHUB_WORKSPACE/php.ini | |
if [[ "${{ matrix.opcache }}" != "off" ]]; then | |
echo "Enabling OPcache" | |
echo "zend_extension=opcache.so" >> $GITHUB_WORKSPACE/php.ini | |
echo "opcache.enable=1" >> $GITHUB_WORKSPACE/php.ini | |
echo "opcache.enable_cli=1" >> $GITHUB_WORKSPACE/php.ini | |
if [[ "${{ matrix.opcache }}" == "jit" ]]; then | |
echo "opcache.jit=1205" >> $GITHUB_WORKSPACE/php.ini | |
echo "opcache.jit_buffer_size=128M" >> $GITHUB_WORKSPACE/php.ini | |
elif [[ "${{ matrix.opcache }}" == "jit-tracing" ]]; then | |
echo "opcache.jit=tracing" >> $GITHUB_WORKSPACE/php.ini | |
echo "opcache.jit_buffer_size=128M" >> $GITHUB_WORKSPACE/php.ini | |
fi | |
else | |
echo "OPcache is not enabled for this run" | |
fi | |
- name: Run PHPT tests | |
run: | | |
$GITHUB_WORKSPACE/php/bin/php ./run-tests.php $TEST_PHP_ARGS -P -j$(nproc) -q --show-diff --show-slow 30000 -n -c $GITHUB_WORKSPACE/php.ini | |
- name: Upload test results | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-results-${{ matrix.php }}-valgrind-${{ matrix.valgrind }}-opcache-${{ matrix.opcache }} | |
path: | | |
${{ github.workspace }}/tests/*.log | |
${{ github.workspace }}/tests/*.diff | |
${{ github.workspace }}/tests/*.mem | |
if-no-files-found: ignore |