mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-16 16:34:05 +00:00
Use pmmp/setup-php-action to compile PHP
This commit is contained in:
parent
b392651354
commit
eb3530b6e6
94
.github/workflows/main.yml
vendored
94
.github/workflows/main.yml
vendored
@ -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
|
||||||
|
@ -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
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
sudo apt update && sudo apt install -y \
|
|
||||||
libzip5
|
|
Loading…
x
Reference in New Issue
Block a user