Skip to content

Merge branch '1.4.x' into 1-4-9-merge-up-to-1-5-x #842

Merge branch '1.4.x' into 1-4-9-merge-up-to-1-5-x

Merge branch '1.4.x' into 1-4-9-merge-up-to-1-5-x #842

name: "Continuous Integration"
on:
pull_request:
push:
permissions:
contents: read
jobs:
unit-tests:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system:
- ubuntu-latest
- windows-latest
php-versions:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'
steps:
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 #2.37.2
with:
php-version: ${{ matrix.php-versions }}
extensions: intl, sodium, zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0
with:
persist-credentials: false
- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda #4.0.0
- name: GH token (non-Windows)
if: matrix.operating-system != 'windows-latest'
run: sudo composer config --global --auth github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
- name: GH token (Windows)
if: matrix.operating-system == 'windows-latest'
run: composer config --global --auth github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
- name: Run PHPUnit on Windows
if: matrix.operating-system == 'windows-latest'
run: vendor/bin/phpunit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run PHPUnit on non-Windows
if: matrix.operating-system != 'windows-latest'
run: sudo vendor/bin/phpunit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
unit-tests-freebsd:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions:
- '82'
- '83'
- '84'
- '85'
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0
with:
persist-credentials: false
- name: Test in FreeBSD
uses: vmactions/freebsd-vm@5a72679103d223925653750faa878a143340fbd0 #v1.5.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
envs: 'GITHUB_TOKEN'
usesh: true
prepare: |
pkg install -y \
php${{ matrix.php-versions }} \
php${{ matrix.php-versions }}-composer \
php${{ matrix.php-versions }}-ctype \
php${{ matrix.php-versions }}-curl \
php${{ matrix.php-versions }}-dom \
php${{ matrix.php-versions }}-filter \
php${{ matrix.php-versions }}-iconv \
php${{ matrix.php-versions }}-intl \
php${{ matrix.php-versions }}-mbstring \
php${{ matrix.php-versions }}-pcntl \
php${{ matrix.php-versions }}-phar \
php${{ matrix.php-versions }}-posix \
php${{ matrix.php-versions }}-session \
php${{ matrix.php-versions }}-simplexml \
php${{ matrix.php-versions }}-sodium \
php${{ matrix.php-versions }}-tokenizer \
php${{ matrix.php-versions }}-xml \
php${{ matrix.php-versions }}-xmlwriter \
php${{ matrix.php-versions }}-zip \
autoconf \
automake \
bash \
bison \
ca_root_nss \
gmake \
libtool \
pkgconf \
re2c \
sudo \
git
run: |
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
composer config --global --auth github-oauth.github.com "$GITHUB_TOKEN"
composer install
vendor/bin/phpunit
bundled-php-extension-tests:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system:
- ubuntu-latest
php-versions:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'
steps:
- name: "Purge built-in PHP version"
run: |
echo "libmemcached11 php* hhvm libhashkit2" | xargs -n 1 sudo apt-get purge --assume-yes || true
sudo apt-add-repository --remove ppa:ondrej/php -y
- name: Install platform dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
g++ gcc make autoconf libtool bison re2c pkg-config unzip \
libcurl4-openssl-dev \
liblmdb-dev \
libdb-dev \
libqdbm-dev \
libenchant-2-dev \
libexif-dev \
libgd-dev \
libpng-dev \
libtiff-dev \
libfreetype-dev \
libfreetype6 \
libfontconfig1-dev \
libgmp-dev \
libssl-dev \
libsodium-dev \
libxml2-dev \
libonig-dev \
libldap-dev \
libedit-dev \
libsnmp-dev \
libtidy-dev \
libxslt1-dev \
libsasl2-dev \
libpq-dev \
libsqlite3-dev \
libbz2-dev \
libzip-dev
- name: "Set php-src download URL"
run: |
DIST_URL=`curl -fsSL "https://www.php.net/releases/index.php?json&max=1&version=${{ matrix.php-versions }}" | jq -r '.[].source[]|select(.filename|endswith(".gz")).filename'`
echo "php_src_download_url=https://www.php.net/distributions/$DIST_URL" >> $GITHUB_ENV
- name: "Install PHP ${{ matrix.php-versions }}"
env:
php_src_download_url: ${{ env.php_src_download_url }}
run: |
mkdir -p /tmp/php
mkdir -p /tmp/php.ini.d
cd /tmp/php
echo "Downloading release from ${php_src_download_url} ..."
wget -O php.tgz ${php_src_download_url}
tar zxf php.tgz
rm php.tgz
ls -l
cd *
ls -l
./buildconf --force
./configure --disable-dom --disable-xml --disable-xmlreader --disable-xmlwriter --disable-json --with-openssl --with-config-file-scan-dir=/tmp/php.ini.d
make -j$(nproc)
sudo make install
cd $GITHUB_WORKSPACE
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0
with:
persist-credentials: false
- name: Composer Install
run: composer install --ignore-platform-reqs
- name: Run bundled PHP install test
run: sudo php test/install-bundled-php-exts.php php-config
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
end-to-end-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0
with:
fetch-depth: 0
persist-credentials: false
# Fixes `git describe` picking the wrong tag - see https://github.com/php/pie/issues/307
- run: git fetch --tags --force
# Ensure some kind of previous tag exists, otherwise box fails
- run: git describe --tags HEAD || git tag 0.0.0
- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda #4.0.0
- name: Run the tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: test/end-to-end/dockerfile-e2e-test.sh
behaviour-tests:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system:
- ubuntu-latest
php-versions:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
- '8.5'
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0
with:
fetch-depth: 0
persist-credentials: false
# Fixes `git describe` picking the wrong tag - see https://github.com/php/pie/issues/307
- run: git fetch --tags --force
# Ensure some kind of previous tag exists, otherwise box fails
- run: git describe --tags HEAD || git tag 0.0.0
- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda #4.0.0
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: docker buildx build --file .github/pie-behaviour-tests/Dockerfile --secret id=GITHUB_TOKEN,env=GITHUB_TOKEN --build-arg PHP_VERSION=${{ matrix.php-versions }} -t pie-behat-test .
- name: Run Behat
run: docker run --volume .:/github/workspace pie-behat-test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
coding-standards:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 #2.37.2
with:
php-version: 8.1
extensions: intl, sodium, zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0
with:
persist-credentials: false
- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda #4.0.0
- name: Run PHPCS
run: vendor/bin/phpcs
static-analysis:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 #2.37.2
with:
php-version: 8.5
extensions: intl, sodium, zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0
with:
persist-credentials: false
- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda #4.0.0
- name: Validate the composer configuration
run: composer validate --strict
- name: Run phpstan
run: vendor/bin/phpstan
mutation-testing:
runs-on: ubuntu-latest
steps:
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 #2.37.2
with:
php-version: 8.4
extensions: intl, sodium, zip
tools: infection
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0
with:
persist-credentials: false
- uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda #4.0.0
- name: Run infection
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sudo infection --min-msi=68 --min-covered-msi=68 --threads=max --show-mutations=max --no-progress
zizmor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 #v7.0.0
with:
persist-credentials: false
- uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa #v0.5.7
with:
advanced-security: false
build-assets:
needs:
- unit-tests
- coding-standards
- static-analysis
# See build-assets.yml for a list of the permissions and why they are needed
permissions:
contents: read
id-token: write
attestations: write
uses: ./.github/workflows/build-assets.yml