Use pmmp/setup-php-action to compile PHP

This commit is contained in:
Dylan K. Taylor 2021-11-07 23:13:56 +00:00
parent b392651354
commit eb3530b6e6
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
3 changed files with 20 additions and 102 deletions

View File

@ -16,17 +16,11 @@ jobs:
php: [8.0.11] php: [8.0.11]
steps: steps:
- uses: actions/checkout@v2 #needed for build.sh - name: Build and prepare PHP cache
- name: Check for PHP build cache uses: pmmp/setup-php-action@e232f72a4330a07aae8418e8aa56b64efcdda636
id: php-build-cache
uses: actions/cache@v2
with: with:
path: "./bin" php-version: ${{ matrix.php }}
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}" install-path: "./bin"
- name: Compile PHP
if: steps.php-build-cache.outputs.cache-hit != 'true'
run: ./tests/gh-actions/build.sh "${{ matrix.php }}"
phpstan: phpstan:
name: PHPStan analysis name: PHPStan analysis
@ -42,23 +36,11 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Restore PHP build cache - name: Setup PHP
id: php-build-cache uses: pmmp/setup-php-action@e232f72a4330a07aae8418e8aa56b64efcdda636
uses: actions/cache@v2
with: with:
path: "./bin" php-version: ${{ matrix.php }}
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}" install-path: "./bin"
- name: Kill build on PHP build cache miss (should never happen)
if: steps.php-build-cache.outputs.cache-hit != 'true'
run: exit 1
- name: Install cached PHP's dependencies
if: steps.php-build-cache.outputs.cache-hit == 'true'
run: ./tests/gh-actions/install-dependencies.sh
- name: Prefix PHP to PATH
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
- name: Install Composer - name: Install Composer
run: curl -sS https://getcomposer.org/installer | php run: curl -sS https://getcomposer.org/installer | php
@ -92,23 +74,11 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Restore PHP build cache - name: Setup PHP
id: php-build-cache uses: pmmp/setup-php-action@e232f72a4330a07aae8418e8aa56b64efcdda636
uses: actions/cache@v2
with: with:
path: "./bin" php-version: ${{ matrix.php }}
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}" install-path: "./bin"
- name: Kill build on PHP build cache miss (should never happen)
if: steps.php-build-cache.outputs.cache-hit != 'true'
run: exit 1
- name: Install cached PHP's dependencies
if: steps.php-build-cache.outputs.cache-hit == 'true'
run: ./tests/gh-actions/install-dependencies.sh
- name: Prefix PHP to PATH
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
- name: Install Composer - name: Install Composer
run: curl -sS https://getcomposer.org/installer | php run: curl -sS https://getcomposer.org/installer | php
@ -144,23 +114,11 @@ jobs:
with: with:
submodules: true submodules: true
- name: Restore PHP build cache - name: Setup PHP
id: php-build-cache uses: pmmp/setup-php-action@e232f72a4330a07aae8418e8aa56b64efcdda636
uses: actions/cache@v2
with: with:
path: "./bin" php-version: ${{ matrix.php }}
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}" install-path: "./bin"
- name: Kill build on PHP build cache miss (should never happen)
if: steps.php-build-cache.outputs.cache-hit != 'true'
run: exit 1
- name: Install cached PHP's dependencies
if: steps.php-build-cache.outputs.cache-hit == 'true'
run: ./tests/gh-actions/install-dependencies.sh
- name: Prefix PHP to PATH
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
- name: Install Composer - name: Install Composer
run: curl -sS https://getcomposer.org/installer | php run: curl -sS https://getcomposer.org/installer | php
@ -196,23 +154,11 @@ jobs:
with: with:
submodules: true submodules: true
- name: Restore PHP build cache - name: Setup PHP
id: php-build-cache uses: pmmp/setup-php-action@e232f72a4330a07aae8418e8aa56b64efcdda636
uses: actions/cache@v2
with: with:
path: "./bin" php-version: ${{ matrix.php }}
key: "php-build-generic-${{ matrix.php }}-${{ matrix.image }}-${{ hashFiles('./tests/gh-actions/build.sh') }}" install-path: "./bin"
- name: Kill build on PHP build cache miss (should never happen)
if: steps.php-build-cache.outputs.cache-hit != 'true'
run: exit 1
- name: Install cached PHP's dependencies
if: steps.php-build-cache.outputs.cache-hit == 'true'
run: ./tests/gh-actions/install-dependencies.sh
- name: Prefix PHP to PATH
run: echo "$(pwd)/bin/php7/bin" >> $GITHUB_PATH
- name: Install Composer - name: Install Composer
run: curl -sS https://getcomposer.org/installer | php run: curl -sS https://getcomposer.org/installer | php

View File

@ -1,25 +0,0 @@
VERSION="$1"
sudo apt update && sudo apt install -y \
re2c \
libtool \
libtool-bin \
zlib1g-dev \
libcurl4-openssl-dev \
libxml2-dev \
libyaml-dev \
libgmp-dev \
libzip-dev \
libssl-dev
INSTALL_DIR="$(pwd)/bin/php7"
export CFLAGS="$CFLAGS -march=x86-64"
export CXXFLAGS="$CXXFLAGS -march=x86-64"
git clone https://github.com/pmmp/php-build.git
cd php-build
./install-dependencies.sh
echo '"pthreads",,"https://github.com/pmmp/pthreads.git",,,"extension",' >> share/php-build/extension/definition
PHP_BUILD_INSTALL_EXTENSION='pthreads=@4.0.0 yaml=2.2.1' PHP_BUILD_ZTS_ENABLE=on ./bin/php-build "$VERSION" "$INSTALL_DIR" || exit 1
rm "$INSTALL_DIR/etc/conf.d/xdebug.ini" || true

View File

@ -1,3 +0,0 @@
#!/bin/bash
sudo apt update && sudo apt install -y \
libzip5