Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Build
uses: ./php
with:
php-version: ${{ github.event.inputs.php-version }}
php-version: ${{ inputs.php-version }}
arch: ${{ matrix.arch }}
ts: ${{ matrix.ts }}

Expand All @@ -43,9 +43,46 @@ jobs:
with:
name: artifacts
delete-merged: true
tests:
strategy:
matrix:
arch: [x64, x86]
ts: [nts, ts]
opcache: [opcache, nocache]
runs-on: windows-2022
needs: artifacts
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v5
id: artifacts
with:
name: artifacts

- name: Setup MySQL
uses: ankane/setup-mysql@v1
with:
database: test

- name: Test PHP
shell: pwsh
run: |
Import-Module (Join-Path $(pwd).Path '\php\BuildPhp') -Force
Invoke-PhpTests -PhpVersion ${{inputs.php-version}} `
-Arch ${{matrix.arch}} `
-Ts ${{matrix.ts}} `
-Opcache ${{matrix.opcache}}

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: test-results-${{matrix.arch}}-${{matrix.ts}}-${{matrix.opcache}}
path: test-${{matrix.arch}}-${{matrix.ts}}-${{matrix.opcache}}.xml
upload:
runs-on: ubuntu-latest
needs: artifacts
needs: tests
if: ${{ github.event.inputs.upload == 'true' }}
steps:
- name: Upload to downloads server
Expand Down
22 changes: 19 additions & 3 deletions php/BuildPhp/private/Add-TestRequirements.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,29 @@ function Add-TestRequirements {
[string] $VsVersion,
[Parameter(Mandatory = $false, Position=4, HelpMessage='Tests Directory')]
[ValidateLength(1, [int]::MaxValue)]
[string] $TestsDirectory
[string] $TestsDirectory,
[Parameter(Mandatory = $true, Position=5, HelpMessage='Artifacts Directory')]
[ValidateNotNull()]
[string] $ArtifactsDirectory
)
begin {
}
process {
Get-PhpBuild -PhpVersion $PhpVersion -Arch $Arch -Ts $Ts -VsVersion $VsVersion
Get-PhpTestPack -PhpVersion $PhpVersion -TestsDirectory $TestsDirectory
$versionInUrl = $PhpVersion
if($PhpVersion -eq 'master') {
$versionInUrl = "master"
}
$tsPart = if ($Ts -eq "nts") {"nts-Win32"} else {"Win32"}
$binZipFile = "php-$versionInUrl-$tsPart-$VsVersion-$Arch.zip"
$testZipFile = "php-test-pack-$versionInUrl.zip"
if(-not(Test-Path "$ArtifactsDirectory\$binZipFile")) {
Write-Host "Downloading PHP build $binZipFile..."
Get-PhpBuild -PhpVersion $PhpVersion -Arch $Arch -Ts $Ts -VsVersion $VsVersion
}
if(-not(Test-Path "$ArtifactsDirectory\$testZipFile")) {
Write-Host "Downloading PHP test pack $testZipFile..."
Get-PhpTestPack -PhpVersion $PhpVersion -TestsDirectory $TestsDirectory
}
}
end {
}
Expand Down
2 changes: 1 addition & 1 deletion php/BuildPhp/public/Invoke-PhpTests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function Invoke-PhpTests {

Set-Location "$buildDirectory"

Add-TestRequirements -PhpVersion $PhpVersion -Arch $Arch -Ts $Ts -VsVersion $VsData.vs -TestsDirectory $testsDirectory
Add-TestRequirements -PhpVersion $PhpVersion -Arch $Arch -Ts $Ts -VsVersion $VsData.vs -TestsDirectory $testsDirectory -ArtifactsDirectory $currentDirectory\artifacts

Set-PhpIniForTests -BuildDirectory $buildDirectory -Opcache $Opcache

Expand Down