Skip to content

Commit 84f3ead

Browse files
committed
Fix testing PHP builds and add a workflow for it
1 parent 2c3a8bc commit 84f3ead

File tree

4 files changed

+44
-5
lines changed

4 files changed

+44
-5
lines changed

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Test PHP
2+
run-name: Test PHP ${{ inputs.php-version }}
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
php-version:
7+
description: 'PHP version to test'
8+
required: true
9+
10+
jobs:
11+
php:
12+
strategy:
13+
matrix:
14+
arch: [x64, x86]
15+
ts: [nts, ts]
16+
opcache: [opcache, nocache]
17+
runs-on: windows-2022
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup MySQL
23+
uses: ankane/setup-mysql@v1
24+
with:
25+
database: test
26+
27+
- name: Test PHP
28+
shell: pwsh
29+
run: |
30+
Import-Module (Join-Path $(pwd).Path '\php\BuildPhp') -Force
31+
Invoke-PhpTests -PhpVersion ${{inputs.php-version}} `
32+
-Arch ${{matrix.arch}} `
33+
-Ts ${{matrix.ts}} `
34+
-Opcache ${{matrix.opcache}}
35+
36+
- name: Upload artifacts
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: test-results-${{matrix.arch}}-${{matrix.ts}}-${{matrix.opcache}}
40+
path: test-${{matrix.arch}}-${{matrix.ts}}-${{matrix.opcache}}.xml

php/BuildPhp/config/tests.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
"8.3": {"runner": "run-tests.php", "workers": "-jNumWorkers", "progress": "--no-progress"},
1111
"8.4": {"runner": "run-tests.php", "workers": "-jNumWorkers", "progress": "--no-progress"},
1212
"8.5": {"runner": "run-tests.php", "workers": "-jNumWorkers", "progress": "--no-progress"},
13-
"default": {"runner": "run-tests.php", "workers": "jNumWorkers", "progress": ""}
13+
"default": {"runner": "run-tests.php", "workers": "jNumWorkers", "progress": "--no-progress"}
1414
}

php/BuildPhp/private/Get-TestSettings.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,5 @@ function Get-TestSettings {
3030
return $settings
3131
}
3232
end {
33-
$settings
3433
}
3534
}

php/BuildPhp/public/Invoke-PhpTests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ function Invoke-PhpTests {
3333
}
3434
process {
3535
Set-NetSecurityProtocolType
36-
$VsVersion = (Get-VsVersion -PhpVersion $PhpVersion)
37-
if($null -eq $VsVersion) {
36+
$VsData = (Get-VsVersion -PhpVersion $PhpVersion)
37+
if($null -eq $VsData.vs) {
3838
throw "PHP version $PhpVersion is not supported."
3939
}
4040

@@ -50,7 +50,7 @@ function Invoke-PhpTests {
5050

5151
Set-Location "$buildDirectory"
5252

53-
Add-TestRequirements -PhpVersion $PhpVersion -Arch $Arch -Ts $Ts -VsVersion $VsVersion -TestsDirectory $testsDirectory
53+
Add-TestRequirements -PhpVersion $PhpVersion -Arch $Arch -Ts $Ts -VsVersion $VsData.vs -TestsDirectory $testsDirectory
5454

5555
Set-PhpIniForTests -BuildDirectory $buildDirectory -Opcache $Opcache
5656

0 commit comments

Comments
 (0)