Skip to content

Commit 744062c

Browse files
committed
ci: add AppVeyor to test Windows
closes felixfbecker#40
1 parent 7ae6452 commit 744062c

File tree

3 files changed

+57
-2
lines changed

3 files changed

+57
-2
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# PHP Language Server
22

33
[![Version](https://img.shields.io/packagist/v/felixfbecker/language-server.svg)](https://packagist.org/packages/felixfbecker/language-server)
4-
[![Build Status](https://travis-ci.org/felixfbecker/php-language-server.svg?branch=master)](https://travis-ci.org/felixfbecker/php-language-server)
4+
[![Linux Build Status](https://travis-ci.org/felixfbecker/php-language-server.svg?branch=master)](https://travis-ci.org/felixfbecker/php-language-server)
5+
[![Windows Build status](https://ci.appveyor.com/api/projects/status/2sp5ll052wdjqmdm/branch/master?svg=true)](https://ci.appveyor.com/project/felixfbecker/php-language-server/branch/master)
56
[![Coverage](https://codecov.io/gh/felixfbecker/php-language-server/branch/master/graph/badge.svg)](https://codecov.io/gh/felixfbecker/php-language-server)
67
[![Dependency Status](https://gemnasium.com/badges/github.com/felixfbecker/php-language-server.svg)](https://gemnasium.com/github.com/felixfbecker/php-language-server)
78
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

appveyor.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
version: '{build}'
2+
3+
platform:
4+
- x64
5+
6+
skip_tags: true
7+
skip_branch_with_pr: true
8+
clone_depth: 1
9+
max_jobs: 3
10+
11+
cache:
12+
- '%LOCALAPPDATA%\Composer'
13+
14+
environment:
15+
ANSICON: 121x90 (121x90)
16+
matrix:
17+
- { PHP_VERSION: '7.1.11', VC_VERSION: '14', XDEBUG_VERSION: '2.5.5' }
18+
19+
install:
20+
# Enable Windows Update service, needed to install vcredist2015 (dependency of php)
21+
- ps: Set-Service wuauserv -StartupType Manual
22+
- choco install -y php --version %PHP_VERSION%
23+
- choco install -y composer
24+
- refreshenv
25+
- composer install --no-interaction --no-progress --prefer-dist
26+
# Install XDebug for code coverage
27+
- ps: |
28+
$client = New-Object System.Net.WebClient
29+
$phpMinorVersion = $env:PHP_VERSION -replace '\.\d+$'
30+
$xdebugUrl = "https://xdebug.org/files/php_xdebug-$env:XDEBUG_VERSION-$phpMinorVersion-vc14-nts-x86_64.dll"
31+
$phpDir = (Get-Item (Get-Command php).Source).Directory.FullName
32+
$xdebugPath = Join-Path $phpDir ext\xdebug.dll
33+
$client.DownloadFile($xdebugUrl, $xdebugPath)
34+
$phpIniPath = Join-Path $phpDir php.ini
35+
Add-Content $phpIniPath @"
36+
zend_extension=$xdebugPath
37+
"@
38+
39+
build: off
40+
41+
test_script:
42+
- vendor\bin\phpunit --coverage-clover=coverage/coverage.xml
43+
44+
after_test:
45+
- ps: |
46+
# Delete vendor because it causes problems with codecovs report search
47+
# https://github.com/codecov/codecov-bash/issues/96
48+
Remove-Item -Recurse -Force vendor
49+
$env:PATH = 'C:\msys64\usr\bin;' + $env:PATH
50+
Invoke-WebRequest -Uri 'https://codecov.io/bash' -OutFile codecov.sh
51+
bash codecov.sh -f 'coverage/coverage.xml'

tests/Validation/ValidationTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ private function getActualTestValues($filename, $fileContents): array
9696
$testCasesDir = realpath(__DIR__ . '/cases');
9797
foreach ($refsAndDefs['references'] as $key => $list) {
9898
$fixedPathRefs = array_map(function ($ref) use ($testCasesDir) {
99-
return str_replace($testCasesDir, '.', $ref);
99+
$ref = str_replace($testCasesDir, '.', $ref);
100+
$ref = str_replace(DIRECTORY_SEPARATOR, '/', $ref);
101+
return $ref;
100102
}, $list);
101103

102104
$refsAndDefs['references']->$key = $fixedPathRefs;
@@ -107,6 +109,7 @@ private function getActualTestValues($filename, $fileContents): array
107109
if ($def !== null && $def->symbolInformation !== null &&
108110
$def->symbolInformation->location !== null && $def->symbolInformation->location->uri !== null) {
109111
$def->symbolInformation->location->uri = str_replace($testCasesDir, '.', $def->symbolInformation->location->uri);
112+
$def->symbolInformation->location->uri = str_replace(DIRECTORY_SEPARATOR, '/', $def->symbolInformation->location->uri);
110113
}
111114
}
112115

0 commit comments

Comments
 (0)