mirror of
https://github.com/php/php-windows-builder.git
synced 2026-03-24 07:32:19 +01:00
62 lines
2.3 KiB
YAML
62 lines
2.3 KiB
YAML
name: Test PHP
|
|
run-name: Test PHP ${{ inputs.php-version }}
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
php-version:
|
|
description: 'PHP version to test'
|
|
required: true
|
|
|
|
jobs:
|
|
php:
|
|
strategy:
|
|
matrix:
|
|
arch: [x64, x86]
|
|
ts: [nts, ts]
|
|
opcache: [opcache, nocache]
|
|
test-type: [php, ext]
|
|
runs-on: windows-2022
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Get Cache Key
|
|
id: cache-key
|
|
run: |
|
|
$pv = '${{inputs.php-version}}'
|
|
if('${{inputs.php-version}}' -ne 'master') {
|
|
$pv = '${{inputs.php-version}}'.Split('.')[0..1] -join '.'
|
|
}
|
|
$vsVersion = (Get-Content -Raw -Path (Join-Path $(pwd).Path '\php\BuildPhp\config\vs.json') | ConvertFrom-Json).php.$pv
|
|
$packagesListUrl = "https://downloads.php.net/~windows/php-sdk/deps/series/packages-$pv-$vsVersion-${{ matrix.arch }}-staging.txt"
|
|
Invoke-WebRequest -OutFile packages.txt -Uri $packagesListUrl
|
|
Add-Content -Value "cache-key=deps-$pv-${{ matrix.arch }}" -Path $env:GITHUB_OUTPUT
|
|
Add-Content -Value "cache-dir=C:\deps-$pv-${{ matrix.arch }}" -Path $env:GITHUB_OUTPUT
|
|
|
|
- name: Cache Deps
|
|
id: cache-deps
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: ${{ steps.cache-key.outputs.cache-dir }}
|
|
key: ${{ steps.cache-key.outputs.cache-key }}-${{ hashFiles('packages.txt') }}
|
|
|
|
- name: Run Tests
|
|
shell: pwsh
|
|
continue-on-error: true
|
|
env:
|
|
DEPS_DIR: ${{ steps.cache-key.outputs.cache-dir }}
|
|
DEPS_CACHE_HIT: ${{ steps.cache-deps.outputs.cache-hit }}
|
|
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}} `
|
|
-TestType ${{matrix.test-type}}
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: test-results-${{matrix.arch}}-${{matrix.ts}}-${{matrix.opcache}}-${{matrix.test-type}}
|
|
path: test-${{matrix.arch}}-${{matrix.ts}}-${{matrix.opcache}}-${{matrix.test-type}}.xml
|