Skip to content

Commit

Permalink
Fail build on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Feb 8, 2019
1 parent 92920ed commit 328398e
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ init:
## Install PHP and composer, and run the appropriate composer command
install:
- ps: |
$ErrorActionPreference = "Stop"
# Check if installation is cached
if (!(Test-Path c:\tools\php)) {
appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
Expand Down Expand Up @@ -125,23 +127,25 @@ install:
before_test:
# Selectively start the services
- ps: >-
$ErrorActionPreference = "Stop"
if ($env:db -eq "mssql") {
$instanceName = $env:db_version.ToUpper()
net start "MSSQL`$$instanceName"
}
test_script:
- cd C:\projects\dbal
- ps: >-
if ($env:db_version) {
$env:phpunit_config = "tests\appveyor\$($env:db).$($env:db_version).$($env:driver).appveyor.xml"
} else {
$env:phpunit_config = "tests\appveyor\$($env:db).$($env:driver).appveyor.xml"
}
- ps: >-
if ($env:coverage -eq "yes") {
vendor\bin\phpunit -c $($env:phpunit_config) --coverage-clover clover.xml
appveyor-retry ocular code-coverage:upload --format=php-clover clover.xml
} else {
vendor\bin\phpunit -c $($env:phpunit_config)
}
- cmd: >-
if defined db_version (
set "phpunit_config=tests\appveyor\%db%.%db_version%.%driver%.appveyor.xml"
) else (
set "phpunit_config=tests\appveyor\%db%.%driver%.appveyor.xml"
)
if defined coverage (
vendor\bin\phpunit -c %phpunit_config% --coverage-clover clover.xml || exit /b
appveyor-retry ocular code-coverage:upload --format=php-clover clover.xml
) else (
vendor\bin\phpunit -c %phpunit_config%
)

0 comments on commit 328398e

Please sign in to comment.