From adc3d0e0ccae2dfa8ab795cccaed5da8fb7fe3ae Mon Sep 17 00:00:00 2001 From: Dylan T Date: Mon, 4 Sep 2023 14:23:43 +0100 Subject: [PATCH] Fixed snapshot build to not use php-build --- .github/workflows/php-snapshot.yml | 56 +++++++++++++++++++----------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/.github/workflows/php-snapshot.yml b/.github/workflows/php-snapshot.yml index 918e1c0..9bc8d54 100644 --- a/.github/workflows/php-snapshot.yml +++ b/.github/workflows/php-snapshot.yml @@ -1,4 +1,4 @@ -name: PHP snapshot build +name: PHP master branch build on: schedule: @@ -8,17 +8,20 @@ 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 @@ -26,37 +29,53 @@ jobs: 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 @@ -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