Skip to content

Testing windows compile all php 8.x variants #4

Testing windows compile all php 8.x variants

Testing windows compile all php 8.x variants #4

name: Compile on Windows
on: [push, pull_request]
jobs:
windows:
runs-on: windows-latest
name: "Windows: Build and test"
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
php: ["8.0", "8.1", "8.2", "8.3"]
arch: [x64, x86]
ts: [nts,ts]
experimental: [false]
steps:
- name: Checkout Xdebug
uses: actions/checkout@v4
- name: Extract Phalcon Version
shell: powershell
run: |
chcp 65001
$r = Select-String -Path build/phalcon/php_phalcon.h -Pattern 'PHP_PHALCON_VERSION\s+"(.*)"'
$s = $r.Matches[0].Groups[1]
echo "$s"
$PhalconVersion = 'PHALCON_VERSION=' + $s
echo $PhalconVersion >> $env:GITHUB_ENV
- name: Setup PHP
id: setup-php
uses: php/[email protected]
with:
version: ${{matrix.php}}
arch: ${{matrix.arch}}
ts: ${{matrix.ts}}
deps: zlib
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.arch}}
toolset: ${{steps.setup-php.outputs.toolset}}
- name: Phpize
run: |
cd build/phalcon/
phpize
- name: Configure
run: |
cd build/phalcon/
./configure --enable-phalcon --with-prefix=${{steps.setup-php.outputs.prefix}}
- name: Make
run: |
cd build/phalcon/
nmake
- name: Define Phalcon Module Env
shell: powershell
run: |
chcp 65001
$dir = (Get-Location).Path + '\build\phalcon\'
if ('x64' -eq '${{matrix.arch}}') { $dir = $dir + 'x64\' }
$dir = $dir + 'Release'
if ('ts' -eq '${{matrix.ts}}') { $dir = $dir + '_TS' }
$phalconDllOpt = 'TEST_PHP_ARGS=-n -d zend_extension=' + $dir + '\php_phalcon.dll'
echo $phalconDllOpt >> $env:GITHUB_ENV
$artifactName = 'php_phalcon-${{env.XDEBUG_VERSION}}-${{matrix.php}}'
if ('8.0' -eq '${{matrix.php}}') { $artifactName = $artifactName + '-vs16' }
if ('8.1' -eq '${{matrix.php}}') { $artifactName = $artifactName + '-vs16' }
if ('8.2' -eq '${{matrix.php}}') { $artifactName = $artifactName + '-vs16' }
if ('8.3' -eq '${{matrix.php}}') { $artifactName = $artifactName + '-vs16' }
if ('nts' -eq '${{matrix.ts}}') { $artifactName = $artifactName + '-nts' }
if ('x64' -eq '${{matrix.arch}}') { $artifactName = $artifactName + '-x86_64' }
$phalconArtifactName = "ARTIFACT_NAME=" + $artifactName
echo $phalconArtifactName >> $env:GITHUB_ENV
$from = $dir + '\php_phalcon.dll'
$to = $dir + '\' + $artifactName + ".dll"
Copy-Item $from -Destination $to
$phalconArtifact = "ARTIFACT=" + $to
echo $phalconArtifact >> $env:GITHUB_ENV
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{env.ARTIFACT_NAME}}
path: ${{env.ARTIFACT}}