Skip to content

Commit

Permalink
Fixed snapshot build to not use php-build
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps authored Sep 4, 2023
1 parent e533d8f commit adc3d0e
Showing 1 changed file with 36 additions and 20 deletions.
56 changes: 36 additions & 20 deletions .github/workflows/php-snapshot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PHP snapshot build
name: PHP master branch build

on:
schedule:
Expand All @@ -8,55 +8,74 @@ on:
jobs:
build-php:
name: Build PHP ${{ matrix.php }}, Valgrind ${{ matrix.valgrind }}
concurrency: php-debug-${{ matrix.php }}-valgrind-${{ matrix.valgrind }}-ubuntu2004
concurrency: php-debug-${{ matrix.php }}-valgrind-${{ matrix.valgrind }}-ubuntu2004-${{ github.ref }}
strategy:
matrix:
php: [8.3snapshot]
php:
- master
valgrind: [0, 1]

runs-on: ubuntu-20.04

steps:
- name: Install PHP build dependencies
run: sudo apt-get update && sudo apt-get install libzip5
run: |
sudo apt-get update && sudo apt-get install \
re2c
- 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-${{ github.run_id }}

- 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: Get number of CPU cores
if: steps.php-build-cache.outputs.cache-hit != 'true'
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores

- name: Download PHP
if: steps.php-build-cache.outputs.cache-hit != 'true'
run: curl -L https://github.com/php/php-src/archive/${{ matrix.php }}.tar.gz | tar -xz

- name: Compile PHP
if: steps.php-build-cache.outputs.cache-hit != 'true'
working-directory: php-src-php-${{ matrix.php }}
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
./buildconf --force
./configure \
--disable-all \
--enable-cli \
--enable-zts \
--enable-debug \
--enable-sockets \
--enable-opcache \
--enable-opcache-jit \
"$PHP_BUILD_CONFIGURE_OPTS" \
--prefix="${{ github.workspace }}/php"
make -j ${{ steps.cpu-cores.outputs.count }} install
test-extension:
name: Test (PHP ${{ matrix.php }}, OPcache ${{ matrix.opcache }}, Valgrind ${{ matrix.valgrind }})
strategy:
fail-fast: false
matrix:
php: [8.3snapshot]
php:
- master
valgrind: [0, 1]
opcache: [off, on, jit, jit-tracing]
opcache:
- "off"
- "on"
- "jit"
#- "jit-tracing" #borked until 8.3 due to php-src bugs

needs: build-php
runs-on: ubuntu-20.04
Expand All @@ -65,9 +84,6 @@ jobs:
# 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
Expand Down

0 comments on commit adc3d0e

Please sign in to comment.