mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-04 17:20:02 +00:00
first shot building multi PHP versions on actions
This commit is contained in:
parent
ec9b39862b
commit
da71540fce
34
.github/workflows/main.yml
vendored
34
.github/workflows/main.yml
vendored
@ -9,7 +9,11 @@ jobs:
|
|||||||
build-php:
|
build-php:
|
||||||
name: Prepare PHP
|
name: Prepare PHP
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php: [7.3.25, 7.4.13]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2 #needed for build.sh
|
- uses: actions/checkout@v2 #needed for build.sh
|
||||||
- name: Check for PHP build cache
|
- name: Check for PHP build cache
|
||||||
@ -17,17 +21,21 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: "./bin"
|
path: "./bin"
|
||||||
key: "php-build-generic-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
key: "php-build-generic-${{ matrix.php }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||||
|
|
||||||
- name: Compile PHP
|
- name: Compile PHP
|
||||||
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
||||||
run: ./tests/gh-actions/build.sh
|
run: ./tests/gh-actions/build.sh "${{ matrix.php }}"
|
||||||
|
|
||||||
phpstan:
|
phpstan:
|
||||||
name: PHPStan analysis
|
name: PHPStan analysis
|
||||||
needs: build-php
|
needs: build-php
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php: [7.3.25, 7.4.13]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
@ -36,7 +44,7 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: "./bin"
|
path: "./bin"
|
||||||
key: "php-build-generic-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
key: "php-build-generic-${{ matrix.php }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||||
|
|
||||||
- name: Kill build on PHP build cache miss (should never happen)
|
- name: Kill build on PHP build cache miss (should never happen)
|
||||||
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
||||||
@ -54,7 +62,7 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
~/.cache/composer/files
|
~/.cache/composer/files
|
||||||
~/.cache/composer/vcs
|
~/.cache/composer/vcs
|
||||||
key: "composer-v2-cache-${{ hashFiles('./composer.lock') }}"
|
key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.lock') }}"
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
composer-v2-cache-
|
composer-v2-cache-
|
||||||
|
|
||||||
@ -68,6 +76,10 @@ jobs:
|
|||||||
name: PHPUnit tests
|
name: PHPUnit tests
|
||||||
needs: build-php
|
needs: build-php
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php: [7.3.25, 7.4.13]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
@ -76,7 +88,7 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: "./bin"
|
path: "./bin"
|
||||||
key: "php-build-generic-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
key: "php-build-generic-${{ matrix.php }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||||
|
|
||||||
- name: Kill build on PHP build cache miss (should never happen)
|
- name: Kill build on PHP build cache miss (should never happen)
|
||||||
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
||||||
@ -94,7 +106,7 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
~/.cache/composer/files
|
~/.cache/composer/files
|
||||||
~/.cache/composer/vcs
|
~/.cache/composer/vcs
|
||||||
key: "composer-v2-cache-${{ hashFiles('./composer.lock') }}"
|
key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.lock') }}"
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
composer-v2-cache-
|
composer-v2-cache-
|
||||||
|
|
||||||
@ -108,6 +120,10 @@ jobs:
|
|||||||
name: Integration tests
|
name: Integration tests
|
||||||
needs: build-php
|
needs: build-php
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php: [7.3.25, 7.4.13]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
@ -118,7 +134,7 @@ jobs:
|
|||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: "./bin"
|
path: "./bin"
|
||||||
key: "php-build-generic-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
key: "php-build-generic-${{ matrix.php }}-${{ hashFiles('./tests/gh-actions/build.sh') }}"
|
||||||
|
|
||||||
- name: Kill build on PHP build cache miss (should never happen)
|
- name: Kill build on PHP build cache miss (should never happen)
|
||||||
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
if: steps.php-build-cache.outputs.cache-hit != 'true'
|
||||||
@ -136,7 +152,7 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
~/.cache/composer/files
|
~/.cache/composer/files
|
||||||
~/.cache/composer/vcs
|
~/.cache/composer/vcs
|
||||||
key: "composer-v2-cache-${{ hashFiles('./composer.lock') }}"
|
key: "composer-v2-cache-${{ matrix.php }}-${{ hashFiles('./composer.lock') }}"
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
composer-v2-cache-
|
composer-v2-cache-
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
VERSION=7.4.13
|
VERSION="$1"
|
||||||
|
|
||||||
sudo apt update && sudo apt install -y \
|
sudo apt update && sudo apt install -y \
|
||||||
re2c \
|
re2c \
|
||||||
libtool \
|
libtool \
|
||||||
@ -11,44 +12,13 @@ sudo apt update && sudo apt install -y \
|
|||||||
libzip-dev \
|
libzip-dev \
|
||||||
libssl-dev
|
libssl-dev
|
||||||
|
|
||||||
curl -sSL https://www.php.net/distributions/php-$VERSION.tar.gz | tar -xz
|
|
||||||
|
|
||||||
INSTALL_DIR="$(pwd)/bin/php7"
|
INSTALL_DIR="$(pwd)/bin/php7"
|
||||||
cd php-$VERSION
|
|
||||||
cd ext/
|
|
||||||
curl -sSL https://github.com/pmmp/pthreads/archive/2bcd8b8c10395d58b8a9bc013e3a5328080c867f.tar.gz | tar -xz
|
|
||||||
curl -sSL https://github.com/php/pecl-file_formats-yaml/archive/2.2.0.tar.gz | tar -xz
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
CFLAGS="$CFLAGS -march=x86-64"
|
export CFLAGS="$CFLAGS -march=x86-64"
|
||||||
CXXFLAGS="$CXXFLAGS -march=x86-64"
|
export CXXFLAGS="$CXXFLAGS -march=x86-64"
|
||||||
|
|
||||||
./buildconf --force
|
git clone https://github.com/php-build/php-build.git
|
||||||
./configure \
|
cd php-build
|
||||||
--prefix="$INSTALL_DIR" \
|
./install-dependencies.sh
|
||||||
--exec-prefix="$INSTALL_DIR" \
|
echo '"pthreads",,"https://github.com/pmmp/pthreads.git",,,"extension",' >> share/php-build/extension/definition
|
||||||
--enable-maintainer-zts \
|
PHP_BUILD_INSTALL_EXTENSION='pthreads=@2bcd8b8c10395d58b8a9bc013e3a5328080c867f yaml=2.2.0' PHP_BUILD_ZTS_ENABLE=on ./bin/php-build "$VERSION" "$INSTALL_DIR"
|
||||||
--enable-cli \
|
|
||||||
--disable-cgi \
|
|
||||||
--disable-phpdbg \
|
|
||||||
--disable-mbregex \
|
|
||||||
--disable-pdo \
|
|
||||||
--disable-session \
|
|
||||||
--enable-mbstring \
|
|
||||||
--enable-pthreads \
|
|
||||||
--enable-simplexml \
|
|
||||||
--enable-sockets \
|
|
||||||
--enable-xml \
|
|
||||||
--enable-xmlreader \
|
|
||||||
--enable-xmlwriter \
|
|
||||||
--with-curl \
|
|
||||||
--with-gmp \
|
|
||||||
--with-libxml \
|
|
||||||
--with-openssl \
|
|
||||||
--with-yaml \
|
|
||||||
--with-zip \
|
|
||||||
--with-zlib \
|
|
||||||
--without-pear \
|
|
||||||
--without-sqlite3
|
|
||||||
|
|
||||||
make -j8 install
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user