Skip to content

Commit

Permalink
Merge pull request #15357 from phalcon/5.0.x
Browse files Browse the repository at this point in the history
5.0.0-alpha.1 release
  • Loading branch information
niden authored Mar 31, 2021
2 parents e5bf68f + 46a7549 commit b08eab7
Show file tree
Hide file tree
Showing 1,182 changed files with 913,155 additions and 150,895 deletions.
16 changes: 16 additions & 0 deletions .ci/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
#
# This file is part of the Phalcon Framework.
#
# (c) Phalcon Team <team@phalcon.io>
#
# For the full copyright and license information, please view the
# LICENSE.txt file that was distributed with this source code.

php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter unit
php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter cli
php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter integration
php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database -g common
php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env mysql -g mysql
php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env sqlite -g sqlite
php -d extension=ext/modules/phalcon.so vendor/bin/codecept run --ext DotReporter database --env pgsql -g pgsql
2 changes: 1 addition & 1 deletion .ci/vsenv.bat
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ rem See: https://help.github.com/en/articles/development-tools-for-github-action
rem See: https://stackoverflow.com/questions/39183272/loop-through-all-environmental-variables-and-take-actions-depending-on-prefix
setlocal
for /f "delims== tokens=1,2" %%a in ('set') do (
echo ::set-env name=%%a::%%b
powershell -Command "& {Write-Output '%%a=%%b' | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append;}"
)
endlocal
12 changes: 6 additions & 6 deletions .ci/win-ci-tools.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ function DownloadPhpSrc {
function InstallPhpDevPack {
Write-Output "Install PHP Dev pack: ${env:PHP_VERSION}"

$RemoteUrl = "https://windows.php.net/downloads/releases/php-devel-pack-${env:PHP_VERSION}-${env:BUILD_TYPE}-vc${env:VC_VERSION}-${env:PHP_ARCH}.zip"
$RemoteArchiveUrl = "https://windows.php.net/downloads/releases/archives/php-devel-pack-${env:PHP_VERSION}-${env:BUILD_TYPE}-vc${env:VC_VERSION}-${env:PHP_ARCH}.zip"
$DestinationPath = "C:\Downloads\php-devel-pack-${env:PHP_VERSION}-${env:BUILD_TYPE}-VC${env:VC_VERSION}-${env:PHP_ARCH}.zip"
$RemoteUrl = "https://windows.php.net/downloads/releases/php-devel-pack-${env:PHP_VERSION}-${env:BUILD_TYPE}-${env:VC_VERSION}-${env:PHP_ARCH}.zip"
$RemoteArchiveUrl = "https://windows.php.net/downloads/releases/archives/php-devel-pack-${env:PHP_VERSION}-${env:BUILD_TYPE}-${env:VC_VERSION}-${env:PHP_ARCH}.zip"
$DestinationPath = "C:\Downloads\php-devel-pack-${env:PHP_VERSION}-${env:BUILD_TYPE}-${env:VC_VERSION}-${env:PHP_ARCH}.zip"

if (-not (Test-Path $env:PHP_DEVPACK)) {
if (-not [System.IO.File]::Exists($DestinationPath)) {
DownloadFileUsingAlternative $RemoteUrl $RemoteArchiveUrl $DestinationPath "Downloading PHP Dev pack"
}

$DestinationUnzipPath = "${env:Temp}\php-${env:PHP_VERSION}-devel-VC${env:VC_VERSION}-${env:PHP_ARCH}"
$DestinationUnzipPath = "${env:Temp}\php-${env:PHP_VERSION}-devel-${env:VC_VERSION}-${env:PHP_ARCH}"

if (-not (Test-Path "$DestinationUnzipPath")) {
Expand-Item7zip $DestinationPath $env:Temp
Expand Down Expand Up @@ -274,8 +274,8 @@ function InitializeReleaseVars {

$env:RELEASE_DLL_PATH = "${env:PHP_PECL_PATH}\phalcon\phalcon-${env:PHALCON_VERSION}\${env:RELEASE_FOLDER}\${env:EXTENSION_FILE}"

Write-Output "::set-env name=RELEASE_ZIPBALL::${env:RELEASE_ZIPBALL}"
Write-Output "::set-env name=RELEASE_DLL_PATH::${env:RELEASE_DLL_PATH}"
Write-Output "RELEASE_ZIPBALL=${env:RELEASE_ZIPBALL}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "RELEASE_DLL_PATH=${env:RELEASE_DLL_PATH}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}

function EnablePhalconExtension {
Expand Down
130 changes: 81 additions & 49 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ jobs:
# git commit -m "......... [ci skip]"
if: "!contains(github.event.head_commit.message, 'ci skip')"

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
name: Build Phalcon Pecl Package
steps:

- name: Setup Environment Variables
run: |
echo "::set-env name=ZEPHIR_PARSER_VERSION::v1.3.4"
echo "::set-env name=ZEPHIR_VERSION::0.12.19"
echo "ZEPHIR_PARSER_VERSION=v1.3.6" >> $GITHUB_ENV
echo "ZEPHIR_VERSION=0.13.0" >> $GITHUB_ENV
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.0'
extensions: mbstring, intl, json, psr
tools: pecl, prestissimo
tools: pecl

- name: Common Settings
run: |
Expand Down Expand Up @@ -73,14 +73,14 @@ jobs:
$HOME/bin/zephir generate
(cd build && php gen-build.php)
- name: Create Pecl Package
- name: Create Pecl Package (PHP 8)
id: pecl_create
run: |
cp build/php7/safe/config.w32 config.w32
cp build/php7/safe/phalcon.zep.c phalcon.zep.c
cp build/php7/safe/config.m4 config.m4
cp build/php7/safe/php_phalcon.h php_phalcon.h
cp build/php7/safe/phalcon.zep.h phalcon.zep.h
cp build/php8/safe/config.w32 config.w32
cp build/php8/safe/phalcon.zep.c phalcon.zep.c
cp build/php8/safe/config.m4 config.m4
cp build/php8/safe/php_phalcon.h php_phalcon.h
cp build/php8/safe/phalcon.zep.h phalcon.zep.h
pecl package
phalcon_package="`ls | grep phalcon-*tgz`"
mv $phalcon_package phalcon-pecl.tgz
Expand Down Expand Up @@ -130,8 +130,8 @@ jobs:
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.2', '7.3', '7.4']
operating-system: [ubuntu-20.04]
php-versions: ['7.4', '8.0']

name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
Expand Down Expand Up @@ -165,9 +165,9 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
ini-values: apc.enable_cli=on, session.save_path=/tmp
tools: pecl, prestissimo
extensions: mbstring, intl, json, imagick
ini-values: apc.enable_cli=on, session.save_path=/tmp, extension=psr.so, extension=phalcon.so
tools: pecl
extensions: mbstring, intl, json, imagick, redis, igbinary, apcu, msgpack, memcached, yaml

- name: Download Phalcon Pecl Package
uses: actions/download-artifact@v1
Expand All @@ -192,22 +192,26 @@ jobs:
vendor/bin/codecept build
- name: Run Unit Tests
if: always()
run: vendor/bin/codecept run --ext DotReporter unit

- name: Run CLI Tests
if: always()
run: vendor/bin/codecept run --ext DotReporter cli

- name: Run Integration Tests
env:
DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }}
if: always()
run: vendor/bin/codecept run --ext DotReporter integration

- name: Run Database Tests (Common)
env:
DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }}
DATA_MYSQL_USER: root
if: always()
run: vendor/bin/codecept run --ext DotReporter database -g common

- name: Run Database Tests (MySQL)
Expand All @@ -216,12 +220,14 @@ jobs:
DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }}
DATA_MYSQL_USER: root
run: vendor/bin/codecept run database --env mysql -g mysql
if: always()
run: vendor/bin/codecept run --ext DotReporter database --env mysql -g mysql

- name: Run Database Tests (Sqlite)
env:
DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }}
if: always()
run: vendor/bin/codecept run --ext DotReporter database --env sqlite -g sqlite

- name: Run Database Tests (Postgres)
Expand All @@ -230,6 +236,7 @@ jobs:
DATA_POSTGRES_PORT: ${{ job.services.postgres.ports['5432'] }}
DATA_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
DATA_MEMCACHED_PORT: ${{ job.services.memcached.ports['11211'] }}
if: always()
run: vendor/bin/codecept run --ext DotReporter database --env pgsql -g pgsql

# - name: Run Database Tests (SQL Server)
Expand All @@ -251,7 +258,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [macos-latest]
php-versions: ['7.2', '7.3', '7.4']
php-versions: ['7.4', '8.0']

name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
Expand Down Expand Up @@ -330,6 +337,7 @@ jobs:
xcodebuild -version
export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
sudo pecl -v install phalcon-pecl/phalcon-pecl.tgz
sudo pecl -v install msgpack
- name: Verify Install
run: php --ri phalcon
Expand Down Expand Up @@ -360,21 +368,18 @@ jobs:
fail-fast: false
matrix:
operating-system: [windows-2016]
php-versions: ['7.2', '7.3', '7.4']
php-versions: ['7.4', '8.0']
ts: [ts, nts]
include:
- php-versions: '7.2'
vc_num: '15'
arch: x64
build_type: Win32
- php-versions: '7.3'
vc_num: '15'
- php-versions: '7.4'
vc_num: 'vc15'
arch: x64
build_type: Win32
- php-versions: '7.4'
vc_num: '15'
- php-versions: '8.0'
vc_num: 'vs16'
arch: x64
build_type: Win32

steps:

- name: Disable Git autocrlf
Expand All @@ -390,38 +395,41 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
ini-values: apc.enable_cli=on, session.save_path=C:\temp
tools: pecl, prestissimo
extensions: mbstring, intl, json, yaml, apcu, psr, imagick, gd, redis, igbinary, sqlite3, msgpack
tools: pecl
extensions: mbstring, intl, json, yaml, apcu, imagick, gd, redis, igbinary, sqlite3, msgpack
env:
PHPTS: ${{ matrix.ts }}

- name: Setup Environment Variables
run: |
echo "::set-env name=PHP_SDK_VERSION::2.2.0"
echo "::set-env name=PHP_DEVPACK::C:\tools\php-devpack"
echo "::set-env name=PHP_SDK_PATH::C:\tools\php-sdk"
echo "::set-env name=PHP_PECL_PATH::C:\tools\pecl"
Write-Output "PHP_SDK_VERSION=2.2.0" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHP_DEVPACK=C:\tools\php-devpack" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHP_SDK_PATH=C:\tools\php-sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHP_PECL_PATH=C:\tools\pecl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PSR_VERSION=1.0.1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# FIXME: phpversion() return 7.4.3 but windows.php.net has only 7.4.4
# We should parse the following file to get the correct version:
# https://windows.php.net/downloads/releases/sha256sum.txt
If ("${{ matrix.php-versions }}" -eq "7.4") {
echo "::set-env name=PHP_VERSION::7.4.4"
Write-Output "PHP_VERSION=7.4.4" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} Else {
echo "::set-env name=PHP_VERSION::$(php -r 'echo phpversion();')"
Write-Output "PHP_VERSION=$(php -r 'echo phpversion();')" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
echo "::set-env name=PHP_MINOR::${{ matrix.php-versions }}"
echo "::set-env name=TEST_PHP_EXECUTABLE::${env:PHPROOT}\php.exe"
echo "::set-env name=VC_VERSION::${{ matrix.vc_num }}"
echo "::set-env name=PHP_ARCH::${{ matrix.arch }}"
echo "::set-env name=PACKAGE_PREFIX::phalcon"
echo "::set-env name=EXTENSION_NAME::phalcon"
echo "::set-env name=EXTENSION_FILE::php_phalcon.dll"
echo "::set-env name=PHALCON_VERSION::4.1.0"
echo "::set-env name=PHPTS::${{ matrix.ts }}"
Write-Output "PHP_MINOR=${{ matrix.php-versions }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "TEST_PHP_EXECUTABLE=${env:PHPROOT}\php.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "VC_VERSION=${{ matrix.vc_num }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHP_ARCH=${{ matrix.arch }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PACKAGE_PREFIX=phalcon" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "EXTENSION_NAME=phalcon" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "EXTENSION_FILE=php_phalcon.dll" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHALCON_VERSION=5.0.0alpha1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHPTS=${{ matrix.ts }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
If ("${{ matrix.ts }}" -eq "nts") {
echo "::set-env name=BUILD_TYPE::nts-${{ matrix.build_type }}"
Write-Output "BUILD_TYPE=nts-${{ matrix.build_type }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} Else {
echo "::set-env name=BUILD_TYPE::${{ matrix.build_type }}"
Write-Output "BUILD_TYPE=${{ matrix.build_type }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
- name: Setup Composer Token
run: |
Expand Down Expand Up @@ -483,17 +491,41 @@ jobs:
shell: powershell
run: |
$v = "${env:WindowsSDKVersion}" -replace '\\$', ''
Write-Output "::set-env name=WindowsSDKVersion::$v"
Write-Output "WindowsSDKVersion=$v" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
$v = "${env:WindowsSDKLibVersion}" -replace '\\$', ''
Write-Output "::set-env name=WindowsSDKLibVersion::$v"
Write-Output "WindowsSDKLibVersion=$v" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Unpack Package
run: |
Import-Module .\.ci\win-ci-tools.psm1
Expand-Item7zip "phalcon-pecl\phalcon-pecl.tgz" "${env:Temp}"
Expand-Item7zip "${env:Temp}\phalcon-pecl.tar" "${env:PHP_PECL_PATH}\phalcon"
- name: PSR extension | init, phpize
shell: cmd
run: |
set PATH=%PATH%;%PHP_DEVPACK%
git clone https://github.com/jbboehr/php-psr.git %PHP_PECL_PATH%\psr\psr-%PSR_VERSION%
if not exist "%PHP_DEVPACK%\include\ext\psr" MkDir "%PHP_DEVPACK%\include\ext\psr"
cd /d %PHP_PECL_PATH%\psr\psr-%PSR_VERSION%
phpize
- name: PSR extension | configure
shell: cmd
run: |
set PATH=%PATH%;%PHP_DEVPACK%
cd /d %PHP_PECL_PATH%\psr\psr-%PSR_VERSION%
configure --enable-psr
- name: PSR extension | build
shell: cmd
run: |
set PATH=%PATH%;%PHP_DEVPACK%
cd /d %PHP_PECL_PATH%\psr\psr-%PSR_VERSION%
nmake
nmake install
- name: Run phpize
shell: cmd
run: |
Expand All @@ -511,7 +543,7 @@ jobs:
- name: Build Project
shell: cmd
run: |
set PATH=%PATH%;%PHP_DEVPACK%
set PATH=%PATH%;%PHP_DEVPACK%;%PHP_PECL_PATH%\psr\psr-%PSR_VERSION%
cd /d %PHP_PECL_PATH%\phalcon\phalcon-%PHALCON_VERSION%
nmake
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,21 @@ jobs:
ports:
- 11211

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
name: Build & Run
steps:

- name: Setup Environment Variables
run: |
echo "::set-env name=ZEPHIR_PARSER_VERSION::v1.3.4"
echo "::set-env name=ZEPHIR_VERSION::0.12.19"
echo "ZEPHIR_PARSER_VERSION=v1.3.6" >> $GITHUB_ENV
echo "ZEPHIR_VERSION=0.13.0-beta-1" >> $GITHUB_ENV
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: mbstring, intl, json, psr, imagick, apcu
ini-values: apc.enable_cli=on, session.save_path=/tmp
tools: prestissimo
php-version: '8.0'
extensions: mbstring, intl, json, imagick, apcu, yaml, redis, igbinary, msgpack
ini-values: apc.enable_cli=on, session.save_path=/tmp, extension=psr.so, extension=phalcon.so

- name: Common Settings
run: |
Expand Down Expand Up @@ -116,9 +115,10 @@ jobs:

- name: Generate C code
run: |
sudo pecl install psr
$HOME/bin/zephir fullclean
$HOME/bin//zephir build
echo "extension=phalcon.so" >> /etc/php/7.4/cli/php.ini
$HOME/bin/zephir build
sudo echo "extension=phalcon.so" >> /etc/php/8.0/cli/php.ini
- name: Verify Install
run: php --ri phalcon
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/packagecloud-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
# git commit -m "......... [ci skip]"
if: "!contains(github.event.head_commit.message, 'ci skip')"

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# git commit -m "......... [ci skip]"
if: "!contains(github.event.head_commit.message, 'ci skip')"

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v2
Expand Down
Loading

0 comments on commit b08eab7

Please sign in to comment.