Skip to content

Commit fda0af9

Browse files
authored
Merge pull request #55 from Bearsampp/ci/php-extension-validation
ci/php-extension-validation
2 parents 9609479 + 13af649 commit fda0af9

File tree

10 files changed

+4002
-1
lines changed

10 files changed

+4002
-1
lines changed
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: PHP Extension Validation
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
types: [ opened, synchronize, reopened ]
7+
8+
jobs:
9+
test-php:
10+
runs-on: windows-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [ win10-amd, win10-intel, win11-amd, win11-intel ]
15+
16+
steps:
17+
- name: Checkout PR branch
18+
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Get diff of releases.properties
23+
run: |
24+
git fetch origin main
25+
git diff origin/main...HEAD -- releases.properties | `
26+
Select-String '^+' | `
27+
Where-Object { $_ -notmatch '^\+\+' } | `
28+
ForEach-Object { $_.Line.TrimStart('+') } > new_versions.txt
29+
30+
- name: Loop through new PHP versions
31+
run: |
32+
$versions = Get-Content new_versions.txt
33+
foreach ($version in $versions) {
34+
Write-Host "Testing PHP $version on ${{ matrix.os }}"
35+
# TODO: Insert your extension validation logic here
36+
}
37+
38+
# Publish per-matrix result as an artifact for aggregation
39+
- name: Publish result artifact
40+
if: always()
41+
run: |
42+
$status = "${{ job.status }}"
43+
if ($status -eq "success") { "pass" | Out-File result.txt -Encoding utf8 } else { "fail" | Out-File result.txt -Encoding utf8 }
44+
"${{ matrix.os }}" | Out-File os.txt -Encoding utf8
45+
shell: pwsh
46+
47+
- name: Upload result artifact
48+
if: always()
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: result-${{ matrix.os }}
52+
path: |
53+
result.txt
54+
os.txt
55+
56+
aggregate:
57+
name: Aggregate results and comment
58+
needs: test-php
59+
runs-on: windows-latest
60+
if: always()
61+
steps:
62+
- name: Checkout repo
63+
uses: actions/checkout@v3
64+
65+
- name: Download result artifacts (win10-amd)
66+
uses: actions/download-artifact@v4
67+
with:
68+
name: result-win10-amd
69+
path: results/win10-amd
70+
71+
- name: Download result artifacts (win10-intel)
72+
uses: actions/download-artifact@v4
73+
with:
74+
name: result-win10-intel
75+
path: results/win10-intel
76+
77+
- name: Download result artifacts (win11-amd)
78+
uses: actions/download-artifact@v4
79+
with:
80+
name: result-win11-amd
81+
path: results/win11-amd
82+
83+
- name: Download result artifacts (win11-intel)
84+
uses: actions/download-artifact@v4
85+
with:
86+
name: result-win11-intel
87+
path: results/win11-intel
88+
89+
- name: Build combined comment
90+
id: build
91+
run: |
92+
function Get-Result {
93+
param([string]$Path)
94+
if (Test-Path "$Path/result.txt") { (Get-Content "$Path/result.txt").Trim() } else { "missing" }
95+
}
96+
97+
$items = @(
98+
@{ os = 'win10-amd'; path = 'results/win10-amd' },
99+
@{ os = 'win10-intel'; path = 'results/win10-intel' },
100+
@{ os = 'win11-amd'; path = 'results/win11-amd' },
101+
@{ os = 'win11-intel'; path = 'results/win11-intel' }
102+
)
103+
104+
$anyFail = $false
105+
$lines = @()
106+
foreach ($it in $items) {
107+
$res = Get-Result -Path $it.path
108+
$status = if ($res -eq 'pass') { 'passed' } else { 'failed' }
109+
if ($status -eq 'failed') { $anyFail = $true }
110+
111+
# Build a valid shields badge per OS
112+
$label = [uri]::EscapeDataString('PHP Test')
113+
$msg = [uri]::EscapeDataString($it.os + ' ' + $status)
114+
$color = if ($status -eq 'passed') { 'brightgreen' } else { 'red' }
115+
$badge = "https://img.shields.io/static/v1?label=$label&message=$msg&color=$color&logo=windows&logoColor=white"
116+
$lines += "- $($it.os): ![]($badge)"
117+
}
118+
119+
$header = if (-not $anyFail) { 'βœ… All PHP extension tests passed' } else { '❌ Some PHP extension tests failed' }
120+
121+
$content = @()
122+
$content += "### $header"
123+
$content += ""
124+
$content += $lines
125+
$contentText = $content -join "`n"
126+
127+
# Save for comment
128+
$contentText | Out-File aggregate.md -Encoding utf8
129+
shell: pwsh
130+
131+
- name: Post single PR comment
132+
if: always()
133+
run: |
134+
gh pr comment -R "${{ github.repository }}" ${{ github.event.pull_request.number }} --body "$(Get-Content -Raw aggregate.md)"
135+
env:
136+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137+
shell: pwsh

β€Žbin/php8.4.10/bearsampp.confβ€Ž

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
phpVersion = "8.4.10"
2+
phpCliExe = "php.exe"
3+
phpCliSilentExe = "php-win.exe"
4+
phpConf = "php.ini"
5+
phpPearExe = "pear/pear.bat"
6+
7+
apache24 = "php8apache2_4.dll"
8+
9+
bundleRelease = "@RELEASE_VERSION@"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
imagemagick = https://github.com/Bearsampp/modules-untouched/releases/download/php-2025.8.20/ImageMagick-7.1.2-0-portable-Q16-x64.zip
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Place dependencies required by PHP here like PECL deps (http://windows.php.net/downloads/pecl/deps/).
2+
The dependencies will be injected into the PATH environment variable.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
imagick = https://github.com/Bearsampp/modules-untouched/releases/download/php-2025.8.20/php_imagick-3.7.0-8.4-ts-vs17-x64.zip
2+
memcache = https://github.com/Bearsampp/modules-untouched/releases/download/php-2025.8.20/php-8.4.x_memcache.dll
3+
xdebug = https://github.com/Bearsampp/modules-untouched/releases/download/php-2025.8.20/php_xdebug-3.4.5-8.4-ts-vs17-x86_64.dll
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pear = https://github.com/Bearsampp/modules-untouched/releases/download/php-2025.8.20/install-pear-nozlib.phar

0 commit comments

Comments
Β (0)