Skip to content

Windows Build

Windows Build #2

Workflow file for this run

name: Windows (tests)
on:
pull_request:
branches:
- "master"
push:
tags:
- "*"
branches:
- "master"
jobs:
windows:
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
version: ["7.4", "8.0", "8.1", "8.2", "8.3"]
arch: [x64, x86]
ts: [ts, nts]
experimental: [false]
runs-on: windows-2019
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Setup PHP
id: setup-php
uses: php/[email protected]
with:
version: ${{matrix.version}}
arch: ${{matrix.arch}}
ts: ${{matrix.ts}}
deps: 'libxml2,libcurl,libiconv,libssh2,openssl,nghttp2'
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.arch}}
toolset: ${{steps.setup-php.outputs.toolset}}
# install extra package deps (zlib) (static: _a.lib, and dynamic .lib)
- name: cache vcpkg libraries
id: cache-vcpkg
uses: actions/cache@v2
with:
path: |
${{github.workspace}}/vcpkg
${{github.workspace}}/vcpkg/installed
key: vcpkg-${{matrix.version}}-${{matrix.arch}}-${{ runner.os }}-${{ hashFiles('**/vcpkg.json') }}
restore-keys: |
vcpkg-${{matrix.version}}-${{matrix.arch}}-${{ runner.os }}-
- name: install zlib with vcpkg
uses: omars44/pecl-windows-deps-installer@master
with:
cache-hit: ${{ steps.cache-vcpkg.outputs.cache-hit }}
libraries: 'zlib'
arch: 'x64'
# start compiling
- name: phpize
run: |
phpize
- name: configure
run: |
configure --with-verbosity=2 --enable-solr --with-php-build=.\..\deps --with-prefix=${{steps.setup-php.outputs.prefix}}
- name: extract variables from Makefile (build_dir and dll_file)
shell: powershell
run: |
$makefileContent = Get-Content -Path ./Makefile -Raw
$buildDirsSub = [regex]::Match($makefileContent, "BUILD_DIRS_SUB=(.*)").Groups[1].Value.Trim()
$peclTargets = [regex]::Match($makefileContent, "PECL_TARGETS=(.*)").Groups[1].Value.Trim()
echo "build_dir=$buildDirsSub" | Out-File -Append -Encoding utf8 -FilePath $env:GITHUB_ENV
echo "dll_file=$peclTargets" | Out-File -Append -Encoding utf8 -FilePath $env:GITHUB_ENV
- name: make
run: |
nmake
- name: did it compile successfully?
shell: powershell
run: |
$dll = Join-Path -Path $env:build_dir -ChildPath $env:dll_file
Write-Host "`"Full DLL path:`" $dll`""
if (!(Test-Path $dll)) {
Write-Host "The path '$dll' does not exist."
exit 1
}
# run tests
- name: test
env:
SOLR_SERVER_CONFIGURED: 0
run: nmake test TESTS="--show-diff -g FAIL,BORK,WARN,LEAK tests"