Skip to content

Commit

Permalink
Update Windows CI (#89)
Browse files Browse the repository at this point in the history
* Update setup-php-sdk to v0.10 and enable caching
* Update AppVeyor CI
  * use php-sdk 2.3.0 from php fork (the microsoft repo is archieved)
  * switch to downloads.php.net
  * update to latest releases of PHP 7.*
* Add jobs for PHP 8.4 (requires to use windows-2022 runners)
  • Loading branch information
cmb69 authored Sep 30, 2024
1 parent 7e6f786 commit 0a2ff6d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 24 deletions.
14 changes: 7 additions & 7 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@ cache:
- c:\build-cache -> .appveyor.yml, .appveyor\install.ps1

environment:
BIN_SDK_VER: 2.2.0
BIN_SDK_VER: 2.3.0
matrix:
- PHP_VER: 7.2.30
- PHP_VER: 7.2.34
ARCH: x64
TS: 1
VC: vc15
DEP: libyaml-0.1.7
- PHP_VER: 7.2.30
- PHP_VER: 7.2.34
ARCH: x86
TS: 0
VC: vc15
DEP: libyaml-0.1.7
- PHP_VER: 7.3.17
- PHP_VER: 7.3.33
ARCH: x64
TS: 1
VC: vc15
DEP: libyaml-0.1.7
- PHP_VER: 7.3.17
- PHP_VER: 7.3.33
ARCH: x86
TS: 0
VC: vc15
DEP: libyaml-0.1.7
- PHP_VER: 7.4.5
- PHP_VER: 7.4.33
ARCH: x64
TS: 1
VC: vc15
DEP: libyaml-0.1.7
- PHP_VER: 7.4.5
- PHP_VER: 7.4.33
ARCH: x86
TS: 0
VC: vc15
Expand Down
31 changes: 19 additions & 12 deletions .appveyor/install.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
if (-not (Test-Path c:\build-cache)) {
mkdir c:\build-cache
}

if ($env:PHP_VER -lt "7.4") {
$vc = $env:VC.toUpper()
} else {
$vc = $env:VC
}

$bname = 'php-sdk-' + $env:BIN_SDK_VER + '.zip'
if (-not (Test-Path c:\build-cache\$bname)) {
Invoke-WebRequest "https://github.com/microsoft/php-sdk-binary-tools/archive/$bname" -OutFile "c:\build-cache\$bname"
Invoke-WebRequest "https://github.com/php/php-sdk-binary-tools/archive/$bname" -OutFile "c:\build-cache\$bname"
}
$dname0 = 'php-sdk-binary-tools-php-sdk-' + $env:BIN_SDK_VER
$dname1 = 'php-sdk-' + $env:BIN_SDK_VER
Expand All @@ -13,15 +20,15 @@ if (-not (Test-Path c:\build-cache\$dname1)) {
}
$ts_part = ''
if ('0' -eq $env:TS) { $ts_part = '-nts' }
$bname = 'php-devel-pack-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC.toUpper() + '-' + $env:ARCH + '.zip'
$bname = 'php-devel-pack-' + $env:PHP_VER + $ts_part + '-Win32-' + $vc + '-' + $env:ARCH + '.zip'
if (-not (Test-Path c:\build-cache\$bname)) {
Invoke-WebRequest "http://windows.php.net/downloads/releases/archives/$bname" -OutFile "c:\build-cache\$bname"
Invoke-WebRequest "https://downloads.php.net/~windows/releases/archives/$bname" -OutFile "c:\build-cache\$bname"
if (-not (Test-Path c:\build-cache\$bname)) {
Invoke-WebRequest "http://windows.php.net/downloads/releases/$bname" -OutFile "c:\build-cache\$bname"
Invoke-WebRequest "hhttps://downloads.php.net/~windows/releases/$bname" -OutFile "c:\build-cache\$bname"
}
}
$dname0 = 'php-' + $env:PHP_VER + '-devel-' + $env:VC.toUpper() + '-' + $env:ARCH
$dname1 = 'php-' + $env:PHP_VER + $ts_part + '-devel-' + $env:VC.toUpper() + '-' + $env:ARCH
$dname0 = 'php-' + $env:PHP_VER + '-devel-' + $vc + '-' + $env:ARCH
$dname1 = 'php-' + $env:PHP_VER + $ts_part + '-devel-' + $vc + '-' + $env:ARCH
if (-not (Test-Path c:\build-cache\$dname1)) {
7z x c:\build-cache\$bname -oc:\build-cache
if ($dname0 -ne $dname1) {
Expand All @@ -31,22 +38,22 @@ if (-not (Test-Path c:\build-cache\$dname1)) {
$env:PHP_DEVEL_PATH = 'c:\build-cache\' + $dname1
$env:PATH = $env:PHP_DEVEL_PATH + ';' + $env:PATH

$bname = 'php-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC.toUpper() + '-' + $env:ARCH + '.zip'
$bname = 'php-' + $env:PHP_VER + $ts_part + '-Win32-' + $vc + '-' + $env:ARCH + '.zip'
if (-not (Test-Path c:\build-cache\$bname)) {
Invoke-WebRequest "http://windows.php.net/downloads/releases/archives/$bname" -OutFile "c:\build-cache\$bname"
Invoke-WebRequest "https://downloads.php.net/~windows/releases/archives/$bname" -OutFile "c:\build-cache\$bname"
if (-not (Test-Path c:\build-cache\$bname)) {
Invoke-WebRequest "http://windows.php.net/downloads/releases/$bname" -OutFile "c:\build-cache\$bname"
Invoke-WebRequest "https://downloads.php.net/~windows/releases/$bname" -OutFile "c:\build-cache\$bname"
}
}
$dname = 'php-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC.toUpper() + '-' + $env:ARCH
$dname = 'php-' + $env:PHP_VER + $ts_part + '-Win32-' + $vc + '-' + $env:ARCH
if (-not (Test-Path c:\build-cache\$dname)) {
7z x c:\build-cache\$bname -oc:\build-cache\$dname
}
$env:PHP_PATH = 'c:\build-cache\' + $dname
$env:PATH = $env:PHP_PATH + ';' + $env:PATH

$bname = $env:DEP + '-' + $env:VC.toUpper() + '-' + $env:ARCH + '.zip'
$bname = $env:DEP + '-' + $env:VC.toLower() + '-' + $env:ARCH + '.zip'
if (-not (Test-Path c:\build-cache\$bname)) {
Invoke-WebRequest "http://windows.php.net/downloads/pecl/deps/$bname" -OutFile "c:\build-cache\$bname"
Invoke-WebRequest "http://downloads.php.net/~windows/pecl/deps/$bname" -OutFile "c:\build-cache\$bname"
7z x c:\build-cache\$bname -oc:\build-cache\deps
}
9 changes: 4 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:

windows:
name: Windows
runs-on: windows-2019
runs-on: windows-2022

defaults:
run:
Expand All @@ -81,13 +81,12 @@ jobs:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
arch:
- "x64"
ts:
- nts
- ts
vsversion:
- "16.0"
libyaml:
- libyaml-0.1.7-vs16

Expand All @@ -98,11 +97,12 @@ jobs:
uses: actions/checkout@v3
- name: Setup PHP
id: setup-php
uses: php/setup-php-sdk@v0.8
uses: php/setup-php-sdk@v0.10
with:
version: "${{ matrix.php-version }}"
arch: "${{ matrix.arch }}"
ts: "${{ matrix.ts }}"
cache: true
- name: Download deps
run: |
curl -LO https://windows.php.net/downloads/pecl/deps/${{ matrix.libyaml }}-${{ matrix.arch }}.zip
Expand All @@ -113,7 +113,6 @@ jobs:
with:
arch: "${{ matrix.arch }}"
toolset: "${{ steps.setup-php.outputs.toolset }}"
vsversion: "${{ matrix.vsversion }}"
- name: Generate build files
run: phpize
- name: Configure build
Expand Down

0 comments on commit 0a2ff6d

Please sign in to comment.