Skip to content

Bump cachix/install-nix-action from 27 to 29 #64

Bump cachix/install-nix-action from 27 to 29

Bump cachix/install-nix-action from 27 to 29 #64

Workflow file for this run

name: windows
on:
push:
branches:
- master
- develop
- dev-1.x
- github-actions
- ci
- windows
pull_request:
branches:
- master
jobs:
test_windows:
if: "!contains(github.event.head_commit.message, 'ci skip')"
name: PHP ${{ matrix.php-versions }} / ${{ matrix.ts }} / ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [windows-latest]
php-versions: ["7.4", "8.0", "8.1"]
ts: [ts, nts]
include:
- php-versions: "7.4"
vc_num: "vc15"
arch: x64
build_type: Win32
- php-versions: "8.0"
vc_num: "vs16"
arch: x64
build_type: Win32
- php-versions: "8.1"
vc_num: "vs16"
arch: x64
build_type: Win32
steps:
- name: Disable Git autocrlf
run: git config --global core.autocrlf false
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
ini-values: apc.enable_cli=on, session.save_path=C:\temp
tools: pecl
env:
PHPTS: ${{ matrix.ts }}
- name: Setup Environment Variables
run: |
Write-Output "PHP_SDK_VERSION=2.2.0" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHP_DEVPACK=C:\tools\php-devpack" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHP_SDK_PATH=C:\tools\php-sdk" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHP_PECL_PATH=C:\tools\pecl" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# FIXME: phpversion() return 7.4.3 but windows.php.net has only 7.4.4
# We should parse the following file to get the correct version:
# https://windows.php.net/downloads/releases/sha256sum.txt
If ("${{ matrix.php-versions }}" -eq "7.4") {
Write-Output "PHP_VERSION=7.4.4" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} Else {
Write-Output "PHP_VERSION=$(php -r 'echo phpversion();')" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
Write-Output "PHP_MINOR=${{ matrix.php-versions }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "TEST_PHP_EXECUTABLE=${env:PHPROOT}\php.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "VC_VERSION=${{ matrix.vc_num }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHP_ARCH=${{ matrix.arch }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PACKAGE_PREFIX=psr" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "EXTENSION_NAME=psr" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "EXTENSION_FILE=php_psr.dll" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Write-Output "PHPTS=${{ matrix.ts }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
If ("${{ matrix.ts }}" -eq "nts") {
Write-Output "BUILD_TYPE=nts-${{ matrix.build_type }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} Else {
Write-Output "BUILD_TYPE=${{ matrix.build_type }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
- name: Setup Common Environment
run: |
Import-Module .\.ci\win-ci-tools.psm1
SetupCommonEnvironment
- name: Install PHP SDK Binary Tools
run: |
Import-Module .\.ci\win-ci-tools.psm1
InstallPhpSdk
- name: Install PHP Dev pack
run: |
Import-Module .\.ci\win-ci-tools.psm1
InstallPhpDevPack
- name: Getting Details About Installed PHP
run: |
Import-Module .\.ci\win-ci-tools.psm1
Get-Php "${env:PHPROOT}"
- name: Install System Dependencies
run: choco install -y --cache-location=C:\Downloads\Choco re2c
- name: Initialize Release Variables
run: |
Import-Module .\.ci\win-ci-tools.psm1
InitializeReleaseVars
- name: "Setup Visual Studio Command Line for PHP SDK ${{ matrix.arch }}"
run: .ci\vsenv.bat -arch=${{ matrix.arch }} -host_arch=${{ matrix.arch }}
- name: Fix Environment Variables
shell: powershell
run: |
$v = "${env:WindowsSDKVersion}" -replace '\\$', ''
Write-Output "WindowsSDKVersion=$v" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
$v = "${env:WindowsSDKLibVersion}" -replace '\\$', ''
Write-Output "WindowsSDKLibVersion=$v" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: PSR extension | init, phpize
shell: cmd
run: |
set PATH=%PATH%;%PHP_DEVPACK%
phpize
- name: PSR extension | configure
shell: cmd
run: |
set PATH=%PATH%;%PHP_DEVPACK%
configure --disable-all --enable-psr --with-prefix=%PHPROOT%
- name: PSR extension | build
shell: cmd
run: |
set PATH=%PATH%;%PHP_DEVPACK%
nmake
nmake install
- name: PSR extension | test
shell: cmd
run: |
set PATH=%PATH%;%PHP_DEVPACK%
nmake test
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_ZIPBALL }}
path: ${{ env.RELEASE_DLL_PATH }}
- name: Upload build artifacts after Failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: workspace
path: ${{ github.workspace }}
retention-days: 1